Skip to content

Commit

Permalink
compact-ui now covers bookmarks. Also removed round corners from cont…
Browse files Browse the repository at this point in the history
…ext menus with the use of classic-omnibox; in the future, all metrics will be user-customizable and the existing options will be preserved as presets.
  • Loading branch information
win32ss committed May 18, 2024
1 parent b4d5e9e commit c2d2f04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chrome/browser/ui/layout_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ int GetLayoutConstant(LayoutConstant constant) {
bookmark_bar_attached_vertical_margin;
}
case BOOKMARK_BAR_BUTTON_HEIGHT:
if (compact_ui)
return touch_ui ? 29 : 21;
return touch_ui ? 36 : 28;
case BOOKMARK_BAR_BUTTON_PADDING:
return GetLayoutConstant(TOOLBAR_ELEMENT_PADDING);
Expand Down Expand Up @@ -142,6 +144,8 @@ int GetLayoutConstant(LayoutConstant constant) {
return touch_ui ? 48 : 28;
}
case TOOLBAR_DIVIDER_CORNER_RADIUS:
if(compact_ui)
return 0;
return 1;
case TOOLBAR_DIVIDER_HEIGHT:
return touch_ui ? 20 : 16;
Expand All @@ -150,6 +154,8 @@ int GetLayoutConstant(LayoutConstant constant) {
case TOOLBAR_DIVIDER_WIDTH:
return 2;
case TOOLBAR_ELEMENT_PADDING:
if (compact_ui)
return 0;
return touch_ui ? 0 : 4;
case TOOLBAR_ICON_DEFAULT_MARGIN:
if (features::IsChromeRefresh2023()) {
Expand All @@ -168,6 +174,8 @@ int GetLayoutConstant(LayoutConstant constant) {
case DOWNLOAD_ICON_SIZE:
return features::IsChromeRefresh2023() ? 20 : 16;
case TOOLBAR_CORNER_RADIUS:
if(compact_ui)
return 0;
return 8;
default:
break;
Expand Down
2 changes: 2 additions & 0 deletions ui/views/layout/layout_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id,
return GetCornerRadiusMetric(Emphasis::kMedium, size);
case ShapeContextTokens::kMenuRadius:
case ShapeContextTokens::kMenuAuxRadius:
if (base::CommandLine::ForCurrentProcess()->HasSwitch("classic-omnibox"))
return 0;
return kMenuCornerRadius;
case ShapeContextTokens::kMenuTouchRadius:
return kMenuCornerRadius;
Expand Down

0 comments on commit c2d2f04

Please sign in to comment.