How do you increase the text size in the TabViewItems header? #7512
Replies: 23 comments 2 replies
-
@Going-Gone You can override the @StephenLPeters Should we template bind the TabViewItem's |
Beta Was this translation helpful? Give feedback.
-
Yup, I agree. We need to be better about remembering to bind these inherited properties. @ranjeshj |
Beta Was this translation helpful? Give feedback.
-
@MikeHillberg is FontSize Inherited? Should we need to template bind this to the template parts? |
Beta Was this translation helpful? Give feedback.
-
@Felix-Dev I think that the FontSize is intended to propagate to the tab's content, and the perscribed way of setting the header font size is through that light weight style. If so, template binding the font size property to the header would be incorrect. |
Beta Was this translation helpful? Give feedback.
-
FontSize inherits, but a lot of controls set it in their default style, which will override anything that comes from a parent. |
Beta Was this translation helpful? Give feedback.
-
@StephenLPeters It does not have any effect at all on the Tab's content from what I can see: <muxc:TabView>
<muxc:TabView.TabItems>
<muxc:TabViewItem Header="Tab 1" FontSize="80">
Some tab content
</muxc:TabViewItem>
</muxc:TabView.TabItems>
</muxc:TabView> I also think if we have the
<muxc:TabView>
<muxc:TabView.TabItems>
<muxc:TabViewItem Header="Tab 1" FontFamily="Segoe Script">
Some tab content
</muxc:TabViewItem>
</muxc:TabView.TabItems>
</muxc:TabView> So from the way I see it - given the current API design - TabViewItem.FontSize should affect the font size of the tab's header - and only that. The way as it stands now, we are currently looking at inconsistent API behavior. |
Beta Was this translation helpful? Give feedback.
-
The TabView control has a FontSize property as well as the TabViewItem. Sort of confusing to what font it affects. |
Beta Was this translation helpful? Give feedback.
-
Hmm, @Felix-Dev your points are convincing, as the other API's are currently set up I agree I would expect font size to effect the header. Unfortunate then that we already have a resouce which is driving this. Template binding the FontSize property would break anyone that was using the resource to customize this... |
Beta Was this translation helpful? Give feedback.
-
@Going-Gone I agree the scenario is confusing... @Felix-Dev if you set the FontSize property on the TabView does it do anything? Does setting the FontFamily on the TabView propagate to all of the TabViewItems? |
Beta Was this translation helpful? Give feedback.
-
I don't think we should be afraid of making breaking changes to fix template bindings. It just requires calling out clearly at the top of the release in a breaking changes section what apps need to update. This is especially true since upgrading WinUI is optional. More generally, accumulation of errors is a problem that makes things tricky to use 10 years in the future. I brought this up in the past if we could setup a system were major releases were allowed breaking changes (like WinUI 4.0) where there is clear benefit (such as adopting ItemsRepeater across the board, etc.) |
Beta Was this translation helpful? Give feedback.
-
I agree this shouldn't block us fixing the issue. Just wanted to get the issue on the books. |
Beta Was this translation helpful? Give feedback.
-
@StephenLPeters The existing resource (TabViewItemHeaderFontSize), while not needed any longer if we template bind FontSize, would not cause a breaking change, if I add
to the style of the TabViewItem. Will check TabView.FontSize behavior soon. |
Beta Was this translation helpful? Give feedback.
-
I think that is true, but it would break the propagation behavior of FontSize, maybe that is okay though.. |
Beta Was this translation helpful? Give feedback.
-
@StephenLPeters The TabView.FontSize is inherited by the ContentPresenter (TabContentPresenter) of the TabView: <muxc:TabView FontSize="80" >
<muxc:TabView.TabItems>
<muxc:TabViewItem Header="Tab 1">
Some tab content
</muxc:TabViewItem>
<muxc:TabViewItem Header="Tab 2"/>
</muxc:TabView.TabItems>
</muxc:TabView> TabView.FontFamily affects both the tab content and the TabViewItem's header: <muxc:TabView FontFamily="Segoe Script">
<muxc:TabView.TabItems>
<muxc:TabViewItem Header="Tab 1">
Some tab content
</muxc:TabViewItem>
<muxc:TabViewItem Header="Tab 2"/>
</muxc:TabView.TabItems>
</muxc:TabView> |
Beta Was this translation helpful? Give feedback.
-
hmm, in that case these font properties feel a bit broken, I suspect we have this issue in a few places across the framework.. |
Beta Was this translation helpful? Give feedback.
-
@stmoy as FYI. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the CC - I'll add this to the small pile of "TabViewItem customization doesn't work quite right" issues 😉 |
Beta Was this translation helpful? Give feedback.
-
I actually had hit this just before this issue was filed, glad one was filed. I believe the microsoft-ui-xaml/dev/TabView/TabView.xaml Lines 682 to 693 in c6c8d08
|
Beta Was this translation helpful? Give feedback.
-
I just noticed a similar problem for the parent containers like TabView and ListView. If you set the Font properties on the parent ListView it has no effect on the child ListViewItems as I may expect... |
Beta Was this translation helpful? Give feedback.
-
So couldn't anyone fix this issue in the last more than one year? |
Beta Was this translation helpful? Give feedback.
-
@bkudiess why did you covert this to a discussion from issue #3047? Based on the discussion there was a legitimate/issue/bug even though the original post was a question. It should be re-labeled, maybe have the title changed, but seems like it should still be tracked as an issue? |
Beta Was this translation helpful? Give feedback.
-
@hawkerm I think they just took every existing Issue with the Question tag and made them Discussions - even though many of the issues like this one evolved into actionable tasks... |
Beta Was this translation helpful? Give feedback.
-
So can you please finally fix this? It is not very user friendly, that some properties that should work are not working... I can't understand how come you just let this situation be for almost 4 years... That is crazy indeed. Please make WinUI better, and fix all these issues |
Beta Was this translation helpful? Give feedback.
-
I set
FontSize to a number, and the size stays the same. Is there something I'm missing?
FontSize="500"
Beta Was this translation helpful? Give feedback.
All reactions