Skip to content

Commit

Permalink
Widgets: Small improvements to the About dialog
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
ccordoba12 committed Jul 10, 2023
1 parent 5f34860 commit 19fb3d5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions spyder/widgets/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand All @@ -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']:
Expand Down Expand Up @@ -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()
Expand All @@ -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())
Expand Down

0 comments on commit 19fb3d5

Please sign in to comment.