From ce562eefe343e19c0a040f040fbc8a52d7ab9524 Mon Sep 17 00:00:00 2001 From: kozec Date: Thu, 21 May 2015 13:03:44 +0200 Subject: [PATCH] Put content of editor to ScrollWindow if screen height is <900px. Fixes #105 --- device-edit.glade | 2 +- folder-edit.glade | 2 +- syncthing_gtk/editordialog.py | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/device-edit.glade b/device-edit.glade index f722816e..3328fed6 100644 --- a/device-edit.glade +++ b/device-edit.glade @@ -88,7 +88,7 @@ - + True False 10 diff --git a/folder-edit.glade b/folder-edit.glade index d137f361..0706142f 100644 --- a/folder-edit.glade +++ b/folder-edit.glade @@ -100,7 +100,7 @@ - + True False 10 diff --git a/syncthing_gtk/editordialog.py b/syncthing_gtk/editordialog.py index 1c962725..87ee7eb6 100644 --- a/syncthing_gtk/editordialog.py +++ b/syncthing_gtk/editordialog.py @@ -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 """