Skip to content

Commit

Permalink
Calculate closeSize and closeMargin unconditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
ievgen-baida committed Feb 23, 2024
1 parent eebc0e0 commit 2d64d72
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ void CalculateTab(ThemedDocumentPageHandler tab, int i, ref float posx)
size.Width += textoffset;
}

var closesize = UseFixedTabHeight ? minImageSquareSide : tabDrawable.Height / 2;
var closesize = (int)Math.Floor(tabDrawable.Height * 0.6);
var tabRect = new RectangleF(posx, 0, size.Width + (tab.Closable ? closesize + tabPadding.Horizontal + tabPadding.Right : tabPadding.Horizontal), tabDrawable.Height);

if (i == selectedIndex && draggingLocation != null)
Expand All @@ -703,7 +703,7 @@ void CalculateTab(ThemedDocumentPageHandler tab, int i, ref float posx)

tab.Rect = tabRect;

tab.CloseRect = new RectangleF(tabRect.X + tab.Rect.Width - tabPadding.Right - closesize, tabDrawable.Height / 4, closesize, closesize);
tab.CloseRect = new RectangleF(tabRect.X + tab.Rect.Width - tabPadding.Right - closesize, (tabDrawable.Height - closesize) / 2, closesize, closesize);
tab.TextRect = new RectangleF(tabRect.X + tabPadding.Left + textoffset, (tabDrawable.Height - size.Height) / 2, textSize.Width, textSize.Height);

posx += tab.Rect.Width;
Expand All @@ -722,7 +722,7 @@ void DrawTab(Graphics g, ThemedDocumentPageHandler tab, int i)
var tabRect = tab.Rect;
var textRect = tab.TextRect;
var closerect = tab.CloseRect;
var closemargin = UseFixedTabHeight ? 3 : closerect.Height / 3;
var closemargin = closerect.Height / 4;

var textcolor = Enabled ? TabForegroundColor : DisabledForegroundColor;
var backcolor = TabBackgroundColor;
Expand Down

0 comments on commit 2d64d72

Please sign in to comment.