openshot.code team mailing list archive
-
openshot.code team
-
Mailing list archive
-
Message #00586
[Branch ~openshot.code/openshot/main] Rev 694: Improved the CTRL drag functionality to not show a blue line, and simply lock the motion of the c...
------------------------------------------------------------
revno: 694
fixes bug: https://launchpad.net/bugs/1047050
committer: Jonathan Thomas <Jonathan.Oomph@xxxxxxxxx>
branch nick: openshot
timestamp: Fri 2012-09-07 15:37:38 -0500
message:
Improved the CTRL drag functionality to not show a blue line, and simply lock the motion of the clip so it only moves vertically. It behaves more similar to an image editor (such as Inkscape or Gimp) with this change.
modified:
openshot/classes/clip.py
openshot/classes/save_project.py
openshot/classes/sequences.py
--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main
Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/clip.py'
--- openshot/classes/clip.py 2012-09-07 06:17:26 +0000
+++ openshot/classes/clip.py 2012-09-07 20:37:38 +0000
@@ -1592,15 +1592,8 @@
else:
# CTRL is pressed
- if abs(self.stored_x - (total_x_diff + item.get_bounds().x1)) > 15:
-
- # move clip
- item.translate (total_x_diff, total_y_diff)
-
- else:
-
- # move clip
- item.translate (0, total_y_diff)
+ # move clip vertically
+ item.translate (0, total_y_diff)
# RESIZE MODE
@@ -1814,23 +1807,6 @@
self.stored_x = item.get_bounds().x1
self.stored_y = item.get_bounds().y1
canvas.pointer_grab (item, gtk.gdk.POINTER_MOTION_MASK | gtk.gdk.BUTTON_RELEASE_MASK, fleur, event.time)
-
- if self.parent.parent.project.form._CTRL:
-
- # show the clip x position indicator when dragging clips
- theme = self.parent.parent.project.theme
-
- # Get theme settings
- theme_settings = self.parent.parent.project.theme_settings.settings
-
- imgTrack_Track = gtk.image_new_from_file("%s/openshot/themes/%s/Track_Middle.png" % (self.parent.parent.project.form.openshot_path, theme))
- imgTrack_Track_Height = imgTrack_Track.get_pixbuf().get_height()
- Size_Of_Line = len(self.parent.parent.tracks) * imgTrack_Track_Height + (len(self.parent.parent.tracks) * theme_settings["track"]["padding"]) + 2
-
- self.parent.parent.snap_line.props.visibility = goocanvas.ITEM_VISIBLE
- # the + 2 is to compensate for the initial -2 position to hide the line
- self.parent.parent.snap_line.props.x = self.stored_x + 2
- self.parent.parent.snap_line.props.height = Size_Of_Line + theme_settings["timeline"]["ruler"]["playhead_line"]["length_offset"]
# RAZOR MODE
@@ -1886,7 +1862,6 @@
self.parent.parent.raise_transitions()
self.parent.parent.play_head.raise_(None)
self.parent.parent.play_head_line.raise_(None)
- self.parent.parent.snap_line.raise_(None)
return False
@@ -2123,7 +2098,8 @@
drop_track.reorder_clips()
# determine the direction of the drag
- if isSnap:
+ if isSnap and not self.parent.parent.project.form._CTRL:
+ # snap (if enabled) and if CTRL is not pressed
distance_from_clip = self.get_snap_difference(self, item)
else:
distance_from_clip = 0.0
@@ -2147,9 +2123,6 @@
# Mark clip as modified
self.parent.parent.project.set_project_modified(is_modified=True, refresh_xml=True, type = type_of_event)
-
- # Hide CTLR snap line
- self.parent.parent.snap_line.props.visibility = goocanvas.ITEM_INVISIBLE
elif isResize:
=== modified file 'openshot/classes/save_project.py'
--- openshot/classes/save_project.py 2012-09-07 03:17:38 +0000
+++ openshot/classes/save_project.py 2012-09-07 20:37:38 +0000
@@ -75,7 +75,6 @@
old_play_head = project_object.sequences[0].play_head
old_ruler_time = project_object.sequences[0].ruler_time
old_play_head_line = project_object.sequences[0].play_head_line
- old_snap_line = project_object.sequences[0].snap_line
old_thumbnailer = project_object.thumbnailer
old_theme_settings = project_object.theme_settings
project_object.mlt_profile = None
@@ -83,7 +82,6 @@
project_object.sequences[0].play_head = None
project_object.sequences[0].ruler_time = None
project_object.sequences[0].play_head_line = None
- project_object.sequences[0].snap_line = None
project_object.form = None
project_object.theme_settings = None
project_object.thumbnailer = None
@@ -99,7 +97,6 @@
project_object.sequences[0].play_head = old_play_head
project_object.sequences[0].ruler_time = old_ruler_time
project_object.sequences[0].play_head_line = old_play_head_line
- project_object.sequences[0].snap_line = old_snap_line
project_object.theme_settings = old_theme_settings
project_object.thumbnailer = old_thumbnailer
=== modified file 'openshot/classes/sequences.py'
--- openshot/classes/sequences.py 2012-09-06 21:06:48 +0000
+++ openshot/classes/sequences.py 2012-09-07 20:37:38 +0000
@@ -58,7 +58,6 @@
self.ruler_time = None
self.play_head_line = None
self.enable_animated_playhead = True
- self.snap_line = None
def AddMarker(self, marker_name, position_on_track):
@@ -608,15 +607,6 @@
y = imgTrack_Ruler_Height - imgTrack_PlayHead_Height + y_top - 2)
GroupTrack3 = goocanvas.Group (parent = track_root_right)
- self.snap_line = GroupTrack3
- # add the snap indicator
- snap_indicator = goocanvas.Rect(parent=GroupTrack3,
- x=-2,
- y=0,
- width = 0.5,
- height = Size_Of_Line + theme_settings["timeline"]["ruler"]["playhead_line"]["length_offset"],
- line_width = theme_settings["timeline"]["ruler"]["playhead_line"]["line_width"],
- stroke_color_rgba = 0x000fffff)
# Connect signals to play head to allow drag and drop
GroupTrack.connect ("motion_notify_event", self.on_motion_notify_x)
@@ -913,9 +903,6 @@
# Check for missing DEBUG attribute (which means it's an old project format)
if 'enable_animated_playhead' not in state:
state['enable_animated_playhead'] = False
-
- if 'snap_line' not in state:
- state['snap_line'] = None
# update the state object with new schema changes
self.__dict__.update(state)