Skip to content

Commit

Permalink
Put content of editor to ScrollWindow if screen height is <900px. Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kozec committed May 21, 2015
1 parent c79f549 commit ce562ee
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion device-edit.glade
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<object class="GtkGrid" id="editor-content">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
Expand Down
2 changes: 1 addition & 1 deletion folder-edit.glade
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<object class="GtkGrid" id="editor-content">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">10</property>
Expand Down
10 changes: 10 additions & 0 deletions syncthing_gtk/editordialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ def __init__(self, app, gladefile, title):
# Used by get_widget_id
self.widget_to_id = {}
self.setup_widgets(gladefile, title)
# Move entire dialog content to ScrolledWindow if screen height
# is too small
if Gdk.Screen.get_default().height() < 900:
if not self["editor-content"] is None:
parent = self["editor-content"].get_parent()
parent.remove(self["editor-content"])
sw = Gtk.ScrolledWindow()
sw.add_with_viewport(self["editor-content"])
parent.pack_start(sw, True, True, 0)
self["editor"].resize(self["editor"].get_size()[0], Gdk.Screen.get_default().height() * 2 / 3)

def load(self):
""" Loads configuration data and pre-fills values to fields """
Expand Down

0 comments on commit ce562ee

Please sign in to comment.