Skip to content

Commit

Permalink
Mild reorganisation of tool bar layout
Browse files Browse the repository at this point in the history
  • Loading branch information
quicklizard99 committed May 20, 2016
1 parent 79f40a3 commit a09a135
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions inselect/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a09a135

Please sign in to comment.