UI/Qt: Tighten browser chrome spacing

Reduce the Qt tab strip, navigation toolbar, and location edit heights
so the combined chrome takes less vertical space while the toolbar
buttons keep comfortable 36 px targets. Keep glyph sizes unchanged and
use inset toolbar button styling so the painted hover surfaces feel
lighter than the clickable area.
This commit is contained in:
Andreas Kling 2026-05-31 17:58:57 +02:00 committed by Andreas Kling
parent 4cb58762df
commit 1516560bc6
4 changed files with 19 additions and 18 deletions

View file

@ -315,9 +315,10 @@ QWidget#LadybirdNavigationToolbar QToolButton {{
color: {6};
background: transparent;
border: 1px solid transparent;
border-radius: 18px;
min-width: 36px;
min-height: 36px;
border-radius: 17px;
min-width: 34px;
min-height: 34px;
margin: 1px 0;
padding: 0;
}}
@ -453,8 +454,8 @@ QLineEdit#LadybirdLocationEdit {{
color: {4};
background: {0};
border: 1px solid {2};
border-radius: 19px;
min-height: 36px;
border-radius: 17px;
min-height: 34px;
padding: 0 16px;
selection-background-color: {6};
selection-color: {7};

View file

@ -151,7 +151,7 @@ LocationEdit::LocationEdit(QWidget* parent)
, m_autocomplete(new Autocomplete(this))
{
setObjectName("LadybirdLocationEdit");
setMinimumHeight(37);
setMinimumHeight(34);
setTextMargins(38, 0, 40, 0);
update_chrome_style();

View file

@ -82,7 +82,7 @@ static QToolButton* create_toolbar_button(QWidget& parent, QAction& action)
button->setAutoRaise(true);
button->setFocusPolicy(Qt::NoFocus);
button->setIconSize({ 20, 20 });
button->setFixedSize(38, 38);
button->setFixedSize(36, 36);
return button;
}
@ -109,7 +109,7 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_toolbar = new QWidget(this);
m_toolbar->setObjectName("LadybirdNavigationToolbar");
m_toolbar->setFixedHeight(47);
m_toolbar->setFixedHeight(42);
m_toolbar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
auto* toolbar_container_layout = new QVBoxLayout(m_toolbar_container);
@ -118,7 +118,7 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
auto* toolbar_layout = new QHBoxLayout(m_toolbar);
toolbar_layout->setSpacing(6);
toolbar_layout->setContentsMargins(12, 3, 12, 3);
toolbar_layout->setContentsMargins(12, 2, 12, 2);
m_location_edit = new LocationEdit(this);
m_bookmarks_bar = new BookmarksBar(this);
@ -153,7 +153,7 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
m_hamburger_button->setToolTip("Show Menu");
m_hamburger_button->setIcon(create_tvg_icon_with_theme_colors("hamburger", palette()));
m_hamburger_button->setIconSize({ 20, 20 });
m_hamburger_button->setFixedSize(38, 38);
m_hamburger_button->setFixedSize(36, 36);
m_hamburger_button->setAutoRaise(true);
m_hamburger_button->setFocusPolicy(Qt::NoFocus);
m_hamburger_button->setPopupMode(QToolButton::InstantPopup);

View file

@ -75,7 +75,7 @@ TabBar::TabBar(TabWidget* tab_widget)
setAcceptDrops(true);
setFocusPolicy(Qt::NoFocus);
setIconSize({ 16, 16 });
setMinimumHeight(42);
setMinimumHeight(39);
m_hover_animation = new QVariantAnimation(this);
m_hover_animation->setDuration(120);
@ -110,7 +110,7 @@ QSize TabBar::tabSizeHint(int index) const
hint.setWidth(width);
}
hint.setHeight(39);
hint.setHeight(36);
return hint;
}
@ -135,8 +135,8 @@ void TabBar::paintEvent(QPaintEvent* event)
auto hover_progress = index == m_hover_animation_tab_index ? m_hover_progress : (index == m_hovered_tab_index ? 1.0 : 0.0);
bool is_hovered = hover_progress > 0.0;
auto shape_rect = QRectF(tab_rect).adjusted(3.0, 1.5, -3.0, 0.5);
auto tab_path = tab_shape_path(shape_rect, 10.0, 9.0);
auto shape_rect = QRectF(tab_rect).adjusted(3.0, 2.0, -3.0, 1.0);
auto tab_path = tab_shape_path(shape_rect, 9.0, 8.0);
auto surface = ChromeStyle::chrome_surface(palette());
if (is_selected) {
@ -170,7 +170,7 @@ void TabBar::paintEvent(QPaintEvent* event)
auto separator = border;
separator.setAlpha(32);
painter.setPen(separator);
painter.drawLine(QPoint(tab_rect.left(), 17), QPoint(tab_rect.left(), height() - 17));
painter.drawLine(QPoint(tab_rect.left(), 15), QPoint(tab_rect.left(), height() - 15));
}
auto contents_rect = shape_rect.toAlignedRect().adjusted(16, 0, -14, 0);
@ -212,7 +212,7 @@ void TabBar::paintEvent(QPaintEvent* event)
indicator_color.setAlpha(220);
painter.setPen(QPen(indicator_color, 3, Qt::SolidLine, Qt::RoundCap));
painter.drawLine(QPointF(indicator_x, 9), QPointF(indicator_x, height() - 7));
painter.drawLine(QPointF(indicator_x, 8), QPointF(indicator_x, height() - 6));
}
}
@ -514,7 +514,7 @@ TabWidget::TabWidget(QWidget* parent)
auto* tab_bar_row_layout = new QHBoxLayout();
tab_bar_row_layout->setSpacing(4);
tab_bar_row_layout->setContentsMargins(12, 3, 4, 1);
tab_bar_row_layout->setContentsMargins(12, 2, 4, 1);
tab_bar_row_layout->addWidget(m_tab_bar);
tab_bar_row_layout->addWidget(m_new_tab_button, 0, Qt::AlignVCenter);
tab_bar_row_layout->addStretch(1);
@ -524,7 +524,7 @@ TabWidget::TabWidget(QWidget* parent)
m_tab_bar_row = new QWidget(this);
m_tab_bar_row->setObjectName("LadybirdTabStrip");
m_tab_bar_row->setMinimumHeight(46);
m_tab_bar_row->setMinimumHeight(43);
m_tab_bar_row->setLayout(tab_bar_row_layout);
m_tab_bar_row->installEventFilter(this);