From ce2b784c9aacf0bdfe34d9a3369e41fd1066bc9e Mon Sep 17 00:00:00 2001 From: Artem Lytkin Date: Thu, 20 Aug 2026 00:59:33 +0300 Subject: [PATCH] Fix #1728: fill the active tab so it stands out from the inactive ones On the default System theme no app stylesheet is applied, so the .ui sheet is the only thing styling the tabs and the selected tab differs from the rest by nothing but the color of a 1px border: #777777 for every tab, palette(highlight) for the selected one. The fills are byte-identical - measured on Fusion, selected and unselected both render #1E1E1E, a contrast ratio of exactly 1.00. That is the configuration the issue was reported from, and there is no reliable way to tell which tab is open. Give the selected tab the highlight as a fill instead of only as a border outline, with highlighted-text for the label. Both roles come from the palette rather than a literal, and ThemeManager has set Highlight and HighlightedText together for all five built-in themes since 4ae0b20c, so the label stays legible on the new fill everywhere - measured 4.6:1 on qdarkstyle up to 9.3:1 on flatgray. The border stays as it was so the tab keeps its geometry and nothing shifts when the selection moves. Applied to all nine tab bars that share this stylesheet, since the issue reports it across the whole app rather than in one dialog. Where the bundled themes ship their own stylesheet the gain is smaller, and on one it is negative: blacksoft draws unselected tabs with a gradient whose top stop is #646464, which is exactly its palette highlight, so the filled tab lands on top of it and separation drops from 1.43 to 1.15. flatgray, lightblue and softpink improve from roughly 1.05 to 1.3; qdarkstyle is a wash at 1.36 to 1.31. Left as-is here rather than special-cased, since the right call on blacksoft is a question for review. --- include/ui/mainwindow.ui | 4 ++++ include/ui/setting/RouteItem.ui | 4 ++++ include/ui/setting/dialog_basic_settings.ui | 2 ++ include/ui/setting/dialog_hotkey.ui | 2 ++ include/ui/setting/dialog_manage_routes.ui | 2 ++ include/ui/setting/dialog_preset_settings.ui | 2 ++ include/ui/stats/dialog_traffic_stats.ui | 2 ++ 7 files changed, 18 insertions(+) diff --git a/include/ui/mainwindow.ui b/include/ui/mainwindow.ui index 0b5284002..6947588be 100644 --- a/include/ui/mainwindow.ui +++ b/include/ui/mainwindow.ui @@ -409,6 +409,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } @@ -522,6 +524,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } diff --git a/include/ui/setting/RouteItem.ui b/include/ui/setting/RouteItem.ui index 523ce9e3a..4d9f5b505 100644 --- a/include/ui/setting/RouteItem.ui +++ b/include/ui/setting/RouteItem.ui @@ -162,6 +162,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } QTabBar::tab:!selected { @@ -479,6 +481,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } QTabBar::tab:!selected { diff --git a/include/ui/setting/dialog_basic_settings.ui b/include/ui/setting/dialog_basic_settings.ui index 6e4b9c327..c6e46b382 100644 --- a/include/ui/setting/dialog_basic_settings.ui +++ b/include/ui/setting/dialog_basic_settings.ui @@ -54,6 +54,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } QTabBar::tab:!selected { diff --git a/include/ui/setting/dialog_hotkey.ui b/include/ui/setting/dialog_hotkey.ui index 453128768..190d1ebbb 100644 --- a/include/ui/setting/dialog_hotkey.ui +++ b/include/ui/setting/dialog_hotkey.ui @@ -38,6 +38,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } QTabBar::tab:!selected { diff --git a/include/ui/setting/dialog_manage_routes.ui b/include/ui/setting/dialog_manage_routes.ui index 3ae421f62..c5bf5a8dc 100644 --- a/include/ui/setting/dialog_manage_routes.ui +++ b/include/ui/setting/dialog_manage_routes.ui @@ -38,6 +38,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } QTabBar::tab:!selected { diff --git a/include/ui/setting/dialog_preset_settings.ui b/include/ui/setting/dialog_preset_settings.ui index 643ef7c6a..52405d669 100644 --- a/include/ui/setting/dialog_preset_settings.ui +++ b/include/ui/setting/dialog_preset_settings.ui @@ -38,6 +38,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); } QTabBar::tab:!selected { diff --git a/include/ui/stats/dialog_traffic_stats.ui b/include/ui/stats/dialog_traffic_stats.ui index e6c2098ce..8b4ea58b8 100644 --- a/include/ui/stats/dialog_traffic_stats.ui +++ b/include/ui/stats/dialog_traffic_stats.ui @@ -118,6 +118,8 @@ QTabBar::tab { QTabBar::tab:selected { border: 1px solid palette(highlight); + background: palette(highlight); + color: palette(highlighted-text); }