UI/Qt: Align vertical tab chrome across platforms
Use the full-width toolbar layout for vertical tabs on every platform. Also use the same collapsed vertical tabs width everywhere so collapsed tab shapes remain square.
This commit is contained in:
parent
f03b675c2a
commit
456d94cb5b
2 changed files with 20 additions and 4 deletions
|
|
@ -1535,8 +1535,7 @@ int TabWidget::vertical_tabs_layout_width() const
|
|||
|
||||
bool TabWidget::uses_full_width_toolbar_for_current_layout() const
|
||||
{
|
||||
return browser_chrome_layout_policy().controls_placement == WindowControlsPlacement::LeftTrafficLights
|
||||
&& m_vertical_tabs_enabled
|
||||
return m_vertical_tabs_enabled
|
||||
&& current_tab_layout() != TabLayout::Horizontal;
|
||||
}
|
||||
|
||||
|
|
@ -1710,7 +1709,12 @@ void TabWidget::update_vertical_tabs_resize_handle()
|
|||
|
||||
auto handle_width = VERTICAL_TABS_RESIZE_HIT_AREA_WIDTH;
|
||||
auto divider_x = vertical_tabs_layout_width() - 1;
|
||||
m_vertical_tabs_resize_handle->setGeometry(divider_x - (handle_width / 2), m_vertical_tabs_content->y(), handle_width, m_vertical_tabs_content->height());
|
||||
auto chrome_rect = vertical_tabs_chrome_rect();
|
||||
m_vertical_tabs_resize_handle->setGeometry(
|
||||
divider_x - (handle_width / 2),
|
||||
chrome_rect.y(),
|
||||
handle_width,
|
||||
chrome_rect.height());
|
||||
m_vertical_tabs_resize_handle->raise();
|
||||
}
|
||||
|
||||
|
|
@ -1747,6 +1751,17 @@ void TabWidget::update_vertical_tabs_hover_layout()
|
|||
update_tab_layout();
|
||||
}
|
||||
|
||||
QRect TabWidget::vertical_tabs_chrome_rect() const
|
||||
{
|
||||
auto toolbar_height = browser_chrome_layout_policy().toolbar_height;
|
||||
return {
|
||||
0,
|
||||
toolbar_height,
|
||||
current_vertical_tabs_width(),
|
||||
max(0, height() - toolbar_height)
|
||||
};
|
||||
}
|
||||
|
||||
int TabWidget::vertical_tabs_tab_width() const
|
||||
{
|
||||
return max(0, current_vertical_tabs_width() - vertical_tabs_horizontal_margin_width(m_tab_bar->tab_layout()));
|
||||
|
|
@ -1865,7 +1880,7 @@ void TabWidget::update_vertical_tabs_overlay_geometry()
|
|||
return;
|
||||
}
|
||||
|
||||
m_vertical_tab_bar_column->setGeometry(0, m_vertical_tabs_content->y(), current_vertical_tabs_width(), m_vertical_tabs_content->height());
|
||||
m_vertical_tab_bar_column->setGeometry(vertical_tabs_chrome_rect());
|
||||
m_vertical_tab_bar_column->show();
|
||||
m_vertical_tab_bar_column->raise();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ private:
|
|||
void set_resize_handle_property(char const* property, bool enabled);
|
||||
void update_vertical_tabs_action_labels();
|
||||
void update_vertical_tabs_hover_layout();
|
||||
QRect vertical_tabs_chrome_rect() const;
|
||||
int vertical_tabs_tab_width() const;
|
||||
void update_vertical_tabs_button_layout();
|
||||
void update_tab_layout();
|
||||
|
|
|
|||
Loading…
Reference in a new issue