Fix startup error (undefined variable) on non-composited displays.

Fix titlebar label preventing scaling down titlebars by wrapping whole box in a viewport.
Add vertical scrollbars to the Profiles and Layouts tabs in Preferences.
This commit is contained in:
Stephen Boddy 2015-02-23 21:59:08 +01:00
commit 5bdbc1ce20
4 changed files with 51 additions and 38 deletions

View File

@ -43,7 +43,7 @@ class EditableLabel(Gtk.EventBox):
GObject.GObject.__init__(self) GObject.GObject.__init__(self)
self._entry_handler_id = [] self._entry_handler_id = []
self._label = Gtk.Label(label=text) self._label = Gtk.Label(label=text, ellipsize='end')
self._custom = False self._custom = False
self.set_visible_window (False) self.set_visible_window (False)
self.add (self._label) self.add (self._label)

View File

@ -1209,26 +1209,32 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkTreeView" id="profilelist"> <object class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="hscrollbar_policy">never</property>
<property name="hadjustment">adjustment2</property>
<property name="vadjustment">adjustment3</property>
<property name="model">ProfilesListStore</property>
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<child> <child>
<object class="GtkTreeViewColumn" id="profilecolumn"> <object class="GtkTreeView" id="profilelist">
<property name="title">Profile</property> <property name="visible">True</property>
<property name="clickable">True</property> <property name="can_focus">True</property>
<property name="hadjustment">adjustment2</property>
<property name="vadjustment">adjustment3</property>
<property name="model">ProfilesListStore</property>
<property name="headers_clickable">False</property>
<property name="search_column">0</property>
<child> <child>
<object class="GtkCellRendererText" id="cellrenderertext3"> <object class="GtkTreeViewColumn" id="profilecolumn">
<signal name="edited" handler="on_profile_name_edited" swapped="no"/> <property name="title">Profile</property>
<property name="clickable">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext3">
<signal name="edited" handler="on_profile_name_edited" swapped="no"/>
</object>
<attributes>
<attribute name="editable">1</attribute>
<attribute name="text">0</attribute>
</attributes>
</child>
</object> </object>
<attributes>
<attribute name="editable">1</attribute>
<attribute name="text">0</attribute>
</attributes>
</child> </child>
</object> </object>
</child> </child>
@ -3144,25 +3150,31 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkTreeView" id="layoutlist"> <object class="GtkScrolledWindow" id="scrolledwindow4">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="hscrollbar_policy">never</property>
<property name="hadjustment">adjustment5</property>
<property name="vadjustment">adjustment6</property>
<property name="model">LayoutListStore</property>
<property name="search_column">0</property>
<child> <child>
<object class="GtkTreeViewColumn" id="layoutcolumn"> <object class="GtkTreeView" id="layoutlist">
<property name="title">Layout</property> <property name="visible">True</property>
<property name="clickable">True</property> <property name="can_focus">True</property>
<property name="hadjustment">adjustment5</property>
<property name="vadjustment">adjustment6</property>
<property name="model">LayoutListStore</property>
<property name="search_column">0</property>
<child> <child>
<object class="GtkCellRendererText" id="cellrenderertext12"> <object class="GtkTreeViewColumn" id="layoutcolumn">
<signal name="edited" handler="on_layout_name_edited" swapped="no"/> <property name="title">Layout</property>
<property name="clickable">True</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext12">
<signal name="edited" handler="on_layout_name_edited" swapped="no"/>
</object>
<attributes>
<attribute name="editable">1</attribute>
<attribute name="text">0</attribute>
</attributes>
</child>
</object> </object>
<attributes>
<attribute name="editable">1</attribute>
<attribute name="text">0</attribute>
</attributes>
</child> </child>
</object> </object>
</child> </child>

View File

@ -50,7 +50,7 @@ class Titlebar(Gtk.EventBox):
self.label.connect('edit-done', self.on_edit_done) self.label.connect('edit-done', self.on_edit_done)
self.ebox = Gtk.EventBox() self.ebox = Gtk.EventBox()
grouphbox = Gtk.HBox() grouphbox = Gtk.HBox()
self.grouplabel = Gtk.Label() self.grouplabel = Gtk.Label(ellipsize='end')
self.groupicon = Gtk.Image() self.groupicon = Gtk.Image()
self.bellicon = Gtk.Image() self.bellicon = Gtk.Image()
self.bellicon.set_no_show_all(True) self.bellicon.set_no_show_all(True)
@ -85,8 +85,10 @@ class Titlebar(Gtk.EventBox):
hbox.pack_start(self.label, True, True, 0) hbox.pack_start(self.label, True, True, 0)
hbox.pack_end(self.bellicon, False, False, 2) hbox.pack_end(self.bellicon, False, False, 2)
self.add(hbox) viewport = Gtk.Viewport(hscroll_policy='natural')
hbox.show_all() viewport.add(hbox)
self.add (viewport)
viewport.show_all()
self.set_no_show_all(True) self.set_no_show_all(True)
self.show() self.show()

View File

@ -378,9 +378,8 @@ class Window(Container, Gtk.Window):
if value: if value:
dbg('setting rgba visual') dbg('setting rgba visual')
visual = screen.get_rgba_visual() visual = screen.get_rgba_visual()
if visual:
if visual: self.set_visual(visual)
self.set_visual(visual)
def show(self, startup=False): def show(self, startup=False):
"""Undo the startup show request if started in hidden mode""" """Undo the startup show request if started in hidden mode"""