Skip to content

Commit 0c7814b

Browse files
authored
82/fix view btn width (#105)
* Fix button width inconsistency * Migrate to table style
1 parent 59b32d2 commit 0c7814b

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ repos:
1414
args: [--fix]
1515
- id: ruff-format
1616

17-
- repo: https://github.com/pre-commit/mirrors-mypy
18-
rev: v1.19.1
17+
- repo: local
1918
hooks:
2019
- id: mypy
20+
name: mypy
21+
entry: uv run --only-group dev mypy .
22+
language: system
23+
types: [python]
24+
pass_filenames: false
2125

2226
- repo: https://github.com/pre-commit/pre-commit-hooks
2327
rev: v6.0.0

src/voxkit/gui/frameworks/categorical_table/categorical_table.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ def update_display(self):
291291
button_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
292292

293293
view_btn = QPushButton("View")
294-
view_btn.setFixedSize(60, 24)
295294
view_btn.setStyleSheet(Buttons.TABLE_VIEW)
296295
view_btn.clicked.connect(lambda checked, idx=row_idx: self.view_item_details(idx))
297296
button_layout.addWidget(view_btn)

src/voxkit/gui/pages/datasets/datasets_page.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -539,18 +539,15 @@ def _create_alignment_action_buttons(self, alignment: alignments.AlignmentMetada
539539
layout.setContentsMargins(5, 2, 5, 2)
540540
layout.setSpacing(5)
541541

542-
button_style = Buttons.SUCCESS_SMALL
543-
544542
# Delete button
545543
delete_btn = QPushButton("Delete")
546-
delete_btn.setMaximumWidth(60)
547544
delete_btn.setStyleSheet(Buttons.DELETE_SMALL)
548545
delete_btn.clicked.connect(lambda: self._delete_alignment(alignment))
549546
layout.addWidget(delete_btn)
550547

551548
# View button
552549
view_btn = QPushButton("View")
553-
view_btn.setStyleSheet(button_style)
550+
view_btn.setStyleSheet(Buttons.TABLE_VIEW)
554551
view_btn.clicked.connect(lambda: self._view_alignment(alignment))
555552
layout.addWidget(view_btn)
556553

@@ -810,15 +807,13 @@ def _create_dataset_action_buttons(self, dataset_meta: DatasetMetadata):
810807
"""
811808
widget = QWidget()
812809
layout = QHBoxLayout(widget)
813-
layout.setContentsMargins(0, 0, 0, 0)
810+
layout.setContentsMargins(5, 2, 5, 2)
811+
layout.setSpacing(5)
814812
layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
815813

816-
button_style = Buttons.TABLE_VIEW
817-
818814
# Details button
819815
details_btn = QPushButton("Details")
820-
details_btn.setFixedSize(80, 24)
821-
details_btn.setStyleSheet(button_style)
816+
details_btn.setStyleSheet(Buttons.TABLE_VIEW)
822817
details_btn.clicked.connect(lambda: self._view_dataset_details(dataset_meta))
823818
layout.addWidget(details_btn)
824819

src/voxkit/gui/styles/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ class Buttons:
257257
font-size: 12px;
258258
font-weight: bold;
259259
color: {Colors.TEXT_SECONDARY};
260+
min-width: 60px;
261+
min-height: 24px;
260262
}}
261263
QPushButton:hover {{
262264
background-color: {Colors.LIGHT_GRAY};

0 commit comments

Comments
 (0)