[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 88/101: grc: gtk3: fix multi-block move
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 88/101: grc: gtk3: fix multi-block move |
Date: |
Thu, 16 Mar 2017 14:58:13 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch python3
in repository gnuradio.
commit e1acf2d27760d606cc7cba200aa380e885f2ffaf
Author: Sebastian Koslowski <address@hidden>
Date: Thu Sep 22 21:09:34 2016 +0200
grc: gtk3: fix multi-block move
---
grc/gui/canvas/flowgraph.py | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/grc/gui/canvas/flowgraph.py b/grc/gui/canvas/flowgraph.py
index ba13588..8e72ca3 100644
--- a/grc/gui/canvas/flowgraph.py
+++ b/grc/gui/canvas/flowgraph.py
@@ -365,12 +365,12 @@ class FlowGraph(CoreFlowgraph, Drawable):
# align the blocks as requested
transform = {
- Actions.BLOCK_VALIGN_TOP: lambda x, y, w, h: (x, min_y),
- Actions.BLOCK_VALIGN_MIDDLE: lambda x, y, w, h: (x, ctr_y -
h/2),
- Actions.BLOCK_VALIGN_BOTTOM: lambda x, y, w, h: (x, max_y - h),
- Actions.BLOCK_HALIGN_LEFT: lambda x, y, w, h: (min_x, y),
- Actions.BLOCK_HALIGN_CENTER: lambda x, y, w, h: (ctr_x-w/2, y),
- Actions.BLOCK_HALIGN_RIGHT: lambda x, y, w, h: (max_x - w, y),
+ Actions.BLOCK_VALIGN_TOP: lambda x, y, w, h: (x, min_y),
+ Actions.BLOCK_VALIGN_MIDDLE: lambda x, y, w, h: (x, ctr_y - h/2),
+ Actions.BLOCK_VALIGN_BOTTOM: lambda x, y, w, h: (x, max_y - h),
+ Actions.BLOCK_HALIGN_LEFT: lambda x, y, w, h: (min_x, y),
+ Actions.BLOCK_HALIGN_CENTER: lambda x, y, w, h: (ctr_x-w/2, y),
+ Actions.BLOCK_HALIGN_RIGHT: lambda x, y, w, h: (max_x - w, y),
}.get(calling_action, lambda *args: args)
for selected_block in blocks:
@@ -523,7 +523,9 @@ class FlowGraph(CoreFlowgraph, Drawable):
new_selections = self.what_is_selected(self.coordinate)
# update the selections if the new selection is not in the current
selections
# allows us to move entire selected groups of elements
- if self.drawing_area.ctrl_mask or new_selections not in
self.selected_elements:
+ if not new_selections:
+ selected_elements = set()
+ elif self.drawing_area.ctrl_mask or
self.selected_elements.isdisjoint(new_selections):
selected_elements = new_selections
if self._old_selected_port:
@@ -666,7 +668,6 @@ class FlowGraph(CoreFlowgraph, Drawable):
self.press_coor = coordinate
self.coordinate = coordinate
self.mouse_pressed = True
-
if double_click:
self.unselect()
self.update_selected_elements()
@@ -729,6 +730,7 @@ class FlowGraph(CoreFlowgraph, Drawable):
# remove the connection if selected in drag event
if len(self.selected_elements) == 1 and
self.get_selected_element().is_connection:
Actions.ELEMENT_DELETE()
+ self.drawing_area.queue_draw()
# move the selected elements and record the new coordinate
x, y = coordinate
@@ -739,8 +741,7 @@ class FlowGraph(CoreFlowgraph, Drawable):
if not active or abs(dX) >= Constants.CANVAS_GRID_SIZE or abs(dY)
>= Constants.CANVAS_GRID_SIZE:
self.move_selected((dX, dY))
self.coordinate = (x, y)
- # queue draw for animation
- self.drawing_area.queue_draw()
+ self.drawing_area.queue_draw()
def get_max_coords(self, initial=(0, 0)):
return tuple(max(i, e) for i, e in zip(initial, self.extend[2:]))
- [Commit-gnuradio] [gnuradio] 77/101: grc: gtk3: make screnshots as png, pdf and svg, (continued)
- [Commit-gnuradio] [gnuradio] 77/101: grc: gtk3: make screnshots as png, pdf and svg, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 81/101: grc: refactor: make gr.prefs() optional (for testing), git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 99/101: grc: gtk3: update cmake requirements, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 92/101: grc: gtk3: fix block layout sizes when zooming, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 94/101: grc: gtk3: reimplemented custom bg colors for param entry boxes, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 98/101: cmake: add DIRECTORY support to GR_PYTHON_INSTALL and use it for grc, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 11/101: grc: py3k compat using python-modernize, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 75/101: grc: gtk3: rewrite file dialogs and support multiple extentions for screenshots, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 70/101: grc: gtk3: fancier coloring for disabled and bypassed blocks, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 83/101: grc: refactor: Cleaned up imports, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 88/101: grc: gtk3: fix multi-block move,
git <=
- [Commit-gnuradio] [gnuradio] 91/101: grc: gtk3: fix canvas extent after zooming, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 100/101: grc: gtk minor fixes, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 01/101: grc: Main window opens with pygobject and gtk3. Still throws tons of errors., git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 72/101: Merge remote-tracking branch 'upstream/next' into gtk3, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 71/101: grc: gtk3: fixup dialogs, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 78/101: Merge remote-tracking branch 'upstream/next' into gtk3, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 79/101: grc: refactor: move drawables in subpackage, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 95/101: grc: gtk3: curved connections, git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 82/101: grc: gtk3: Converted to Gtk.Application (ActionHandler) and Gtk.ApplicationWindow (MainWindow), git, 2017/03/16
- [Commit-gnuradio] [gnuradio] 96/101: grc: gtk3: invalid connection all red, git, 2017/03/16