Skip to content

Commit 9aa42ee

Browse files
committed
Passkeys tab fix
1 parent e996e34 commit 9aa42ee

6 files changed

Lines changed: 27 additions & 10 deletions

File tree

nitrokeyapp/__main__.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ def exception_handler(
211211
}
212212
213213
/* ── Checkboxes ─────────────────────────────────────────────────────── */
214-
QCheckBox { spacing: 8px; color: #24292f; }
214+
QCheckBox { spacing: 8px; color: #24292f; background-color: transparent; }
215+
QStackedWidget#algorithm_tab,
216+
QWidget#algorithm_edit,
217+
QWidget#algorithm_show { background-color: transparent; }
215218
QCheckBox::indicator {
216219
width: 16px; height: 16px;
217220
border: 1px solid #d0d7de;
@@ -606,7 +609,10 @@ def exception_handler(
606609
}
607610
608611
/* ── Checkboxes ─────────────────────────────────────────────────────── */
609-
QCheckBox { spacing: 8px; color: #c9d1d9; }
612+
QCheckBox { spacing: 8px; color: #c9d1d9; background-color: transparent; }
613+
QStackedWidget#algorithm_tab,
614+
QWidget#algorithm_edit,
615+
QWidget#algorithm_show { background-color: transparent; }
610616
QCheckBox::indicator {
611617
width: 16px; height: 16px;
612618
border: 1px solid #30363d;
@@ -822,19 +828,26 @@ def main() -> None:
822828
app.setFont(QFont("Segoe UI", 11))
823829

824830
style_hints = app.styleHints()
825-
app.setStyleSheet(_stylesheet_for_scheme(style_hints.colorScheme())) # type: ignore [attr-defined]
826-
style_hints.colorSchemeChanged.connect( # type: ignore [attr-defined]
827-
lambda scheme: app.setStyleSheet(_stylesheet_for_scheme(scheme))
828-
)
831+
832+
def apply_stylesheet(scheme: Qt.ColorScheme) -> None: # type: ignore [name-defined]
833+
app.setStyleSheet(_stylesheet_for_scheme(scheme))
834+
835+
apply_stylesheet(style_hints.colorScheme()) # type: ignore [attr-defined]
836+
style_hints.colorSchemeChanged.connect(apply_stylesheet) # type: ignore [attr-defined]
829837

830838
with init_logging() as log_file:
831839
log_environment()
832840

833841
window = GUI(app, log_file)
834-
# re-resolve themed icons once the event loop is running: Qt's
835-
# platform theme detection isn't always settled yet during startup,
836-
# so icons set during GUI construction can briefly use the wrong variant
837-
QTimer.singleShot(0, window.refresh_themed_icons)
842+
843+
def refresh_theme() -> None:
844+
# Qt's platform theme detection isn't always settled yet during
845+
# startup, so the stylesheet/icons set above can briefly use the
846+
# wrong variant; re-resolve both once the event loop is running
847+
apply_stylesheet(style_hints.colorScheme()) # type: ignore [attr-defined]
848+
window.refresh_themed_icons()
849+
850+
QTimer.singleShot(0, refresh_theme)
838851
with exception_handler(window.trigger_handle_exception.emit):
839852
app.exec()
840853

nitrokeyapp/qt_utils_mix_in.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"done.svg": ("light_mode/done.svg", "dark_mode/done_colored.svg"),
2020
"down_arrow.svg": ("light_mode/down_arrow.svg", "dark_mode/down_arrow_colored.svg"),
2121
"edit.svg": ("light_mode/edit.svg", "dark_mode/edit_colored.svg"),
22+
"lock.svg": ("light_mode/lock.svg", "dark_mode/lock_colored.svg"),
23+
"lock_open.svg": ("light_mode/lock_open.svg", "dark_mode/lock_open_colored.svg"),
2224
"refresh.svg": ("light_mode/refresh.svg", "dark_mode/refresh_colored.svg"),
2325
"right_arrow.svg": ("light_mode/right_arrow.svg", "dark_mode/right_arrow_colored.svg"),
2426
"visibility.svg": ("light_mode/visibility.svg", "dark_mode/visibility_colored.svg"),
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
File renamed without changes.

0 commit comments

Comments
 (0)