From a09a135426cacd2a1ee0784756d5b8c9d0df20a9 Mon Sep 17 00:00:00 2001 From: Lawrence Hudson Date: Fri, 20 May 2016 11:56:13 +0100 Subject: [PATCH] Mild reorganisation of tool bar layout --- inselect/gui/main_window.py | 43 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/inselect/gui/main_window.py b/inselect/gui/main_window.py index 6419ff0..0ca659c 100644 --- a/inselect/gui/main_window.py +++ b/inselect/gui/main_window.py @@ -1251,18 +1251,33 @@ def button(action=None, icon=None, text=None, menu=None, tooltip=None): toolbar.addWidget(widget) toolbar.addSeparator() - # Segment Cookie cutter | - # Subsegment | - # Boxes | + # Zoom in Home | + # Zoom out Selection | + # Zoom | + block = QGridLayout() + block.addWidget(button(self.zoom_in_action), 0, 0) + block.addWidget(button(self.zoom_out_action), 1, 0) + block.addWidget(button(self.zoom_home_action), 0, 1) + block.addWidget(button(self.zoom_to_selection_action), 1, 1) + block.addWidget(QLabel('Zoom'), 2, 0, 1, 2, Qt.AlignHCenter) + block.setContentsMargins(0, 0, 0, 0) + block.setSpacing(0) + widget = QWidget() + widget.setLayout(block) + toolbar.addWidget(widget) + toolbar.addSeparator() + + # Segment Subsegment | + # Cookie cutter | + # Boxes | block = QGridLayout() block.addWidget(button(self.plugin_actions[0]), 0, 0) - block.addWidget(button(self.plugin_actions[1]), 1, 0) + block.addWidget(button(self.plugin_actions[1]), 0, 1) self.cookie_cutter_button = button( icon=load_icon(':/icons/cookie_cutter.png'), text='Cookie cutter', menu=self.cookie_cutter_widget.popup, tooltip='Cookie cutter' ) - self.cookie_cutter_button.setFixedWidth(150) - block.addWidget(self.cookie_cutter_button, 0, 1) + block.addWidget(self.cookie_cutter_button, 1, 0, 1, 2) block.addWidget(QLabel('Boxes'), 2, 0, 1, 2, Qt.AlignHCenter) block.setContentsMargins(0, 0, 0, 0) block.setSpacing(0) @@ -1299,22 +1314,6 @@ def button(action=None, icon=None, text=None, menu=None, tooltip=None): toolbar.addWidget(widget) toolbar.addSeparator() - # Zoom in Home | - # Zoom out Selection | - # Zoom | - block = QGridLayout() - block.addWidget(button(self.zoom_in_action), 0, 0) - block.addWidget(button(self.zoom_out_action), 1, 0) - block.addWidget(button(self.zoom_home_action), 0, 1) - block.addWidget(button(self.zoom_to_selection_action), 1, 1) - block.addWidget(QLabel('Zoom'), 2, 0, 1, 2, Qt.AlignHCenter) - block.setContentsMargins(0, 0, 0, 0) - block.setSpacing(0) - widget = QWidget() - widget.setLayout(block) - toolbar.addWidget(widget) - toolbar.addSeparator() - block = QGridLayout() block.addWidget(self.view_selector.slider, 0, 0, 2, 1) block.addWidget(QLabel('Select by size'), 2, 0, alignment=Qt.AlignHCenter)