Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
pitivi
Commits
3f78e856
Commit
3f78e856
authored
Jan 10, 2014
by
Alexandru Băluț
Browse files
ruler: Show the hours and millis only if useful
parent
ec18c353
Changes
2
Hide whitespace changes
Inline
Side-by-side
pitivi/timeline/ruler.py
View file @
3f78e856
...
...
@@ -325,6 +325,7 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
style
=
self
.
get_style_context
()
setCairoColor
(
context
,
style
.
get_color
(
state
))
y_bearing
=
context
.
text_extents
(
"0"
)[
1
]
millis
=
scale
<
1
def
split
(
x
):
# Seven elements: h : mm : ss . mmm
...
...
@@ -337,13 +338,18 @@ class ScaleRuler(Gtk.DrawingArea, Zoomable, Loggable):
while
paintpos
<
width
:
context
.
move_to
(
int
(
paintpos
),
1
-
y_bearing
)
current
=
split
(
time_to_string
(
long
(
current_time
)))
self
.
_drawTime
(
context
,
current
,
previous
)
self
.
_drawTime
(
context
,
current
,
previous
,
millis
)
previous
=
current
paintpos
+=
spacing
current_time
+=
interval
def
_drawTime
(
self
,
context
,
current
,
previous
):
def
_drawTime
(
self
,
context
,
current
,
previous
,
millis
):
hour
=
int
(
current
[
0
])
for
index
,
(
element
,
previous_element
)
in
enumerate
(
zip
(
current
,
previous
)):
if
index
<=
1
and
not
hour
:
continue
if
index
>=
5
and
not
millis
:
break
if
element
==
previous_element
:
color
=
self
.
_color_dimmed
else
:
...
...
pitivi/timeline/timeline.py
View file @
3f78e856
...
...
@@ -718,6 +718,7 @@ class Timeline(Gtk.Grid, Zoomable, Loggable):
self
.
_projectmanager
=
None
self
.
_project
=
None
self
.
pipeline
=
None
self
.
bTimeline
=
None
self
.
_createUi
()
self
.
_createActions
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment