mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-09 11:27:32 -03:00
update tab outlines
This commit is contained in:
parent
b2b027c4ba
commit
ffcc6c58e4
3 changed files with 6 additions and 14 deletions
|
@ -21,10 +21,10 @@
|
|||
"Enable High Contrast Mode",
|
||||
"Enables high contrast mode for all Thorium instances.",
|
||||
kOsAll, SINGLE_VALUE_TYPE("force-high-contrast")},
|
||||
{"tab-outlines-in-low-contrast-themes",
|
||||
"Tab Outlines in Low Contrast Themes",
|
||||
"Expands the range of situations in which tab outline strokes are displayed, improving accessiblity in dark and incognito mode.",
|
||||
kOsAll, SINGLE_VALUE_TYPE("tab-outlines-in-low-contrast-themes")},
|
||||
{"force-enable-tab-outlines",
|
||||
"Force Enable Tab Outlines",
|
||||
"Force enables tab outline strokes, improving accessiblity in dark mode, incognito mode, and low contrast themes.",
|
||||
kOsAll, SINGLE_VALUE_TYPE("force-enable-tab-outlines")},
|
||||
{"prominent-dark-mode-active-tab-title",
|
||||
"Prominent Dark Mode Active Tab Titles",
|
||||
"Makes the active tab title bolder in dark mode so that it is easier to identify.",
|
||||
|
|
|
@ -1197,17 +1197,9 @@ bool TabStrip::ShouldDrawStrokes() const {
|
|||
|
||||
// Don't want to have to run a full feature query every time this function is
|
||||
// called.
|
||||
static const bool tab_outlines_in_low_contrast = base::CommandLine::ForCurrentProcess()->HasSwitch("tab-outlines-in-low-contrast-themes");
|
||||
|
||||
static const bool force_enable_tab_outlines =
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch("force-enable-tab-outlines");
|
||||
if (tab_outlines_in_low_contrast) {
|
||||
constexpr float kMinimumAbsoluteContrastForOutlines = 0.2f;
|
||||
const float background_luminance =
|
||||
color_utils::GetRelativeLuminance(background_color);
|
||||
const float frame_luminance =
|
||||
color_utils::GetRelativeLuminance(frame_color);
|
||||
const float contrast_difference =
|
||||
std::fabs(background_luminance - frame_luminance);
|
||||
if (contrast_difference < kMinimumAbsoluteContrastForOutlines)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue