diff --git a/booru_viewer/gui/app.py b/booru_viewer/gui/app.py index 1a5643f..64e7a16 100644 --- a/booru_viewer/gui/app.py +++ b/booru_viewer/gui/app.py @@ -403,26 +403,22 @@ class BooruApp(QMainWindow): self._rating_combo.currentTextChanged.connect(self._on_rating_changed) top.addWidget(self._rating_combo) - # Score filter + # Score filter — type the value directly. Spinbox arrows hidden + # since the field is small enough to type into and the +/- buttons + # were just visual noise. setFixedHeight(23) overrides Qt's + # QSpinBox sizeHint which still reserves vertical space for the + # arrow buttons internally even when `setButtonSymbols(NoButtons)` + # is set, leaving the spinbox 3px taller than the surrounding + # combos/inputs/buttons in the top toolbar (26 vs 23). score_label = QLabel("Score≥") top.addWidget(score_label) self._score_spin = QSpinBox() self._score_spin.setRange(0, 99999) self._score_spin.setValue(0) self._score_spin.setFixedWidth(50) + self._score_spin.setFixedHeight(23) self._score_spin.setButtonSymbols(QSpinBox.ButtonSymbols.NoButtons) top.addWidget(self._score_spin) - _btn_style = "padding: 4px 6px;" - score_down = QPushButton("-") - score_down.setFixedWidth(25) - score_down.setStyleSheet(_btn_style) - score_down.clicked.connect(lambda: self._score_spin.setValue(max(0, self._score_spin.value() - 1))) - top.addWidget(score_down) - score_up = QPushButton("+") - score_up.setFixedWidth(25) - score_up.setStyleSheet(_btn_style) - score_up.clicked.connect(lambda: self._score_spin.setValue(self._score_spin.value() + 1)) - top.addWidget(score_up) self._media_filter = QComboBox() self._media_filter.addItems(["All", "Animated", "Video", "GIF", "Audio"]) @@ -436,6 +432,7 @@ class BooruApp(QMainWindow): self._page_spin.setRange(1, 99999) self._page_spin.setValue(1) self._page_spin.setFixedWidth(50) + self._page_spin.setFixedHeight(23) # match the surrounding 23px row self._page_spin.setButtonSymbols(QSpinBox.ButtonSymbols.NoButtons) top.addWidget(self._page_spin) diff --git a/booru_viewer/gui/bookmarks.py b/booru_viewer/gui/bookmarks.py index dc6c671..8243b74 100644 --- a/booru_viewer/gui/bookmarks.py +++ b/booru_viewer/gui/bookmarks.py @@ -58,14 +58,13 @@ class BookmarksView(QWidget): top = QHBoxLayout() top.setContentsMargins(0, 0, 4, 0) - # Compact button padding matches the rest of the app's narrow - # toolbar buttons (search bar score field, settings spinbox +/-, - # preview toolbar). The bundled themes' default `padding: 5px 12px` - # is too wide for short labels in fixed-width slots. - # min-height 22px gives a total height of 30px (22 + 3+3 padding + - # 1+1 border), matching the inputs/combos in the same row so the - # whole toolbar lines up at one consistent height. - _btn_style = "padding: 3px 6px; min-height: 22px;" + # Compact horizontal padding matches the rest of the app's narrow + # toolbar buttons. Vertical padding (2px) and min-height (inherited + # from the global QPushButton rule = 16px) give a total height of + # 22px, lining up with the bundled themes' inputs/combos so the + # whole toolbar row sits at one consistent height — and matches + # what native Qt+Fusion produces with no QSS at all. + _btn_style = "padding: 2px 6px;" self._folder_combo = QComboBox() self._folder_combo.setMinimumWidth(120) diff --git a/booru_viewer/gui/library.py b/booru_viewer/gui/library.py index 43bf07c..c3f788e 100644 --- a/booru_viewer/gui/library.py +++ b/booru_viewer/gui/library.py @@ -63,13 +63,11 @@ class LibraryView(QWidget): top = QHBoxLayout() top.setContentsMargins(0, 0, 4, 0) - # Compact button padding matches the rest of the app's narrow - # toolbar buttons. Bundled themes' default `padding: 5px 12px` - # is too wide for short labels in fixed-width slots. - # min-height 22px gives a total height of 30px (22 + 3+3 padding + - # 1+1 border), matching the inputs/combos in the same row so the - # whole toolbar lines up at one consistent height. - _btn_style = "padding: 3px 6px; min-height: 22px;" + # Compact horizontal padding matches the rest of the app's narrow + # toolbar buttons. Vertical padding (2px) + global min-height + # (16px) gives a 22px total height — lines up with the inputs/ + # combos in the same row. + _btn_style = "padding: 2px 6px;" self._folder_combo = QComboBox() self._folder_combo.setMinimumWidth(140) diff --git a/booru_viewer/gui/preview.py b/booru_viewer/gui/preview.py index 9ec40fc..f08146c 100644 --- a/booru_viewer/gui/preview.py +++ b/booru_viewer/gui/preview.py @@ -83,7 +83,7 @@ class FullscreenPreview(QMainWindow): # Same compact-padding override as the embedded preview toolbar — # bundled themes' default `padding: 5px 12px` is too wide for these # short labels in narrow fixed slots. - _tb_btn_style = "padding: 3px 6px;" + _tb_btn_style = "padding: 2px 6px;" self._bookmark_btn = QPushButton("Bookmark") self._bookmark_btn.setMaximumWidth(90) @@ -961,7 +961,7 @@ class VideoPlayer(QWidget): # bottom controls bar reads as part of the same panel rather than # as a stamped-in overlay. Bundled themes' default `padding: 5px 12px` # is too wide for short labels in narrow button slots. - _ctrl_btn_style = "padding: 3px 6px;" + _ctrl_btn_style = "padding: 2px 6px;" self._play_btn = QPushButton("Play") self._play_btn.setMaximumWidth(65) @@ -1321,7 +1321,7 @@ class ImagePreview(QWidget): # Unsave, BL Tag, BL Post, Popout) fit cleanly under any theme. # Same pattern as the search-bar score buttons in app.py and the # settings dialog spinbox +/- buttons. - _tb_btn_style = "padding: 3px 6px;" + _tb_btn_style = "padding: 2px 6px;" self._bookmark_btn = QPushButton("Bookmark") self._bookmark_btn.setFixedWidth(100) diff --git a/booru_viewer/gui/settings.py b/booru_viewer/gui/settings.py index e37a8e2..0e5e884 100644 --- a/booru_viewer/gui/settings.py +++ b/booru_viewer/gui/settings.py @@ -90,20 +90,20 @@ class SettingsDialog(QDialog): # absolute minimum bounds), which causes the spinbox value text to # vertically clip. setMinimumHeight is a Python-side floor that # propagates up the layout chain — the dialog's own min size grows - # to accommodate it instead of squeezing the contents. 32px gives - # comfortable headroom for the 13px font + padding/border on every - # tested DPI/scale combo (smoke-tested at 1x and 1.5x). - spinbox.setMinimumHeight(32) + # to accommodate it instead of squeezing the contents. 24px gives + # a couple of extra pixels of headroom over the 22px native button + # height for the 13px font, comfortable on every tested DPI/scale. + spinbox.setMinimumHeight(24) container = QWidget() h = QHBoxLayout(container) h.setContentsMargins(0, 0, 0, 0) h.setSpacing(2) h.addWidget(spinbox, 1) - # Inline padding override mirrors the search-bar score field at - # app.py:370 — without it, the bundled themes' QPushButton padding - # of `5px 12px` leaves no horizontal room for the +/- glyph and - # the buttons render empty under custom.qss. - _btn_style = "padding: 4px 6px;" + # Inline padding override matches the rest of the app's narrow + # toolbar buttons. The new bundled themes use `padding: 2px 8px` + # globally, but `2px 6px` here gives the +/- glyph a touch more + # room to breathe in a 25px-wide button. + _btn_style = "padding: 2px 6px;" minus = QPushButton("-") minus.setFixedWidth(25) minus.setStyleSheet(_btn_style) diff --git a/themes/catppuccin-mocha-rounded.qss b/themes/catppuccin-mocha-rounded.qss index 7ec3b1a..182e739 100644 --- a/themes/catppuccin-mocha-rounded.qss +++ b/themes/catppuccin-mocha-rounded.qss @@ -60,8 +60,8 @@ QPushButton { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -114,12 +114,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -145,8 +145,8 @@ QComboBox { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/catppuccin-mocha-square.qss b/themes/catppuccin-mocha-square.qss index 09b0123..782ac11 100644 --- a/themes/catppuccin-mocha-square.qss +++ b/themes/catppuccin-mocha-square.qss @@ -59,8 +59,8 @@ QPushButton { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -111,12 +111,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -141,8 +141,8 @@ QComboBox { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/everforest-rounded.qss b/themes/everforest-rounded.qss index 603ea50..ea70778 100644 --- a/themes/everforest-rounded.qss +++ b/themes/everforest-rounded.qss @@ -60,8 +60,8 @@ QPushButton { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -114,12 +114,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -145,8 +145,8 @@ QComboBox { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/everforest-square.qss b/themes/everforest-square.qss index 9a38a18..c412e7b 100644 --- a/themes/everforest-square.qss +++ b/themes/everforest-square.qss @@ -59,8 +59,8 @@ QPushButton { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -111,12 +111,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -141,8 +141,8 @@ QComboBox { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/gruvbox-rounded.qss b/themes/gruvbox-rounded.qss index b5f24dd..703b7ab 100644 --- a/themes/gruvbox-rounded.qss +++ b/themes/gruvbox-rounded.qss @@ -60,8 +60,8 @@ QPushButton { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -114,12 +114,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -145,8 +145,8 @@ QComboBox { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/gruvbox-square.qss b/themes/gruvbox-square.qss index fe2976a..87a09a8 100644 --- a/themes/gruvbox-square.qss +++ b/themes/gruvbox-square.qss @@ -59,8 +59,8 @@ QPushButton { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -111,12 +111,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -141,8 +141,8 @@ QComboBox { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/nord-rounded.qss b/themes/nord-rounded.qss index d2d4d0c..9dfc95c 100644 --- a/themes/nord-rounded.qss +++ b/themes/nord-rounded.qss @@ -60,8 +60,8 @@ QPushButton { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -114,12 +114,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -145,8 +145,8 @@ QComboBox { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/nord-square.qss b/themes/nord-square.qss index 4ec3400..5a93e41 100644 --- a/themes/nord-square.qss +++ b/themes/nord-square.qss @@ -59,8 +59,8 @@ QPushButton { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -111,12 +111,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -141,8 +141,8 @@ QComboBox { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/solarized-dark-rounded.qss b/themes/solarized-dark-rounded.qss index 015f810..5c131d7 100644 --- a/themes/solarized-dark-rounded.qss +++ b/themes/solarized-dark-rounded.qss @@ -60,8 +60,8 @@ QPushButton { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -114,12 +114,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -145,8 +145,8 @@ QComboBox { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/solarized-dark-square.qss b/themes/solarized-dark-square.qss index b83f4d0..8c3225f 100644 --- a/themes/solarized-dark-square.qss +++ b/themes/solarized-dark-square.qss @@ -59,8 +59,8 @@ QPushButton { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -111,12 +111,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -141,8 +141,8 @@ QComboBox { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/tokyo-night-rounded.qss b/themes/tokyo-night-rounded.qss index 8ea1239..20bca9b 100644 --- a/themes/tokyo-night-rounded.qss +++ b/themes/tokyo-night-rounded.qss @@ -60,8 +60,8 @@ QPushButton { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -114,12 +114,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -145,8 +145,8 @@ QComboBox { color: ${text}; border: 1px solid ${border_strong}; border-radius: 4px; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent}; diff --git a/themes/tokyo-night-square.qss b/themes/tokyo-night-square.qss index d107304..c500f35 100644 --- a/themes/tokyo-night-square.qss +++ b/themes/tokyo-night-square.qss @@ -59,8 +59,8 @@ QPushButton { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 5px 12px; - min-height: 18px; + padding: 2px 8px; + min-height: 17px; } QPushButton:hover { background-color: ${bg_hover}; @@ -111,12 +111,12 @@ QLineEdit, QSpinBox, QDoubleSpinBox, QTextEdit, QPlainTextEdit { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; + padding: 2px 6px; /* min-height ensures the painted text fits inside the widget bounds * even when a parent layout (e.g. QFormLayout inside a QGroupBox) * compresses the natural sizeHint. Without this, spinboxes in dense * forms render with the top of the value text clipped. */ - min-height: 20px; + min-height: 16px; selection-background-color: ${accent}; selection-color: ${accent_text}; } @@ -141,8 +141,8 @@ QComboBox { background-color: ${bg_subtle}; color: ${text}; border: 1px solid ${border_strong}; - padding: 4px 8px; - min-height: 20px; + padding: 2px 6px; + min-height: 16px; } QComboBox:hover { border-color: ${accent};