Skip to content

Commit

Permalink
Th24 BASE_FEATURE fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex313031 committed Aug 22, 2024
1 parent 5df98f5 commit ae5aa13
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
42 changes: 21 additions & 21 deletions other/thorium-2024-ui.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ index bba403a7e5068..e6cba4e30c0a0 100644
// to the white space above and below.
- const int bookmark_bar_attached_vertical_margin =
- features::IsChromeRefresh2023() ? 6 : 4;
+ const int bookmark_bar_attached_vertical_margin = IsThorium2024() ? 2 : 6;
+ const int bookmark_bar_attached_vertical_margin = features::IsThorium2024() ? 2 : 6;
return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
bookmark_bar_attached_vertical_margin;
}
Expand All @@ -33,13 +33,13 @@ index bba403a7e5068..e6cba4e30c0a0 100644
GetLayoutConstant(TAB_STRIP_PADDING);
case TAB_STRIP_PADDING:
- return features::IsChromeRefresh2023() ? 6 : 0;
+ return IsThorium2024() ? 0 : 6;
+ return features::IsThorium2024() ? 0 : 6;
+ case TAB_MARGIN:
+ return IsThorium2024() ? 6 : GetLayoutConstant(TAB_STRIP_PADDING);
+ return features::IsThorium2024() ? 6 : GetLayoutConstant(TAB_STRIP_PADDING);
+ case TAB_INACTIVE_PADDING:
+ return IsThorium2024() ? 3 : 6;
+ return features::IsThorium2024() ? 3 : 6;
+ case TAB_SEARCH_PADDING:
+ return IsThorium2024() ? 4 : 0;
+ return features::IsThorium2024() ? 4 : 0;
case TAB_SEPARATOR_HEIGHT:
// TODO (crbug.com/1451400): ChromeRefresh2023 needs different values for
// this constant.
Expand All @@ -48,14 +48,14 @@ index bba403a7e5068..e6cba4e30c0a0 100644
return 1;
case TOOLBAR_DIVIDER_HEIGHT:
- return touch_ui ? 20 : 16;
+ if (IsThorium2024()) {
+ if (features::IsThorium2024()) {
+ return 20;
+ } else {
+ return touch_ui ? 20 : 16;
+ }
case TOOLBAR_DIVIDER_SPACING:
- return 9;
+ return IsThorium2024() ? 8 : 9;
+ return features::IsThorium2024() ? 8 : 9;
case TOOLBAR_DIVIDER_WIDTH:
return 2;
case TOOLBAR_ELEMENT_PADDING:
Expand All @@ -64,7 +64,7 @@ index bba403a7e5068..e6cba4e30c0a0 100644
}
case TOOLBAR_STANDARD_SPACING:
- if (features::IsChromeRefresh2023()) {
+ if (features::IsChromeRefresh2023() && !IsThorium2024()) {
+ if (features::IsChromeRefresh2023() && !features::IsThorium2024()) {
return touch_ui ? 12 : 9;
} else {
return touch_ui ? 12 : 8;
Expand All @@ -73,7 +73,7 @@ index bba403a7e5068..e6cba4e30c0a0 100644
return features::IsChromeRefresh2023() ? 20 : 16;
case TOOLBAR_CORNER_RADIUS:
- return 8;
+ return IsThorium2024() ? 0 : 8;
+ return features::IsThorium2024() ? 0 : 8;
default:
break;
}
Expand Down Expand Up @@ -152,9 +152,9 @@ index aa9cd30374311..5d5a40f92f922 100644
- return 10;
+ static const bool rectangular_tabs =
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
+ if (IsThorium2024() && !rectangular_tabs) {
+ if (features::IsThorium2024() && !rectangular_tabs) {
+ return 8;
+ } else if ((rectangular_tabs && IsThorium2024()) || (rectangular_tabs && !IsThorium2024())) {
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
+ return 3;
+ } else {
+ return 10;
Expand All @@ -165,9 +165,9 @@ index aa9cd30374311..5d5a40f92f922 100644
- return 12;
+ static const bool rectangular_tabs =
+ base::CommandLine::ForCurrentProcess()->HasSwitch("rectangular-tabs");
+ if (IsThorium2024() && !rectangular_tabs) {
+ if (features::IsThorium2024() && !rectangular_tabs) {
+ return 10;
+ } else if ((rectangular_tabs && IsThorium2024()) || (rectangular_tabs && !IsThorium2024())) {
+ } else if ((rectangular_tabs && features::IsThorium2024()) || (rectangular_tabs && !features::IsThorium2024())) {
+ return 3;
+ } else {
+ return 12;
Expand All @@ -181,7 +181,7 @@ index aa9cd30374311..5d5a40f92f922 100644
gfx::Size ChromeRefresh2023TabStyle::GetSeparatorSize() const {
- return gfx::Size(kChromeRefreshSeparatorThickness,
- kChromeRefreshSeparatorHeight);
+ if (IsThorium2024()) {
+ if (features::IsThorium2024()) {
+ return gfx::Size(kThoriumSeparatorThickness,
+ kThoriumSeparatorHeight);
+ } else {
Expand All @@ -196,7 +196,7 @@ index aa9cd30374311..5d5a40f92f922 100644
- GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding,
- kChromeRefreshTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
- GetBottomCornerRadius() + kChromeRefreshTabHorizontalPadding);
+ if (IsThorium2024()) {
+ if (features::IsThorium2024()) {
+ return gfx::Insets::TLBR(
+ kThoriumTabVerticalPadding + GetLayoutConstant(TAB_STRIP_PADDING),
+ GetBottomCornerRadius() + kThoriumTabHorizontalPadding,
Expand All @@ -216,7 +216,7 @@ index aa9cd30374311..5d5a40f92f922 100644
- kChromeRefreshSeparatorHorizontalMargin,
- GetLayoutConstant(TAB_STRIP_PADDING),
- kChromeRefreshSeparatorHorizontalMargin);
+ if (IsThorium2024()) {
+ if (features::IsThorium2024()) {
+ return gfx::Insets::TLBR(GetLayoutConstant(TAB_INACTIVE_PADDING),
+ kThoriumSeparatorHorizontalMargin,
+ GetLayoutConstant(TAB_INACTIVE_PADDING),
Expand Down Expand Up @@ -341,15 +341,15 @@ index 83c7f06f1b236..576150ff56af4 100644
menu_horizontal_border_size = 0;
submenu_horizontal_overlap = 0;
- item_vertical_margin = 6;
+ item_vertical_margin = IsThorium2024() ? 4 : 6;
+ item_vertical_margin = features::IsThorium2024() ? 4 : 6;
item_horizontal_border_padding = 12;
arrow_size = 16;
- separator_height = 17;
- separator_spacing_height = 4;
- use_outer_border = false;
+ separator_height = IsThorium2024() ? 11 : 17;
+ separator_spacing_height = IsThorium2024() ? 3 : 4;
+ use_outer_border = IsThorium2024() ? true : false;
+ separator_height = features::IsThorium2024() ? 11 : 17;
+ separator_spacing_height = features::IsThorium2024() ? 3 : 4;
+ use_outer_border = features::IsThorium2024() ? true : false;
}

// static
Expand All @@ -376,7 +376,7 @@ index 3684e27766834..d62fe3f96ab62 100644
int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id,
const gfx::Size& size) const {
+
+ if (IsThorium2024()) {
+ if (features::IsThorium2024()) {
+ switch (id) {
+ case ShapeContextTokens::kBadgeRadius:
+ return 4;
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/browser/ui/views/tabs/tab_style_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ SkPath ChromeRefresh2023TabStyleViews::GetPath(
}
}

if (Th24State()) {
if (features::IsThorium2024()) {
top -= tab()->controller()->Th24StrokeOffset();
// Experimental int
//bottom -= tab()->controller()->Th24StrokeOffset();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/base/ui_base_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ bool IsChromeWebuiRefresh2023() {
base::FeatureList::IsEnabled(kChromeRefreshSecondary2023);
}

BASE_FEATURE(kThorium2024
BASE_FEATURE(kThorium2024,
"Thorium2024",
base::FEATURE_DISABLED_BY_DEFAULT);

Expand Down

0 comments on commit ae5aa13

Please sign in to comment.