Merge branch 'staging' into fpakpart

# Conflicts:
#	bauh/view/qt/window.py
This commit is contained in:
Vinícius Moreira
2020-01-10 11:48:19 -03:00
3 changed files with 18 additions and 15 deletions

View File

@@ -11,6 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Web:
- not using HTTP sessions anymore to perform the searches. It seems to avoid URLs not being found after an internet drop event.
- supporting JPEG images as custom icons
- UI:
- widgets visibility settings ( the main widgets now should always be visible ( e.g: toolbar buttons )
- only centralizing the panel for the first refresh
### Fixes
- missing categories i18n [48](https://github.com/vinifmor/bauh/issues/48)
@@ -21,7 +24,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### UI
- Default **Type** icon removed from the Type filter to make the design more consistent with the Category filter.
- Only centralizing the panel for the first refresh
## [0.8.0] 2019-12-24
### Features

View File

@@ -456,3 +456,9 @@ class AppsTable(QTableWidget):
header_horizontal = self.horizontalHeader()
for i in range(self.columnCount()):
header_horizontal.setSectionResizeMode(i, policy)
def get_width(self):
w = self.verticalHeader().width() + 4 # +4 seems to be needed
for i in range(self.columnCount()):
w += self.columnWidth(i) # seems to include gridline (on my machine)
return w

View File

@@ -136,6 +136,7 @@ class ManageWindow(QWidget):
self.layout.addWidget(self.toolbar_top)
self.toolbar = QToolBar()
self.toolbar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
self.toolbar.setStyleSheet('QToolBar {spacing: 4px; margin-top: 15px; margin-bottom: 5px}')
self.checkbox_updates = QCheckBox()
@@ -830,20 +831,14 @@ class ManageWindow(QWidget):
self.ref_combo_categories.setVisible(False)
def resize_and_center(self, accept_lower_width: bool = True):
self.setMinimumWidth(self.layout.sizeHint().width())
# if self.pkgs:
# new_width = reduce(operator.add, [self.table_apps.columnWidth(i) for i in range(self.table_apps.columnCount())])
#
# if self.ref_bt_upgrade.isVisible() or self.ref_bt_settings.isVisible():
# new_width *= 1.07
# else:
# new_width = self.toolbar_top.width()
#
# if accept_lower_width or new_width > self.width():
# self.resize(new_width, self.height())
#
# if self.ref_bt_upgrade.isVisible() and self.bt_upgrade.visibleRegion().isEmpty():
# self.adjustSize()
table_width = self.table_apps.get_width()
toolbar_width = self.toolbar.sizeHint().width()
topbar_width = self.toolbar_top.sizeHint().width()
new_width = max(table_width, toolbar_width, topbar_width)
if accept_lower_width or new_width > self.width():
self.resize(new_width, self.height())
if self.first_refresh:
qt_utils.centralize(self)