Skip to content

Commit 2b57282

Browse files
committed
Use standard image size 16x16 when using fixed tab height
1 parent 6389fe0 commit 2b57282

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class ThemedDocumentControlHandler : ThemedContainerHandler<TableLayout,
3434
static Padding DefaultTabPadding = 6;
3535

3636
static readonly object TabPadding_Key = new object();
37+
private int minImageSquareSide = 16;
3738

3839
/// <summary>
3940
/// Gets or sets the padding inside each tab around the text.
@@ -413,10 +414,9 @@ void CalculateTabHeight(bool force = false)
413414
{
414415
if (!force && !Widget.Loaded)
415416
return;
416-
var fontHeight = CalculateFontHeight();
417417

418-
var height = useFixedTabHeight ? fontHeight : Math.Max(maxImageSize.Height, fontHeight);
419-
tabDrawable.Height = height + TabPadding.Vertical; // 2 px padding at top and bottom
418+
var tabContentHeight = useFixedTabHeight ? minImageSquareSide : Math.Max(maxImageSize.Height, CalculateFontHeight());
419+
tabDrawable.Height = tabContentHeight + TabPadding.Vertical; // 2 px padding at top and bottom
420420
}
421421

422422
private int CalculateFontHeight()
@@ -430,10 +430,9 @@ void CalculateImageSizes(bool force = false)
430430
if (!force && !Widget.Loaded)
431431
return;
432432

433-
var fontHeight = CalculateFontHeight();
434-
maxImageSize = new Size(fontHeight, fontHeight);
433+
maxImageSize = new Size(minImageSquareSide, minImageSquareSide);
435434

436-
if(UseFixedTabHeight)
435+
if (UseFixedTabHeight)
437436
return;
438437

439438
for (int i = 0; i < pages.Count; i++)

0 commit comments

Comments
 (0)