Paint tabs over the title bar

Ribbon for WPF Forum

The latest build of this product (v2018.1 build 0675) was released 2 months ago, which was before this thread was created.
Posted 17 days ago by Ralph
Version: 18.1.0675
Avatar

Is there any way of painting ribbon tabs over the title bar?
Just like VS2019 paints the menu over the title bar, it would be nice to be able to paint tabs higher and leave more space for the content.  If there are just 2 or 3 tabs, most of the title bar is empty and a lot of vertial space is wasted, especially when I don't display any application icon nor QAT controls.

Comments (2)

Posted 17 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ralph,

The Ribbon doesn't have that capability at this time.  I will make a note of the suggestion.  The downside of it is that it would prevent usage of application icons, the QAT, contextual tabs, and tab panel items.  Those all have UI pieces that arrange in various places that would conflict.


Actipro Software Support

Posted 4 days ago by Ralph
Avatar

Yes, this can only be done when no advanced Ribbon features are used, but it's not a problem for many applications.  Contextual tabs will still appear, but without group banners above them.

I managed to get the tabs painted over the title bar by overriding OnApplyTemplate() in the RibbonWindow code behind.  The only downside of this solution is that when the window is first displayed, the ribbon visibly jumps.  Not perfect, but works.

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Dispatcher.BeginInvoke(new Action(() =>
            {
                if (Template.FindName("PART_TitleBar", this) is Grid titleBar)
                    Ribbon.Margin = new Thickness(0.0, -titleBar.ActualHeight, 0.0, 0.0);
            }), DispatcherPriority.Normal);
        }

[Modified 4 days ago]

Add Comment

Please log in to a validated account to post comments.