Skip to content

Commit 2ce05e5

Browse files
committed
ui: expand clickable area of "-" tag button, improve styling
1 parent b96727a commit 2ce05e5

File tree

1 file changed

+24
-6
lines changed
  • tagstudio/src/qt/widgets

1 file changed

+24
-6
lines changed

tagstudio/src/qt/widgets/tag.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ def __init__(
151151

152152
self.inner_layout = QHBoxLayout()
153153
self.inner_layout.setObjectName("innerLayout")
154-
self.inner_layout.setContentsMargins(2, 2, 2, 2)
154+
self.inner_layout.setContentsMargins(0, 0, 0, 0)
155155

156156
self.bg_button.setLayout(self.inner_layout)
157-
self.bg_button.setMinimumSize(22, 22)
157+
self.bg_button.setMinimumSize(44, 22)
158158

159159
primary_color = get_primary_color(tag)
160160
border_color = (
@@ -211,16 +211,34 @@ def __init__(
211211
self.remove_button.setText("–")
212212
self.remove_button.setHidden(True)
213213
self.remove_button.setStyleSheet(
214+
f"QPushButton{{"
214215
f"color: rgba{primary_color.toTuple()};"
215216
f"background: rgba{text_color.toTuple()};"
216217
f"font-weight: 800;"
217-
f"border-radius: 3px;"
218-
f"border-width:0;"
218+
f"border-radius: 5px;"
219+
f"border-width: 4;"
220+
f"border-color: rgba(0,0,0,0);"
219221
f"padding-bottom: 4px;"
220222
f"font-size: 14px"
223+
f"}}"
224+
f"QPushButton::hover{{"
225+
f"background: rgba{primary_color.toTuple()};"
226+
f"color: rgba{text_color.toTuple()};"
227+
f"border-color: rgba{highlight_color.toTuple()};"
228+
f"border-width: 2;"
229+
f"border-radius: 6px;"
230+
f"}}"
231+
f"QPushButton::pressed{{"
232+
f"background: rgba{border_color.toTuple()};"
233+
f"color: rgba{highlight_color.toTuple()};"
234+
f"}}"
235+
f"QPushButton::focus{{"
236+
f"background: rgba{border_color.toTuple()};"
237+
f"outline:none;"
238+
f"}}"
221239
)
222-
self.remove_button.setMinimumSize(18, 18)
223-
self.remove_button.setMaximumSize(18, 18)
240+
self.remove_button.setMinimumSize(22, 22)
241+
self.remove_button.setMaximumSize(22, 22)
224242
self.remove_button.clicked.connect(self.on_remove.emit)
225243

226244
if has_remove:

0 commit comments

Comments
 (0)