UI/Qt: Remove obsolete vertical toolbar layout branch
Vertical tab mode always keeps the toolbar in the full-width chrome row. Remove the older split path that could place the toolbar in the page column, and simplify the window-control visibility checks around that single layout model.
This commit is contained in:
parent
79b892ec7c
commit
a1bb958419
2 changed files with 7 additions and 27 deletions
|
|
@ -1533,26 +1533,14 @@ int TabWidget::vertical_tabs_layout_width() const
|
|||
return m_vertical_tabs_expanded ? m_vertical_tabs_expanded_width : VERTICAL_TABS_COLLAPSED_WIDTH;
|
||||
}
|
||||
|
||||
bool TabWidget::uses_full_width_toolbar_for_current_layout() const
|
||||
{
|
||||
return m_vertical_tabs_enabled
|
||||
&& current_tab_layout() != TabLayout::Horizontal;
|
||||
}
|
||||
|
||||
bool TabWidget::should_show_window_controls_in_tab_toolbar() const
|
||||
{
|
||||
if (!m_window_controls_visible)
|
||||
return false;
|
||||
|
||||
if (browser_chrome_layout_policy().controls_placement == WindowControlsPlacement::RightCustomControls)
|
||||
return m_tab_bar->tab_layout() != TabLayout::Horizontal;
|
||||
|
||||
return uses_full_width_toolbar_for_current_layout();
|
||||
return m_window_controls_visible && m_tab_bar->tab_layout() != TabLayout::Horizontal;
|
||||
}
|
||||
|
||||
void TabWidget::update_toolbar_placement()
|
||||
{
|
||||
auto use_full_width_toolbar = uses_full_width_toolbar_for_current_layout();
|
||||
auto use_full_width_toolbar = current_tab_layout() != TabLayout::Horizontal;
|
||||
|
||||
for (int index = 0; index < m_stacked_widget->count(); ++index) {
|
||||
auto* current_tab = tab(index);
|
||||
|
|
@ -1584,18 +1572,11 @@ void TabWidget::rebuild_layout()
|
|||
|
||||
if (m_tab_bar->tab_layout() != TabLayout::Horizontal) {
|
||||
rebuild_layout_for_vertical_tabs();
|
||||
auto use_full_width_toolbar = uses_full_width_toolbar_for_current_layout();
|
||||
|
||||
if (use_full_width_toolbar) {
|
||||
m_main_layout->addWidget(m_toolbar_container);
|
||||
m_page_column->hide();
|
||||
} else {
|
||||
rebuild_page_column();
|
||||
m_page_column->show();
|
||||
}
|
||||
m_main_layout->addWidget(m_toolbar_container);
|
||||
m_page_column->hide();
|
||||
|
||||
m_vertical_tabs_content_layout->addWidget(m_vertical_tabs_reserved_space);
|
||||
m_vertical_tabs_content_layout->addWidget(use_full_width_toolbar ? static_cast<QWidget*>(m_stacked_widget) : m_page_column, 1);
|
||||
m_vertical_tabs_content_layout->addWidget(m_stacked_widget, 1);
|
||||
m_main_layout->addWidget(m_vertical_tabs_content, 1);
|
||||
m_vertical_tabs_content->show();
|
||||
} else {
|
||||
|
|
@ -1720,7 +1701,7 @@ void TabWidget::update_vertical_tabs_resize_handle()
|
|||
|
||||
void TabWidget::update_vertical_tabs_content_separator()
|
||||
{
|
||||
auto show_content_separator = m_tab_bar_visible && uses_full_width_toolbar_for_current_layout();
|
||||
auto show_content_separator = m_tab_bar_visible && m_tab_bar->tab_layout() != TabLayout::Horizontal;
|
||||
m_vertical_tabs_content_separator->setVisible(show_content_separator);
|
||||
if (!show_content_separator)
|
||||
return;
|
||||
|
|
@ -1847,7 +1828,7 @@ void TabWidget::update_tab_chrome_visibility()
|
|||
|
||||
auto show_window_controls = m_window_controls_visible
|
||||
&& m_tab_bar_visible
|
||||
&& (is_horizontal || (browser_chrome_layout_policy().controls_placement == WindowControlsPlacement::LeftTrafficLights && m_vertical_tabs_expanded && !uses_full_width_toolbar_for_current_layout()));
|
||||
&& is_horizontal;
|
||||
m_window_controls->setVisible(show_window_controls);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -172,7 +172,6 @@ private:
|
|||
bool can_expand_vertical_tabs_on_hover() const;
|
||||
bool cursor_is_over_vertical_tabs() const;
|
||||
int vertical_tabs_layout_width() const;
|
||||
bool uses_full_width_toolbar_for_current_layout() const;
|
||||
bool should_show_window_controls_in_tab_toolbar() const;
|
||||
|
||||
void rebuild_layout();
|
||||
|
|
|
|||
Loading…
Reference in a new issue