Compare commits

...

4 Commits

Author SHA1 Message Date
wukko e379f406e5 revision: bump to 7 2025-07-11 23:21:53 +06:00
wukko 7a02f2ac4b helium/settings: fix expression in translate patch 2025-07-11 22:09:38 +06:00
wukko 3a8dcfc49f helium/ui: new tab design
- tabs are now narrower and shorter
- split view tabs are wider to accommodate for two tabs in one component
- tabs are now attached to the toolbar
- close button now appears only on hover/focus
- fixed tab closing animation, close button no longer slides along with the rest of the tab
- new tab button no longer interferes with the tab separator
2025-07-11 21:59:26 +06:00
wukko 2f1884b2e5 helium/ui: transparent address bar and thinner toolbar 2025-07-11 21:42:18 +06:00
6 changed files with 102 additions and 47 deletions
@@ -4,7 +4,7 @@
</settings-spell-check-page>
</settings-section>
</template>
+<if expr="_google_chrome">
+<if expr="False">
<settings-section page-title="$i18n{translatePageTitle}"
section="translate" nest-under-section="languages">
<settings-translate-page prefs="{{prefs}}"
+11 -2
View File
@@ -41,12 +41,21 @@
case LOCATION_BAR_ICON_SIZE:
return touch_ui ? 20 : 16;
case LOCATION_BAR_LEADING_ICON_SIZE:
@@ -85,7 +85,7 @@ int GetLayoutConstant(LayoutConstant con
!features::HasTabstripComboButtonWithBackground() &&
!features::HasTabSearchToolbarButton()
? 4
- : 0;
+ : 1;
case STAR_RATING_ICON_SIZE:
return 14;
case TAB_AFTER_TITLE_PADDING:
@@ -97,12 +97,12 @@ int GetLayoutConstant(LayoutConstant con
case TAB_CLOSE_BUTTON_SIZE:
return touch_ui ? 24 : 16;
case TAB_HEIGHT:
- return 34 + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
+ return 33;
+ return 31;
case TAB_STRIP_HEIGHT:
return GetLayoutConstant(TAB_HEIGHT) +
GetLayoutConstant(TAB_STRIP_PADDING);
@@ -124,7 +133,7 @@
case TOOLBAR_INTERIOR_MARGIN:
- return touch_ui ? gfx::Insets() : gfx::Insets::VH(6, 5);
+ return touch_ui ? gfx::Insets() : gfx::Insets::VH(3, 6);
+ return touch_ui ? gfx::Insets() : gfx::Insets::VH(2, 6);
case WEBUI_TAB_STRIP_TOOLBAR_INTERIOR_MARGIN:
return gfx::Insets::VH(4, 0);
@@ -157,6 +157,27 @@
gfx::Rect bounds_without_endcaps(GetLocalBounds());
bounds_without_endcaps.Inset(gfx::Insets::VH(0, border_radius));
return bounds_without_endcaps;
@@ -1197,9 +1200,9 @@ void LocationBarView::RefreshBackground(
const bool high_contrast = GetNativeTheme()->UserHasContrastPreference();
const auto* const color_provider = GetColorProvider();
- SkColor normal = color_provider->GetColor(kColorLocationBarBackground);
+ SkColor normal = color_provider->GetColor(kColorOmniboxResultsBackground);
SkColor hovered =
- color_provider->GetColor(kColorLocationBarBackgroundHovered);
+ color_provider->GetColor(kColorOmniboxResultsBackgroundHovered);
background_color_ = gfx::Tween::ColorValueBetween(opacity, normal, hovered);
if (is_caret_visible) {
@@ -1223,7 +1226,7 @@ void LocationBarView::RefreshBackground(
is_caret_visible
? color_provider->GetColor(kColorOmniboxResultsBackground)
: color_provider->GetColor(kColorLocationBarBorder);
- } else if (!is_caret_visible && input_in_progress) {
+ } else if (!is_caret_visible) {
// Under CR23 guidelines, if the (regular contrast) Omnibox is unfocused,
// but still contains in-progress user input, a unique border color will be
// applied.
--- a/chrome/browser/ui/views/location_bar/location_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
@@ -110,7 +110,7 @@ SkColor LocationIconView::GetForegroundC
+21 -1
View File
@@ -1,10 +1,19 @@
--- a/chrome/browser/ui/views/tabs/tab_strip_control_button.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip_control_button.cc
@@ -58,7 +58,7 @@ class ControlButtonHighlightPathGenerato
} // namespace
const int TabStripControlButton::kIconSize = 16;
-const gfx::Size TabStripControlButton::kButtonSize{28, 28};
+const gfx::Size TabStripControlButton::kButtonSize{26, 26};
TabStripControlButton::TabStripControlButton(
TabStripController* tab_strip_controller,
@@ -234,6 +234,7 @@ void TabStripControlButton::UpdateBackgr
}
int TabStripControlButton::GetCornerRadius() const {
+ if ((true)) return 8;
+ if ((true)) return 6;
return features::IsTabSearchMoving() && !features::HasTabSearchToolbarButton()
? kTabstripComboButtonCornerRadius
: TabStripControlButton::kButtonSize.width() / 2;
@@ -29,3 +38,14 @@
SetForegroundFrameActiveColorId(kColorNewTabButtonForegroundFrameActive);
SetForegroundFrameInactiveColorId(
kColorNewTabButtonForegroundFrameInactive);
--- a/chrome/browser/ui/views/frame/tab_strip_region_view.cc
+++ b/chrome/browser/ui/views/frame/tab_strip_region_view.cc
@@ -472,7 +472,7 @@ void TabStripRegionView::Layout(PassKey)
GetLayoutConstant(TAB_STRIP_PADDING) +
GetLayoutConstant(NEW_TAB_BUTTON_LEADING_MARGIN);
- gfx::Point button_new_position = gfx::Point(x, 0);
+ gfx::Point button_new_position = gfx::Point(x, 1);
gfx::Rect button_new_bounds = gfx::Rect(button_new_position, button_size);
// If the tabsearch button is before the tabstrip container, then manually
+47 -42
View File
@@ -1,6 +1,6 @@
--- a/chrome/browser/ui/tabs/tab_style.cc
+++ b/chrome/browser/ui/tabs/tab_style.cc
@@ -18,13 +18,13 @@ namespace {
@@ -18,17 +18,20 @@ namespace {
// Thickness in DIPs of the separator painted on the left and right edges of
// the tab.
@@ -12,12 +12,29 @@
constexpr int kChromeRefreshSeparatorHeight = 16;
// The padding from the top of the tab to the content area.
-constexpr int kChromeRefreshTabVerticalPadding = 6;
+constexpr int kChromeRefreshTabVerticalPadding = 7;
constexpr int kChromeRefreshTabHorizontalPadding = 8;
constexpr int kChromeRefreshTabVerticalPadding = 6;
-constexpr int kChromeRefreshTabHorizontalPadding = 8;
+constexpr int kChromeRefreshTabHorizontalPadding = 7;
// The standard tab width is 232 DIP, excluding separators and overlap.
@@ -104,11 +104,11 @@ int TabStyle::GetMinimumInactiveWidth()
-constexpr int kTabWidth = 232;
+constexpr int kTabWidth = 200;
+
+// Split tabs need more space to be readable
+constexpr int kSplitTabWidth = 250;
} // namespace
@@ -42,7 +45,7 @@ int TabStyle::GetStandardWidth(const boo
if (is_split) {
// Split tabs appear as half width with one bottom extension. They also must
// include half the tab overlap as the tabs fill the space between them.
- return kTabWidth / 2 + GetBottomCornerRadius() + GetTabOverlap() / 2;
+ return kSplitTabWidth / 2 + GetBottomCornerRadius() + GetTabOverlap() / 2;
} else {
// The full width includes two extensions with the bottom corner radius.
return kTabWidth + 2 * GetBottomCornerRadius();
@@ -104,11 +107,11 @@ int TabStyle::GetMinimumInactiveWidth()
}
int TabStyle::GetTopCornerRadius() const {
@@ -31,42 +48,6 @@
}
int TabStyle::GetTabOverlap() const {
--- a/chrome/browser/ui/views/tabs/tab_group_highlight.cc
+++ b/chrome/browser/ui/views/tabs/tab_group_highlight.cc
@@ -47,33 +47,7 @@ void TabGroupHighlight::OnPaint(gfx::Can
}
SkPath TabGroupHighlight::GetPath() const {
- // This path imitates the shape of a tab (see GM2TabStyle::GetPath()). It
- // doesn't reuse the exact same GetPath() function because it doesn't need
- // much of the complexity there. Group highlights only appear on group drag,
- // which is a well-scoped interaction. A dragging group doesn't nestle in with
- // the tabs around it, so there are no special cases needed when determining
- // its shape.
- const int corner_radius = TabStyle::Get()->GetBottomCornerRadius();
- const int top = GetLayoutConstant(TAB_STRIP_PADDING);
-
SkPath path;
- path.moveTo(0, bounds().height());
- path.arcTo(corner_radius, corner_radius, 0, SkPath::kSmall_ArcSize,
- SkPathDirection::kCCW, corner_radius,
- bounds().height() - corner_radius);
- path.lineTo(corner_radius, top + corner_radius);
- path.arcTo(corner_radius, corner_radius, 0, SkPath::kSmall_ArcSize,
- SkPathDirection::kCW, 2 * corner_radius, top);
- path.lineTo(bounds().width() - 2 * corner_radius, top);
- path.arcTo(corner_radius, corner_radius, 0, SkPath::kSmall_ArcSize,
- SkPathDirection::kCW, bounds().width() - corner_radius,
- top + corner_radius);
- path.lineTo(bounds().width() - corner_radius,
- bounds().height() - corner_radius);
- path.arcTo(corner_radius, corner_radius, 0, SkPath::kSmall_ArcSize,
- SkPathDirection::kCCW, bounds().width(), bounds().height());
- path.close();
-
return path;
}
--- a/chrome/browser/ui/views/tabs/tab_style_views.cc
+++ b/chrome/browser/ui/views/tabs/tab_style_views.cc
@@ -214,8 +214,6 @@ SkPath TabStyleViewsImpl::GetPath(TabSty
@@ -87,7 +68,31 @@
- path_type == TabStyle::PathType::kHighlight ||
- path_type == TabStyle::PathType::kInteriorClip ||
- path_type == TabStyle::PathType::kHitTest) {
+ if ((true)) {
+ if ((false)) {
float top_left_corner_radius = content_corner_radius;
float top_right_corner_radius = content_corner_radius;
float bottom_left_corner_radius = content_corner_radius;
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -1161,9 +1161,7 @@ void Tab::UpdateIconVisibility() {
// left that needs to be considered.
const int close_button_width = GetLayoutConstant(TAB_CLOSE_BUTTON_SIZE) +
GetLayoutConstant(TAB_AFTER_TITLE_PADDING);
- const bool large_enough_for_close_button =
- available_width >= (touch_ui ? kTouchMinimumContentsWidthForCloseButtons
- : kMinimumContentsWidthForCloseButtons);
+ const bool large_enough_for_close_button = mouse_hovered_;
if (IsActive()) {
#if BUILDFLAG(IS_CHROMEOS)
@@ -1209,6 +1207,10 @@ void Tab::UpdateIconVisibility() {
large_enough_for_close_button;
if (base::CommandLine::ForCurrentProcess()->HasSwitch("hide-tab-close-buttons"))
showing_close_button_ = false;
+
+ if (closing_) {
+ showing_close_button_ = false;
+ }
if (showing_close_button_) {
available_width -= close_button_width;
}
+1 -1
View File
@@ -1 +1 @@
6
7