Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim
Commits: 36b147df by Stephen Paul Weber at 2017-04-09T20:32:08-05:00 Allow preferences window to shrink Previously, it would always be the size needed to fit the largest page from the notebook. This is death on small-screen devices like the pocketCHIP. Just adding a ScrolledWindow allows is to get smaller (at least vertically, which is the main issue). However, we want to still be a nice size on large screens. So, we ask each page in the notebook how tall it wishes to be, and default the window to the tallest one (plus the size of the extra controls). However, if the screen is shorter than this, we do not allow the default window size to exceed the screen size. Because of the large amount of re-indentation in the XML file, it is suggested to view this diff with `-b` - - - - - b5fabea5 by Philipp Hörist at 2017-04-10T16:42:48+02:00 Merge branch 'allow-smaller-preferences-window' into 'gajim_0.16' Allow preferences window to shrink See merge request !81 - - - - - 2 changed files: - data/gui/preferences_window.ui - src/config.py Changes: ===================================== data/gui/preferences_window.ui ===================================== The diff for this file was not included because it is too large. ===================================== src/config.py ===================================== --- a/src/config.py +++ b/src/config.py @@ -115,6 +115,19 @@ class PreferencesWindow: 'auto_xa_time_spinbutton') self.auto_xa_message_entry = self.xml.get_object('auto_xa_message_entry') + ### Default Window Size ### + tallest = 0 + for n in range(0, self.notebook.get_n_pages()): + page = self.notebook.get_nth_page(n) + content = page.get_children()[0].get_children()[0] + width, height = content.size_request() + if height > tallest: + tallest = height + + wwidth, wheight = self.window.get_size() + tallest += wheight + self.window.set_default_size(-1, min(gtk.gdk.screen_height(), tallest)) + ### General tab ### # Display avatars in roster st = gajim.config.get('show_avatars_in_roster') View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/755b9bed1bc6adc955d077de9c0d29671d521567...b5fabea53e87eeefd309e19e5babb7b9bff94031
_______________________________________________ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits