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

TabControl Underlined TabPanel #2902

Merged
merged 12 commits into from
Mar 22, 2017
Merged

TabControl Underlined TabPanel #2902

merged 12 commits into from
Mar 22, 2017

Conversation

punker76
Copy link
Member

@punker76 punker76 commented Mar 21, 2017

What changed?

This PR adds a new attached property to add a new underlined type for the TabControl and MetroTabControl.

  • Add new Underlined attached property to TabControlHelper. This property controls the type of the underline type which can be TabItem or TabPanel (with TabItem).
    /// <summary>
    /// Specifies the underline position of a TabControl.
    /// </summary>
    public enum UnderlinedType
    {
        None,
        TabItems,
        SelectedTabItem,
        TabPanel
    }
  • Make IsUnderlined obsolete
  • Refactor Underline control, cause it doesn't work as expected (Bottom and Right doesn't works nicely)
  • Add new Brush attached properties to enable easy changing the underline brushes
Controls:TabControlHelper.UnderlineBrush
Controls:TabControlHelper.UnderlineSelectedBrush
Controls:TabControlHelper.UnderlineMouseOverBrush
Controls:TabControlHelper.UnderlineMouseOverSelectedBrush

mahapps_newunderline4

Closes #2895 [RFC] [Enhancement] Proposed TabControlHelper.IsUnderlined Change

  New property to control the type of the underline which can be TabItem or TabPanel (with TabItem)
  Add Obsolete tag to IsUnderlined property.
  This control can be used for underline scenarios.
  Use the new stuff at TabControl (TabControl) and MetroTabControl (MetroTabItem)
  Add combobox to handle the new underlined stuff
@amkuchta
Copy link
Contributor

amkuchta commented Mar 21, 2017

Could we add one more item to the enum:

public enum UnderlinedType
{
    None,
    AllTabItems,
    SelectedTabItem,
    TabPanel
}

where SelectedTabItem performs like TabPanel but without the line all the way across the TabPanel? I can implement, if you'd like

@punker76 punker76 self-assigned this Mar 21, 2017
  New underline type to show only selected TabItems underlined
@amkuchta
Copy link
Contributor

@punker76 👍 this is gorgeous!!

Copy link
Collaborator

@thoemmi thoemmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@amkuchta
Copy link
Contributor

HEAVY BREATHING

  And make Underline more crystal
  for TabItems, makes the Underline usage a little bit better (no jumpy lines gaps)
  New brush attached properties for easy changing the underline brush colors
@punker76 punker76 merged commit 63cf4eb into develop Mar 22, 2017
@amkuchta
Copy link
Contributor

@punker76 Was this designed to work with MetroAnitmatedTabControl and MetroAnimatedSingleRowTabControl? The underlines do not render on either control...

@punker76
Copy link
Member Author

@amkuchta it's coming...

@amkuchta
Copy link
Contributor

@punker76 awesome, no rush. I just didn't know if it was supposed to work or not, and didn't want to open an issue without checking in first. These look great!

@punker76 punker76 deleted the UnderlinedTabPanel branch March 28, 2017 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants