mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 16:44:16 +02:00
[improvement][ui] widgets visibility settings
This commit is contained in:
@@ -11,6 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- Web:
|
- Web:
|
||||||
- not using HTTP sessions anymore to perform the searches. It seems to avoid URLs not being found after an internet drop event.
|
- 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
|
- 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
|
### Fixes
|
||||||
- missing categories i18n [48](https://github.com/vinifmor/bauh/issues/48)
|
- 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
|
### UI
|
||||||
- Default **Type** icon removed from the Type filter to make the design more consistent with the Category filter.
|
- 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
|
## [0.8.0] 2019-12-24
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -456,3 +456,9 @@ class AppsTable(QTableWidget):
|
|||||||
header_horizontal = self.horizontalHeader()
|
header_horizontal = self.horizontalHeader()
|
||||||
for i in range(self.columnCount()):
|
for i in range(self.columnCount()):
|
||||||
header_horizontal.setSectionResizeMode(i, policy)
|
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
|
||||||
@@ -6,9 +6,10 @@ from pathlib import Path
|
|||||||
from typing import List, Type, Set
|
from typing import List, Type, Set
|
||||||
|
|
||||||
from PyQt5.QtCore import QEvent, Qt, QSize, pyqtSignal
|
from PyQt5.QtCore import QEvent, Qt, QSize, pyqtSignal
|
||||||
from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QPixmap, QCursor
|
from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QCursor
|
||||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QCheckBox, QHeaderView, QToolBar, \
|
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QCheckBox, QHeaderView, QToolBar, \
|
||||||
QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QPushButton, QComboBox, QMenu, QAction, QApplication, QListView
|
QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QPushButton, QComboBox, QMenu, QAction, QApplication, QListView, \
|
||||||
|
QSizePolicy, QMainWindow
|
||||||
|
|
||||||
from bauh.api.abstract.cache import MemoryCache
|
from bauh.api.abstract.cache import MemoryCache
|
||||||
from bauh.api.abstract.context import ApplicationContext
|
from bauh.api.abstract.context import ApplicationContext
|
||||||
@@ -33,7 +34,7 @@ from bauh.view.qt.thread import UpdateSelectedApps, RefreshApps, UninstallApp, D
|
|||||||
GetAppHistory, SearchPackages, InstallPackage, AnimateProgress, VerifyModels, FindSuggestions, ListWarnings, \
|
GetAppHistory, SearchPackages, InstallPackage, AnimateProgress, VerifyModels, FindSuggestions, ListWarnings, \
|
||||||
AsyncAction, LaunchApp, ApplyFilters, CustomAction, GetScreenshots
|
AsyncAction, LaunchApp, ApplyFilters, CustomAction, GetScreenshots
|
||||||
from bauh.view.qt.view_model import PackageView
|
from bauh.view.qt.view_model import PackageView
|
||||||
from bauh.view.qt.view_utils import load_icon, load_resource_icon
|
from bauh.view.qt.view_utils import load_icon
|
||||||
from bauh.view.util import util, resource
|
from bauh.view.util import util, resource
|
||||||
from bauh.view.util.translation import I18n
|
from bauh.view.util.translation import I18n
|
||||||
|
|
||||||
@@ -135,6 +136,7 @@ class ManageWindow(QWidget):
|
|||||||
self.layout.addWidget(self.toolbar_top)
|
self.layout.addWidget(self.toolbar_top)
|
||||||
|
|
||||||
self.toolbar = QToolBar()
|
self.toolbar = QToolBar()
|
||||||
|
self.toolbar.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
|
||||||
self.toolbar.setStyleSheet('QToolBar {spacing: 4px; margin-top: 15px; margin-bottom: 5px}')
|
self.toolbar.setStyleSheet('QToolBar {spacing: 4px; margin-top: 15px; margin-bottom: 5px}')
|
||||||
|
|
||||||
self.checkbox_updates = QCheckBox()
|
self.checkbox_updates = QCheckBox()
|
||||||
@@ -829,20 +831,15 @@ class ManageWindow(QWidget):
|
|||||||
self.ref_combo_categories.setVisible(False)
|
self.ref_combo_categories.setVisible(False)
|
||||||
|
|
||||||
def resize_and_center(self, accept_lower_width: bool = True):
|
def resize_and_center(self, accept_lower_width: bool = True):
|
||||||
if self.pkgs:
|
table_width = self.table_apps.get_width()
|
||||||
new_width = reduce(operator.add, [self.table_apps.columnWidth(i) for i in range(self.table_apps.columnCount())])
|
toolbar_width = self.toolbar.sizeHint().width()
|
||||||
|
topbar_width = self.toolbar_top.sizeHint().width()
|
||||||
|
|
||||||
if self.ref_bt_upgrade.isVisible() or self.ref_bt_settings.isVisible():
|
new_width = max(table_width, toolbar_width, topbar_width)
|
||||||
new_width *= 1.07
|
|
||||||
else:
|
|
||||||
new_width = self.toolbar_top.width()
|
|
||||||
|
|
||||||
if accept_lower_width or new_width > self.width():
|
if accept_lower_width or new_width > self.width():
|
||||||
self.resize(new_width, self.height())
|
self.resize(new_width, self.height())
|
||||||
|
|
||||||
if self.ref_bt_upgrade.isVisible() and self.bt_upgrade.visibleRegion().isEmpty():
|
|
||||||
self.adjustSize()
|
|
||||||
|
|
||||||
if self.first_refresh:
|
if self.first_refresh:
|
||||||
qt_utils.centralize(self)
|
qt_utils.centralize(self)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user