Replace score spinbox arrows with side-by-side buttons
Hides QSpinBox arrows (break under QSS) and adds two separate QPushButtons with triangle characters. Theme-friendly since they're styled as normal buttons.
This commit is contained in:
parent
602a71d534
commit
8ebed2f281
@ -313,9 +313,17 @@ class BooruApp(QMainWindow):
|
|||||||
self._score_spin = QSpinBox()
|
self._score_spin = QSpinBox()
|
||||||
self._score_spin.setRange(0, 99999)
|
self._score_spin.setRange(0, 99999)
|
||||||
self._score_spin.setValue(0)
|
self._score_spin.setValue(0)
|
||||||
self._score_spin.setFixedWidth(90)
|
self._score_spin.setFixedWidth(50)
|
||||||
self._score_spin.setButtonSymbols(QSpinBox.ButtonSymbols.UpDownArrows)
|
self._score_spin.setButtonSymbols(QSpinBox.ButtonSymbols.NoButtons)
|
||||||
top.addWidget(self._score_spin)
|
top.addWidget(self._score_spin)
|
||||||
|
score_down = QPushButton("\u25bc")
|
||||||
|
score_down.setFixedWidth(25)
|
||||||
|
score_down.clicked.connect(lambda: self._score_spin.setValue(max(0, self._score_spin.value() - 1)))
|
||||||
|
top.addWidget(score_down)
|
||||||
|
score_up = QPushButton("\u25b2")
|
||||||
|
score_up.setFixedWidth(25)
|
||||||
|
score_up.clicked.connect(lambda: self._score_spin.setValue(self._score_spin.value() + 1))
|
||||||
|
top.addWidget(score_up)
|
||||||
|
|
||||||
self._search_bar = SearchBar(db=self._db)
|
self._search_bar = SearchBar(db=self._db)
|
||||||
self._search_bar.search_requested.connect(self._on_search)
|
self._search_bar.search_requested.connect(self._on_search)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user