Skip to content

Commit

Permalink
set widget weight must follow some rules to avoid wrong behavior see
Browse files Browse the repository at this point in the history
  • Loading branch information
anaselli committed Sep 30, 2022
1 parent 4af9560 commit f42fdf5
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions dnfdragora/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,10 @@ def _setupUI(self) :
self.bottom_layout = hbox_bottom
self.footbar_layout = hbox_footbar

#hbox_headbar.setWeight(1,10)
hbox_top.setWeight(1,5)
hbox_middle.setWeight(1,50)
hbox_bottom.setWeight(1,30)
hbox_footbar.setWeight(1,10)

# Tree for groups
self.tree = self.factory.createTree(hbox_middle, "")
self.tree.setWeight(0,10)
self.tree.setWeight(yui.YD_HORIZ,20)
self.tree.setNotify(True)

packageList_header = yui.YCBTableHeader()
Expand All @@ -456,7 +451,7 @@ def _setupUI(self) :
packageList_header.addColumn(_("Status"), not checkboxed)

self.packageList = self.mgaFactory.createCBTable(hbox_middle,packageList_header)
self.packageList.setWeight(0,50)
self.packageList.setWeight(yui.YD_HORIZ,80)
self.packageList.setImmediateMode(True)

self.filters = {
Expand Down Expand Up @@ -556,38 +551,34 @@ def _setupUI(self) :
self.search_list.setNotify(True)

self.find_entry = self.factory.createInputField(hbox_top, "")
self.find_entry.setWeight(yui.YD_HORIZ,1)

self.use_regexp = self.factory.createCheckBox(hbox_top, _("Use regexp"))
self.use_regexp.setNotify(True)

icon_file = self.images_path + "find.png"
self.find_button = self.factory.createIconButton(hbox_top, 'system-search', _("&Search"))
self.find_button.setWeight(0,6)
self.find_button.setDefaultButton(True)

icon_file = self.images_path + "clear_22x22.png"
self.reset_search_button = self.factory.createIconButton(hbox_top, icon_file, _("&Clear search"))
self.reset_search_button.setWeight(0,7)
self.find_entry.setWeight(0,10)

self.info = self.factory.createRichText(hbox_bottom,"")
self.info.setWeight(yui.YD_HORIZ,40)
self.info.setWeight(yui.YD_VERT, 40)

self.infobar = progress_ui.ProgressBar(self.dialog, self.pbar_layout)

self.applyButton = self.factory.createIconButton(hbox_footbar,"",_("&Apply"))
self.applyButton.setWeight(0,3)
self.applyButton.setWeight(yui.YD_HORIZ,1)
self.applyButton.setEnabled(False)

self.checkAllButton = self.factory.createIconButton(hbox_footbar,"",_("Sel&ect all"))
self.checkAllButton.setWeight(0,3)
self.checkAllButton.setWeight(yui.YD_HORIZ,1)
self.checkAllButton.setEnabled(False)
spacing = self.factory.createHStretch(hbox_footbar)

spacing = self.factory.createHStretch(right_footbar)
spacing.setWeight(0,3)
self.quitButton = self.factory.createIconButton(right_footbar,"",_("&Quit"))
self.quitButton.setWeight(0,3)
self.quitButton.setWeight(yui.YD_HORIZ,1)

### BEGIN Menus #########################
if (hasattr(self.factory, 'createMenuBar') and ismethod(getattr(self.factory, 'createMenuBar'))):
Expand Down

0 comments on commit f42fdf5

Please sign in to comment.