[Rigo] fixup TreeView initialization that could lead to race condition in calculating widget size
This commit is contained in:
@@ -76,10 +76,6 @@ class ConfigUpdatesTreeView(GenericTreeView):
|
||||
tr.set_pixbuf_width(icon_size)
|
||||
tr.set_button_spacing(em(0.3))
|
||||
|
||||
GenericTreeView.__init__(self,
|
||||
self._row_activated_callback,
|
||||
self._button_activated_callback, tr)
|
||||
|
||||
# create buttons and set initial strings
|
||||
edit_source = CellButtonRenderer(
|
||||
self, name=ConfigUpdateCellButtonIDs.EDIT)
|
||||
@@ -105,6 +101,10 @@ class ConfigUpdatesTreeView(GenericTreeView):
|
||||
{self.VARIANT_DISCARD: _("Discard")})
|
||||
tr.button_pack_end(discard)
|
||||
|
||||
GenericTreeView.__init__(self,
|
||||
self._row_activated_callback,
|
||||
self._button_activated_callback, tr)
|
||||
|
||||
column = Gtk.TreeViewColumn("ConfigUpdates", tr,
|
||||
confupdate=self.COL_ROW_DATA)
|
||||
|
||||
|
||||
@@ -49,6 +49,12 @@ class NoticeBoardTreeView(GenericTreeView):
|
||||
self.create_pango_layout(""))
|
||||
tr.set_pixbuf_width(icon_size)
|
||||
|
||||
show_notice = CellButtonRenderer(
|
||||
self, name=NoticeCellButtonIDs.SHOW)
|
||||
show_notice.set_markup_variants(
|
||||
{self.VARIANT_SHOW: _("Show"),})
|
||||
tr.button_pack_end(show_notice)
|
||||
|
||||
GenericTreeView.__init__(
|
||||
self, self._row_activated_callback,
|
||||
self._button_activated_callback, tr)
|
||||
@@ -56,12 +62,6 @@ class NoticeBoardTreeView(GenericTreeView):
|
||||
column = Gtk.TreeViewColumn("Notices", tr,
|
||||
notice=self.COL_ROW_DATA)
|
||||
|
||||
show_notice = CellButtonRenderer(
|
||||
self, name=NoticeCellButtonIDs.SHOW)
|
||||
show_notice.set_markup_variants(
|
||||
{self.VARIANT_SHOW: _("Show"),})
|
||||
tr.button_pack_end(show_notice)
|
||||
|
||||
column.set_cell_data_func(tr, self._cell_data_func_cb)
|
||||
column.set_fixed_width(350)
|
||||
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
||||
|
||||
@@ -56,13 +56,6 @@ class RepositoryTreeView(GenericTreeView):
|
||||
self.create_pango_layout(""))
|
||||
tr.set_pixbuf_width(icon_size)
|
||||
|
||||
GenericTreeView.__init__(
|
||||
self, None,
|
||||
self._button_activated_callback, tr)
|
||||
|
||||
column = Gtk.TreeViewColumn("Repositories", tr,
|
||||
repository=self.COL_ROW_DATA)
|
||||
|
||||
toggle_repo = CellButtonRenderer(
|
||||
self, name=RepositoryCellButtonIDs.TOGGLE)
|
||||
toggle_repo.set_markup_variants(
|
||||
@@ -76,6 +69,13 @@ class RepositoryTreeView(GenericTreeView):
|
||||
{self.VARIANT_RENAME: _("Rename")})
|
||||
tr.button_pack_start(rename_repo)
|
||||
|
||||
column = Gtk.TreeViewColumn("Repositories", tr,
|
||||
repository=self.COL_ROW_DATA)
|
||||
|
||||
GenericTreeView.__init__(
|
||||
self, None,
|
||||
self._button_activated_callback, tr)
|
||||
|
||||
column.set_cell_data_func(tr, self._cell_data_func_cb)
|
||||
column.set_fixed_width(350)
|
||||
column.set_sizing(Gtk.TreeViewColumnSizing.FIXED)
|
||||
|
||||
Reference in New Issue
Block a user