From 9bb1a2d492fc03ae76e5343d6c5c8f4e8ce5ccea Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 23 Aug 2021 15:52:38 -0300 Subject: [PATCH] [view] improvement: not using native dialogs for file/directory choosing to prevent unexpected behaviors and wrong theming --- CHANGELOG.md | 2 ++ bauh/view/qt/components.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcb503ed..64f6f003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - hiding the app's launching output - Arch - AUR: **rebuild-detector** integration disabled by default since it has a great impact on the overall refresh time (it can be enabled through the settings panel -> "Check reinstallation need") +- UI + - not using native dialogs for file/directory choosing to prevent unexpected behaviors and wrong theming ### Fixes - AppImage diff --git a/bauh/view/qt/components.py b/bauh/view/qt/components.py index e389207e..b43abeae 100644 --- a/bauh/view/qt/components.py +++ b/bauh/view/qt/components.py @@ -870,9 +870,11 @@ class FormQt(QGroupBox): cur_path = str(Path.home()) if c.directory: - file_path = QFileDialog.getExistingDirectory(self, self.i18n['file_chooser.title'], cur_path, options=QFileDialog.Options()) + opts = QFileDialog.DontUseNativeDialog + opts |= QFileDialog.ShowDirsOnly + file_path = QFileDialog.getExistingDirectory(self, self.i18n['file_chooser.title'], cur_path, options=opts) else: - file_path, _ = QFileDialog.getOpenFileName(self, self.i18n['file_chooser.title'], cur_path, exts, options=QFileDialog.Options()) + file_path, _ = QFileDialog.getOpenFileName(self, self.i18n['file_chooser.title'], cur_path, exts, options=QFileDialog.DontUseNativeDialog) if file_path: c.set_file_path(file_path)