From e49da888b0dc993414bb0ddbd15d60fb4f364dde Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 6 Sep 2019 10:40:53 -0300 Subject: [PATCH 1/5] style and resizing fix --- README.md | 10 +++++++--- bauh/__init__.py | 2 +- bauh/app.py | 7 +++++++ bauh/view/qt/window.py | 11 ++++++++++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 65efaf02..58153899 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ ## bauh -Non-official graphical user interface for Flatpak / Snap application management (old **fpakman**). It is a tray icon that let the user known when new updates are available and -an application management panel where you can search, update, install and uninstall applications. +Graphical user interface to manage your Linux applications (packages) (old **fpakman**). It currently only supports Flatpak and Snaps packaging types. When you launch **bauh** you will see +a management panel where you can search, update, install and uninstall applications. You can also downgrade some apps depending on the package type. + +It has a **tray mode** (see **Settings** below) that attaches the application icon to the system tray providing a quick way to launch it. Also the icon will get red when updates are available. + ### Developed with: - Python3 and Qt5. @@ -20,7 +23,7 @@ an application management panel where you can search, update, install and uninst ### Distribution **PyPi** ``` -sudo pip3 install bauh +pip3 install bauh ``` **AUR** @@ -54,6 +57,7 @@ You can change some application settings via environment variables or arguments - **BAUH_CHECK_PACKAGING_ONCE**: If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Use **0** (disable, default) or **1** (enable). - **BAUH_TRAY**: If the tray icon and update-check daemon should be created. Use **0** (disable, default) or **1** (enable). - **BAUH_SUGGESTIONS**: If application suggestions should be displayed if no app is installed (runtimes do not count as apps). Use **0** (disable) or **1** (enable, default). +- **BAUH_THEME**: ### How to improve the application performance - If you don't care about a specific packaging technology and don't want the app to deal with it, just disable it via the specific argument or environment variable. For instance, if I don't care diff --git a/bauh/__init__.py b/bauh/__init__.py index cc332ec7..a8ad29c4 100644 --- a/bauh/__init__.py +++ b/bauh/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.5.1' +__version__ = '0.5.2' __app_name__ = 'bauh' import os diff --git a/bauh/app.py b/bauh/app.py index b0359e23..287ee18a 100755 --- a/bauh/app.py +++ b/bauh/app.py @@ -47,6 +47,7 @@ parser.add_argument('--snap', action="store", default=os.getenv('BAUH_SNAP', 1), parser.add_argument('-co', '--check-packaging-once', action="store", default=os.getenv('BAUH_CHECK_PACKAGING_ONCE', 0), choices=[0, 1], type=int, help='If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Default: %(default)s') parser.add_argument('--tray', action="store", default=os.getenv('BAUH_TRAY', 0), choices=[0, 1], type=int, help='If the tray icon and update-check daemon should be created. Default: %(default)s') parser.add_argument('--sugs', action="store", default=os.getenv('BAUH_SUGGESTIONS', 1), choices=[0, 1], type=int, help='If app suggestions should be displayed if no app is installed (runtimes do not count as apps). Default: %(default)s') +parser.add_argument('--theme', action="store", default=os.getenv('BAUH_THEME'), type=str, help='Define a custom QT theme (style) for the application. If not defined, it will be using breeze or fusion depending on your desktop environment') args = parser.parse_args() if args.cache_exp < 0: @@ -118,6 +119,12 @@ app.setApplicationName(__app_name__) app.setApplicationVersion(__version__) app.setWindowIcon(QIcon(resource.get_path('img/logo.svg'))) + +if args.theme: + app.setStyle(args.theme) +elif not app.style().objectName().lower() not in {'fusion', 'breeze'}: + app.setStyle('fusion') + screen_size = app.primaryScreen().size() manage_window = ManageWindow(locale_keys=locale_keys, diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index 1ce4d484..6c9c623a 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -517,11 +517,20 @@ class ManageWindow(QWidget): filters_layout.addWidget(checkbox_app_type) def resize_and_center(self, accept_lower_width: bool = True): - new_width = reduce(operator.add, [self.table_apps.columnWidth(i) for i in range(len(self.table_apps.column_names))]) * 1.05 + if self.apps: + new_width = reduce(operator.add, [self.table_apps.columnWidth(i) for i in range(self.table_apps.columnCount())]) + + if self.ref_bt_upgrade.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() + self.centralize() def update_selected(self): From 815b0ad484dbc42758e93e7a718702e0bc02903e Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 6 Sep 2019 10:54:03 -0300 Subject: [PATCH 2/5] fix --- README.md | 2 +- bauh/app.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 58153899..f22e05da 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ You can change some application settings via environment variables or arguments - **BAUH_CHECK_PACKAGING_ONCE**: If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Use **0** (disable, default) or **1** (enable). - **BAUH_TRAY**: If the tray icon and update-check daemon should be created. Use **0** (disable, default) or **1** (enable). - **BAUH_SUGGESTIONS**: If application suggestions should be displayed if no app is installed (runtimes do not count as apps). Use **0** (disable) or **1** (enable, default). -- **BAUH_THEME**: +- **BAUH_THEME**: Define a custom QT theme (style) for the application. If not defined, it will be using breeze or fusion depending on your desktop environment. ### How to improve the application performance - If you don't care about a specific packaging technology and don't want the app to deal with it, just disable it via the specific argument or environment variable. For instance, if I don't care diff --git a/bauh/app.py b/bauh/app.py index 287ee18a..905e6580 100755 --- a/bauh/app.py +++ b/bauh/app.py @@ -47,7 +47,7 @@ parser.add_argument('--snap', action="store", default=os.getenv('BAUH_SNAP', 1), parser.add_argument('-co', '--check-packaging-once', action="store", default=os.getenv('BAUH_CHECK_PACKAGING_ONCE', 0), choices=[0, 1], type=int, help='If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Default: %(default)s') parser.add_argument('--tray', action="store", default=os.getenv('BAUH_TRAY', 0), choices=[0, 1], type=int, help='If the tray icon and update-check daemon should be created. Default: %(default)s') parser.add_argument('--sugs', action="store", default=os.getenv('BAUH_SUGGESTIONS', 1), choices=[0, 1], type=int, help='If app suggestions should be displayed if no app is installed (runtimes do not count as apps). Default: %(default)s') -parser.add_argument('--theme', action="store", default=os.getenv('BAUH_THEME'), type=str, help='Define a custom QT theme (style) for the application. If not defined, it will be using breeze or fusion depending on your desktop environment') +parser.add_argument('--theme', action="store", default=os.getenv('BAUH_THEME'), type=str, help='Define a custom QT theme (style) for the application. If not defined, it will be using breeze or fusion depending on your desktop environment.') args = parser.parse_args() if args.cache_exp < 0: @@ -122,7 +122,7 @@ app.setWindowIcon(QIcon(resource.get_path('img/logo.svg'))) if args.theme: app.setStyle(args.theme) -elif not app.style().objectName().lower() not in {'fusion', 'breeze'}: +elif app.style().objectName().lower() not in {'fusion', 'breeze'}: app.setStyle('fusion') screen_size = app.primaryScreen().size() From 20545dc76ee507532c74cb5f6f15542570092738 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 6 Sep 2019 11:08:12 -0300 Subject: [PATCH 3/5] updating CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cb0efee..8dc97362 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.5.2] 2019-09- +### Features +- New environment variables / parameter to set a custom QT theme for the application: BAUH_THEME (--theme) +### Fixes +- wrong management panel resizing for some scenarios +- bad application theme when fusion or breeze are not set as default QT theme / style + ## [0.5.1] - 2019-08-12 ### Improvements: - suggestions are now retrieved asynchronously taking 45% less time. From 641d3a7601fff482c3b6d0acfb71341f66ec25b4 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 6 Sep 2019 11:26:45 -0300 Subject: [PATCH 4/5] Improving CHANGELOG and README --- CHANGELOG.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dc97362..3318c2c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.5.2] 2019-09- ### Features -- New environment variables / parameter to set a custom QT theme for the application: BAUH_THEME (--theme) +- New environment variable / parameter to set a custom QT theme for the application: BAUH_THEME (--theme) ### Fixes - wrong management panel resizing for some scenarios - bad application theme when fusion or breeze are not set as default QT theme / style diff --git a/README.md b/README.md index f22e05da..a8429b51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## bauh -Graphical user interface to manage your Linux applications (packages) (old **fpakman**). It currently only supports Flatpak and Snaps packaging types. When you launch **bauh** you will see +Graphical user interface to manage your Linux applications (packages) (old **fpakman**). It currently only supports Flatpak and Snap packaging types. When you launch **bauh** you will see a management panel where you can search, update, install and uninstall applications. You can also downgrade some apps depending on the package type. It has a **tray mode** (see **Settings** below) that attaches the application icon to the system tray providing a quick way to launch it. Also the icon will get red when updates are available. From 488c7a9aa468a41bab2a8a4a450ce3b5751113f3 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 6 Sep 2019 11:45:09 -0300 Subject: [PATCH 5/5] updating release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3318c2c1..4bf8e948 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [0.5.2] 2019-09- +## [0.5.2] 2019-09-06 ### Features - New environment variable / parameter to set a custom QT theme for the application: BAUH_THEME (--theme) ### Fixes