From 19fb3d572c7b74c241be1cc9d2e38fa8971ae160 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sun, 9 Jul 2023 17:42:44 -0500 Subject: [PATCH] Widgets: Small improvements to the About dialog - Correctly align buttons to the right of the tab pages. - Make tabs font size match the one used for content. - Remove white area at the bottom of unselected tabs. --- spyder/widgets/about.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/spyder/widgets/about.py b/spyder/widgets/about.py index 0396602da8d..a8f5cec6b0b 100644 --- a/spyder/widgets/about.py +++ b/spyder/widgets/about.py @@ -10,6 +10,7 @@ import sys # Third party imports +import qstylizer.style from qtpy.QtCore import Qt from qtpy.QtGui import QPixmap from qtpy.QtWidgets import (QApplication, QDialog, QDialogButtonBox, @@ -28,7 +29,7 @@ from spyder.utils.icon_manager import ima from spyder.utils.image_path_manager import get_image_path from spyder.utils.palette import QStylePalette -from spyder.utils.stylesheet import APP_STYLESHEET, DialogStyle +from spyder.utils.stylesheet import DialogStyle class AboutDialog(QDialog): @@ -39,6 +40,7 @@ def __init__(self, parent): self.setWindowFlags( self.windowFlags() & ~Qt.WindowContextHelpButtonHint) versions = get_versions() + # Show Git revision for development version revlink = '' if versions['revision']: @@ -229,9 +231,10 @@ def __init__(self, parent): tabslayout.setContentsMargins(0, 15, 15, 0) btmhlayout = QHBoxLayout() + btmhlayout.addStretch(1) btmhlayout.addWidget(btn) btmhlayout.addWidget(bbox) - btmhlayout.setContentsMargins(100, 20, 0, 20) + btmhlayout.setContentsMargins(0, 20, 15, 20) btmhlayout.addStretch() vlayout = QVBoxLayout() @@ -251,11 +254,13 @@ def __init__(self, parent): self.resize(550, 430) # Style - css = APP_STYLESHEET.get_copy() - css = css.get_stylesheet() + css = qstylizer.style.StyleSheet() css.QDialog.setValues(backgroundColor=dialog_background_color) css.QLabel.setValues(backgroundColor=dialog_background_color) - self.setStyleSheet(str(css)) + css.QTabBar.setValues(fontSize=font_size) + css['QTabBar::tab!selected'].setValues( + borderBottomColor=dialog_background_color) + self.setStyleSheet(css.toString()) def copy_to_clipboard(self): QApplication.clipboard().setText(get_versions_text())