mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[view] improvement: the app publisher displayed on the management window will be cut based on a percentage over the primary screen width (12%)
This commit is contained in:
@@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- updates: only displaying both the installed and latest versions on the "version" column if its width is no more than 22% of the primary screen width (otherwise just the latest version will be displayed)
|
- updates: only displaying both the installed and latest versions on the "version" column if its width is no more than 22% of the primary screen width (otherwise just the latest version will be displayed)
|
||||||
- the app name displayed on the management window will be cut based on a percentage over the primary screen width (15%)
|
- the app name displayed on the management window will be cut based on a percentage over the primary screen width (15%)
|
||||||
- the app description displayed on the management window will be cut based on a percentage over the primary screen width (18%)
|
- the app description displayed on the management window will be cut based on a percentage over the primary screen width (18%)
|
||||||
|
- the app publisher displayed on the management window will be cut based on a percentage over the primary screen width (12%)
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
- Flatpak
|
- Flatpak
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ from bauh.view.qt.dialog import ConfirmationDialog
|
|||||||
from bauh.view.qt.view_model import PackageView
|
from bauh.view.qt.view_model import PackageView
|
||||||
from bauh.view.util.translation import I18n
|
from bauh.view.util.translation import I18n
|
||||||
|
|
||||||
PUBLISHER_MAX_SIZE = 25
|
|
||||||
|
|
||||||
|
|
||||||
class UpgradeToggleButton(QToolButton):
|
class UpgradeToggleButton(QToolButton):
|
||||||
|
|
||||||
@@ -487,15 +485,21 @@ class PackagesTable(QTableWidget):
|
|||||||
publisher = pkg.model.get_publisher()
|
publisher = pkg.model.get_publisher()
|
||||||
full_publisher = None
|
full_publisher = None
|
||||||
|
|
||||||
|
lb_name = QLabel()
|
||||||
|
lb_name.setObjectName('app_publisher')
|
||||||
|
|
||||||
if publisher:
|
if publisher:
|
||||||
publisher = publisher.strip()
|
publisher = publisher.strip()
|
||||||
full_publisher = publisher
|
full_publisher = publisher
|
||||||
|
|
||||||
if len(publisher) > PUBLISHER_MAX_SIZE:
|
if publisher:
|
||||||
publisher = full_publisher[0: PUBLISHER_MAX_SIZE - 3] + '...'
|
lb_name.setText(publisher)
|
||||||
|
screen_perc = lb_name.sizeHint().width() / self.screen_width
|
||||||
|
|
||||||
lb_name = QLabel()
|
if screen_perc > 0.12:
|
||||||
lb_name.setObjectName('app_publisher')
|
max_chars = int(len(publisher) * 0.12 / screen_perc) - 3
|
||||||
|
publisher = publisher[0: max_chars] + '...'
|
||||||
|
lb_name.setText(publisher)
|
||||||
|
|
||||||
if not publisher:
|
if not publisher:
|
||||||
if not pkg.model.installed:
|
if not pkg.model.installed:
|
||||||
@@ -503,7 +507,7 @@ class PackagesTable(QTableWidget):
|
|||||||
|
|
||||||
publisher = self.i18n['unknown']
|
publisher = self.i18n['unknown']
|
||||||
|
|
||||||
lb_name.setText(' {}'.format(publisher))
|
lb_name.setText(f' {publisher}')
|
||||||
item.addWidget(lb_name)
|
item.addWidget(lb_name)
|
||||||
|
|
||||||
if publisher and full_publisher:
|
if publisher and full_publisher:
|
||||||
|
|||||||
Reference in New Issue
Block a user