Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vs2013LightTheme DocumentHeader do not size to content #388

Open
707wk opened this issue Oct 21, 2022 · 8 comments
Open

Vs2013LightTheme DocumentHeader do not size to content #388

707wk opened this issue Oct 21, 2022 · 8 comments

Comments

@707wk
Copy link

707wk commented Oct 21, 2022

No description provided.

@LegoCodr
Copy link

Same here.
I'm using MahApps and MaterialDesign, When I change font size of AvalonDock in xaml using header template

  <DockingManager.DocumentHeaderTemplate>
      <DataTemplate>
          <StackPanel Orientation="Horizontal">
              <TextBlock Text="{Binding Content.Header}" FontSize="20" />
          </StackPanel>
      </DataTemplate>
  </DockingManager.DocumentHeaderTemplate>

The tabItem size didn't change, text just get cropped. Like this
cap-221026_055600

If I don't use the VS2013 Dark theme, the text can scale properly, anyone please help me. Thank you.

@Dirkster99
Copy link
Owner

This feature is not supported as far as I know I've never seen any AvalonDock app with scaled fonts in the Tabs section :-(

@LegoCodr
Copy link

Thnaks, that solves the mistery.

@Dirkster99
Copy link
Owner

Dirkster99 commented Dec 31, 2022

...but I just remembered that there are Styles and Templates that control the way of how TabItems are displayed for Documents and Anchorables. I wonder whether playing with these would solve your problem?

@Wenveo
Copy link
Contributor

Wenveo commented Jan 4, 2023

Because the Height of TabItem is set to 19.

<Border
x:Name="Header"
Margin="0,0,0,2"
Padding="1,0"
Height="19"

@Dirkster99
Copy link
Owner

Ah, well spotted @noisrev I have removed the height definition for testing and the VS2013 Tab appears to be of the same height as before. So, I am wondering if this is actually necessary at all?

@noisrev Can you see any problem if we remove this height definition in the VS2013 Style by default?

@LegoCodr Could you check whether the style is re-sizable for you if you remove the height definition?

AvalonDock/source/Components/AvalonDock.Themes.VS2013/Themes/Generic.xaml

  <avalonDockControls:DropDownControlArea
	DropDownContextMenu="{Binding Root.Manager.DocumentContextMenu}"
	DropDownContextMenuDataContext="{Binding LayoutItem, RelativeSource={RelativeSource TemplatedParent}}"
		Style="{DynamicResource DropDownControlArea}">
                        <Border
				x:Name="Header"
				Margin="0,0,0,2"
				Padding="1,0"
				Background="{TemplateBinding Background}"
				BorderBrush="{DynamicResource {x:Static reskeys:ResourceKeys.Background}}"
				BorderThickness="0,0,0,1">

@Wenveo
Copy link
Contributor

Wenveo commented Jan 5, 2023

@Dirkster99 No problem👌

@exercising-daemons
Copy link

I have also encountered this problem. In my case I am changing the inherited font size at the window and the tabs don't resize when the font does. I have tested this fix and removing the explicit height setting does allow the tabs to resize with the font. FWIW When decreasing the font size below default the tab height remains the same, even without the close glyph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants