Skip to content

Commit ae73a7e

Browse files
committed
UI/Qt: Shrink navigation toolbar buttons
Reduce toolbar button height alongside the recently tightened browser chrome. Keep all standard toolbar controls aligned by applying the same size to navigation, sidebar, downloads, and menu buttons. Adjust the styled bounds and menu glyph position to preserve visual centering.
1 parent fa65fc9 commit ae73a7e

3 files changed

Lines changed: 17 additions & 10 deletions

File tree

UI/Qt/ChromeStyle.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ QWidget#LadybirdNavigationToolbar QToolButton {{
348348
color: {5};
349349
background: transparent;
350350
border: 1px solid transparent;
351-
border-radius: 17px;
352-
min-width: 34px;
353-
min-height: 34px;
354-
margin: 1px 0;
351+
border-radius: 16px;
352+
min-width: 32px;
353+
min-height: 32px;
354+
margin: 0 0 2px 0;
355355
padding: 0;
356356
}}
357357
@@ -376,6 +376,10 @@ QWidget#LadybirdNavigationToolbar QToolButton::menu-indicator {{
376376
image: none;
377377
}}
378378
379+
QWidget#LadybirdNavigationToolbar QToolButton#LadybirdHamburgerButton {{
380+
margin: 1px 0;
381+
}}
382+
379383
QPushButton#LadybirdPrivateBadge {{
380384
color: {5};
381385
background: {10};

UI/Qt/Icon.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ static QPixmap create_chrome_icon_pixmap(ChromeIcon icon, QColor color, qreal de
263263
break;
264264
case ChromeIcon::Menu:
265265
painter.setPen(chrome_icon_pen(color, 1.55));
266-
painter.drawLine(QPointF(4.1, 6.2), QPointF(15.9, 6.2));
267-
painter.drawLine(QPointF(4.1, 10.0), QPointF(15.9, 10.0));
268-
painter.drawLine(QPointF(4.1, 13.8), QPointF(15.9, 13.8));
266+
painter.drawLine(QPointF(4.1, 5.7), QPointF(15.9, 5.7));
267+
painter.drawLine(QPointF(4.1, 9.5), QPointF(15.9, 9.5));
268+
painter.drawLine(QPointF(4.1, 13.3), QPointF(15.9, 13.3));
269269
break;
270270
case ChromeIcon::Star:
271271
draw_star_icon(painter, color, false);

UI/Qt/Tab.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,16 @@ class DownloadsButton final : public QToolButton {
156156
QIcon m_progress_icon;
157157
};
158158

159+
static constexpr int TOOLBAR_BUTTON_SIZE = 34;
160+
159161
static QToolButton* create_toolbar_button(QWidget& parent, QAction& action)
160162
{
161163
auto* button = new QToolButton(&parent);
162164
button->setDefaultAction(&action);
163165
button->setAutoRaise(true);
164166
button->setFocusPolicy(Qt::NoFocus);
165167
button->setIconSize({ 20, 20 });
166-
button->setFixedSize(36, 36);
168+
button->setFixedSize(TOOLBAR_BUTTON_SIZE, TOOLBAR_BUTTON_SIZE);
167169

168170
// FIXME: In Menu.cpp, we set the initial visibility of the action before we've associated it with this QToolButton.
169171
// It would be nicer if we didn't have to do this here.
@@ -599,7 +601,7 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
599601
m_downloads_button->setAutoRaise(true);
600602
m_downloads_button->setFocusPolicy(Qt::NoFocus);
601603
m_downloads_button->setIconSize({ 20, 20 });
602-
m_downloads_button->setFixedSize(36, 36);
604+
m_downloads_button->setFixedSize(TOOLBAR_BUTTON_SIZE, TOOLBAR_BUTTON_SIZE);
603605
m_downloads_button->setVisible(m_open_downloads_page_action->isVisible());
604606
QObject::connect(m_downloads_button, &QToolButton::clicked, this, [this] {
605607
show_downloads_popover();
@@ -617,11 +619,12 @@ Tab::Tab(BrowserWindow* window, RefPtr<WebView::WebContentClient> parent_client,
617619
});
618620

619621
m_hamburger_button = new HamburgerButton(m_toolbar);
622+
m_hamburger_button->setObjectName("LadybirdHamburgerButton");
620623
m_hamburger_button->setText("Show &Menu");
621624
m_hamburger_button->setToolTip("Show Menu");
622625
m_hamburger_button->setIcon(create_chrome_icon(ChromeIcon::Menu, palette()));
623626
m_hamburger_button->setIconSize({ 20, 20 });
624-
m_hamburger_button->setFixedSize(36, 36);
627+
m_hamburger_button->setFixedSize(TOOLBAR_BUTTON_SIZE, TOOLBAR_BUTTON_SIZE);
625628
m_hamburger_button->setAutoRaise(true);
626629
m_hamburger_button->setFocusPolicy(Qt::NoFocus);
627630
m_hamburger_button->setPopupMode(QToolButton::InstantPopup);

0 commit comments

Comments
 (0)