Skip to content

Commit

Permalink
whatever
Browse files Browse the repository at this point in the history
  • Loading branch information
maoschanz committed Oct 6, 2019
1 parent 3963a94 commit ec7800b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(
'drawing',
version: '0.4.5',
version: '0.4.6',
meson_version: '>= 0.45.0',
)

Expand Down
2 changes: 1 addition & 1 deletion src/ui/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<object class="GtkBox" id="tools_nonscrollable_box">
<property name="visible">True</property>
<child>
<object class="GtkFlowBox" id="tools_panel">
<object class="GtkFlowBox" id="tools_flowbox">
<property name="visible">True</property>
<property name="selection-mode">none</property>
<property name="orientation">vertical</property>
Expand Down
18 changes: 9 additions & 9 deletions src/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DrawingWindow(Gtk.ApplicationWindow):
_settings = Gio.Settings.new('com.github.maoschanz.drawing')

# Window empty widgets
tools_panel = GtkTemplate.Child()
tools_flowbox = GtkTemplate.Child()
toolbar_box = GtkTemplate.Child()
info_bar = GtkTemplate.Child()
info_label = GtkTemplate.Child()
Expand Down Expand Up @@ -619,7 +619,7 @@ def build_tool_rows(self):
group = self.tools[tool_id].row
else:
self.tools[tool_id].row.join_group(group)
self.tools_panel.add(self.tools[tool_id].row)
self.tools_flowbox.add(self.tools[tool_id].row)
self.on_show_labels_setting_changed()

def set_tools_labels_visibility(self, visible):
Expand All @@ -630,15 +630,15 @@ def set_tools_labels_visibility(self, visible):
self.tools[tool_id].label_widget.set_visible(visible)
nb_tools = len(self.tools)
if visible:
self.tools_panel.set_min_children_per_line(nb_tools)
self.tools_nonscrollable_box.remove(self.tools_panel)
self.tools_scrollable_box.add(self.tools_panel)
self.tools_flowbox.set_min_children_per_line(nb_tools)
self.tools_nonscrollable_box.remove(self.tools_flowbox)
self.tools_scrollable_box.add(self.tools_flowbox)
else:
self.tools_scrollable_box.remove(self.tools_panel)
self.tools_nonscrollable_box.add(self.tools_panel)
self.tools_scrollable_box.remove(self.tools_flowbox)
self.tools_nonscrollable_box.add(self.tools_flowbox)
nb_min = int( (nb_tools+(nb_tools % 3))/3 ) - 1
self.tools_panel.set_min_children_per_line(nb_min)
self.tools_panel.set_max_children_per_line(nb_tools)
self.tools_flowbox.set_min_children_per_line(nb_min)
self.tools_flowbox.set_max_children_per_line(nb_tools)

def on_show_labels_setting_changed(self, *args):
# TODO https://lazka.github.io/pgi-docs/Gio-2.0/classes/Settings.html#Gio.Settings.create_action
Expand Down

0 comments on commit ec7800b

Please sign in to comment.