本文整理匯總了Python中pitivi.timeline.timeline.Timeline._button_release_event_cb方法的典型用法代碼示例。如果您正苦於以下問題:Python Timeline._button_release_event_cb方法的具體用法?Python Timeline._button_release_event_cb怎麽用?Python Timeline._button_release_event_cb使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pitivi.timeline.timeline.Timeline
的用法示例。
在下文中一共展示了Timeline._button_release_event_cb方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testLayerMoved
# 需要導入模塊: from pitivi.timeline.timeline import Timeline [as 別名]
# 或者: from pitivi.timeline.timeline.Timeline import _button_release_event_cb [as 別名]
def testLayerMoved(self):
layer1 = self.layer
layer2 = self.timeline.append_layer()
layer3 = self.timeline.append_layer()
self.assertEqual(self.timeline.get_layers(), [layer1, layer2, layer3])
timeline_ui = Timeline(app=self.app, size_group=mock.Mock())
timeline_ui.setProject(self.app.project_manager.current_project)
# Click and drag a layer control box to move the layer.
with mock.patch.object(Gtk, 'get_event_widget') as get_event_widget:
event = mock.Mock()
event.get_button.return_value = True, 1
get_event_widget.return_value = layer1.control_ui
timeline_ui._button_press_event_cb(None, event=event)
with mock.patch.object(layer1.control_ui, "translate_coordinates") as translate_coordinates:
translate_coordinates.return_value = (0, 0)
with mock.patch.object(timeline_ui, "_get_layer_at") as _get_layer_at:
_get_layer_at.return_value = layer3, None
timeline_ui._motion_notify_event_cb(None, event=event)
timeline_ui._button_release_event_cb(None, event=event)
self.check_layers([layer2, layer3, layer1])
self.action_log.undo()
self.check_layers([layer1, layer2, layer3])
self.action_log.redo()
self.check_layers([layer2, layer3, layer1])