Skip to content

Commit

Permalink
Use standard image size 16x16 when using fixed tab height
Browse files Browse the repository at this point in the history
  • Loading branch information
eng-myousif committed Nov 16, 2023
1 parent 6389fe0 commit e99d2eb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,9 @@ void CalculateTabHeight(bool force = false)
{
if (!force && !Widget.Loaded)
return;
var fontHeight = CalculateFontHeight();

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

Check failure on line 417 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 417 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 417 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 417 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-windows

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 417 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-windows

The name 'minImageSquareSide' does not exist in the current context
tabDrawable.Height = tabContentHeight + TabPadding.Vertical; // 2 px padding at top and bottom
}

private int CalculateFontHeight()
Expand All @@ -430,10 +429,9 @@ void CalculateImageSizes(bool force = false)
if (!force && !Widget.Loaded)
return;

var fontHeight = CalculateFontHeight();
maxImageSize = new Size(fontHeight, fontHeight);
maxImageSize = new Size(minImageSquareSide, minImageSquareSide);

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-mac

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-windows

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-windows

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-windows

The name 'minImageSquareSide' does not exist in the current context

Check failure on line 432 in src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs

View workflow job for this annotation

GitHub Actions / build-windows

The name 'minImageSquareSide' does not exist in the current context

if(UseFixedTabHeight)
if (UseFixedTabHeight)
return;

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

0 comments on commit e99d2eb

Please sign in to comment.