Fix editor tabs control size for tab header when scroll bar is visible
#1135
This commit is contained in:
@@ -191,6 +191,8 @@ namespace FlaxEditor.GUI.Tabs
|
|||||||
get => _autoTabsSizeAuto;
|
get => _autoTabsSizeAuto;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (_autoTabsSizeAuto == value)
|
||||||
|
return;
|
||||||
_autoTabsSizeAuto = value;
|
_autoTabsSizeAuto = value;
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@@ -204,11 +206,11 @@ namespace FlaxEditor.GUI.Tabs
|
|||||||
get => _orientation;
|
get => _orientation;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (_orientation == value)
|
||||||
|
return;
|
||||||
_orientation = value;
|
_orientation = value;
|
||||||
|
|
||||||
if (UseScroll)
|
if (UseScroll)
|
||||||
TabsPanel.ScrollBars = _orientation == Orientation.Horizontal ? ScrollBars.Horizontal : ScrollBars.Vertical;
|
TabsPanel.ScrollBars = _orientation == Orientation.Horizontal ? ScrollBars.Horizontal : ScrollBars.Vertical;
|
||||||
|
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -402,6 +404,14 @@ namespace FlaxEditor.GUI.Tabs
|
|||||||
tabHeader.Size = tabsSize;
|
tabHeader.Size = tabsSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (UseScroll)
|
||||||
|
{
|
||||||
|
// If scroll bar is visible it covers part of the tab header so include this in tab size to improve usability
|
||||||
|
if (_orientation == Orientation.Horizontal && TabsPanel.HScrollBar.Visible)
|
||||||
|
tabsSize.Y += TabsPanel.HScrollBar.Height;
|
||||||
|
else if (_orientation == Orientation.Vertical && TabsPanel.VScrollBar.Visible)
|
||||||
|
tabsSize.X += TabsPanel.VScrollBar.Width;
|
||||||
|
}
|
||||||
|
|
||||||
// Fit the tabs panel
|
// Fit the tabs panel
|
||||||
TabsPanel.Size = _orientation == Orientation.Horizontal
|
TabsPanel.Size = _orientation == Orientation.Horizontal
|
||||||
|
|||||||
Reference in New Issue
Block a user