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

HamburgerMenu and Item selection/hover brush improvements #3134

Merged
merged 25 commits into from Jan 8, 2018

Conversation

Projects
None yet
2 participants
@punker76
Member

punker76 commented Dec 30, 2017

What changed?

HamburgerMenu

  • Renaming:
    • HamburgerListBoxItemStyle -> HamburgerMenuItemStyle
    • HamburgerListBoxStyle -> HamburgerMenuListStyle
  • Revert back to UWPCommunityToolkit style (update template to keep options visible)
    • Move template to HamburgerMenuTemplate resource dictionary
    • Add margins
    • Vertically stretch the menu items of the hamburger menu
  • Change inner ListBox scrolling (CanContentScroll)
  • Add ItemContainerStyle and OptionsItemContainerStyle properties. This makes it easier to change the inner styles for the items (and option items)^
  • MinHeight of the menu items should be 0
  • HamburgerMenuImageItem: Downgrade thumbnail property from BitmapImage to subclass ImageSource
  • Introduce ItemInvoked event (as an alternative to ItemClick and OptionsItemClick)
  • SelectionIndicator which can be enabled with the new ShowSelectionIndicator dependency property
  • Improved item FocusVisualStyle
    • Add new (readonly) ItemFocusVisualStyle dependency property which will be re-created if one of these properties are changed: OpenPaneLength, CompactPaneLength and IsPaneOpen.
    • Default template is HamburgerMenuItemFocusVisualTemplate.
    • This FocusVisualStyle can be override at the HamburgerMenuItem style by setting the FocusVisualStyle property.
  • Reorganize Hamburger sample: shows now Default style, Creators Update style and a sample with the MaterialDesignInXaml Ripple control

ToggleSwitch

  • New ContentPadding dependency property. Add this new property to change the padding of the inner content in an easy way.

ItemHelper

  • New helper class with Brush attached properties for mouse interaction. These properties can be used with HamburgerMenuItem, ListBoxItem, ListViewItem, TreeViewItem and ComboBoxItem.
    • ActiveSelectionBackgroundBrush default AccentColorBrush
    • ActiveSelectionForegroundBrush default AccentSelectedColorBrush
    • DisabledBackgroundBrush default x:Null
    • DisabledForegroundBrush default GrayNormalBrush
    • DisabledSelectedBackgroundBrush default GrayBrush7
    • DisabledSelectedForegroundBrush default AccentSelectedColorBrush
    • HoverBackgroundBrush default AccentColorBrush3
    • HoverSelectedBackgroundBrush default AccentColorBrush
    • SelectedBackgroundBrush default AccentColorBrush2
    • SelectedForegroundBrush default AccentSelectedColorBrush

mahapps_hamburger

2018-01-08_16h34_14

2018-01-08_16h34_19

2018-01-08_16h34_22

Closes #2931
Closes #2975
Closes #2979

punker76 added some commits Dec 30, 2017

HamburgerMenu: revert back to UWPCommunityToolkit style
  - Update template to keep options visible
  - Change inner ListBox scrolling (CanContentScroll)
HamburgerMenu: add ItemContainerStyle properties
  - Add ItemContainerStyle and OptionsItemContainerStyle properties
  - This makes it easier to change the inner styles for the items (and option items)

@punker76 punker76 added this to the 1.6.0 milestone Dec 30, 2017

@punker76 punker76 self-assigned this Dec 30, 2017

punker76 added some commits Dec 30, 2017

HamburgerMenu: update template
  - Move template to HamburgerMenuTemplate resource dictionary
  - Add margins
  - Vertically stretch the menu items of the hamburger menu
ListBoxItem: change disabled Foreground to GrayNormalBrush
HamburgerMenu:
  HamburgerListBoxItemStyle -> HamburgerMenuItemStyle
  HamburgerListBoxStyle -> HamburgerMenuListStyle
ListItemHelper with Brush attached properties
  - `ListItemHelper.ActiveSelectionBackgroundBrush` default `AccentColorBrush`
  - `ListItemHelper.ActiveSelectionForegroundBrush` default `AccentSelectedColorBrush`
  - `ListItemHelper.DisabledForegroundBrush` default `GrayNormalBrush`
  - `ListItemHelper.DisabledSelectedBackgroundBrush` default `GrayBrush7`
  - `ListItemHelper.DisabledSelectedForegroundBrush` default `AccentSelectedColorBrush`
  - `ListItemHelper.MouseOverBackgroundBrush` default `AccentColorBrush3`
  - `ListItemHelper.SelectedBackgroundBrush` default `AccentColorBrush2`
  - `ListItemHelper.SelectedForegroundBrush` default `AccentSelectedColorBrush`
Renaming: MouseOverBackgroundBrush -> HoverBackgroundBrush
New brush for hovered selected items: HoverSelectedBackgroundBrush
Fix for all: Hovered background if selected background was not set
Adjusted brushes for ListBox, ListView, TreeView, ComboBox

@punker76 punker76 added the enhancement label Jan 3, 2018

@punker76 punker76 changed the title from WIP HamburgerMenu changes to WIP HamburgerMenu and Item selection/hover brush improvements Jan 4, 2018

punker76 added some commits Jan 4, 2018

HamburgerMenu: add SelectionIndicator which can be enabled with the n…
…ew ShowSelectionIndicator dependency property
HamburgerMenu: improved item FocusVisualStyle
  Add new (readonly) ItemFocusVisualStyle dependency property which will be re-created if one of these properties are changed: OpenPaneLength, CompactPaneLength and IsPaneOpen
  It will be used the default control template HamburgerMenuItemFocusVisualTemplate.
  This FocusVisualStyle can be override at the HamburgerMenuItem style by setting the FocusVisualStyle property.
ToggleSwitch: new ContentPadding dependency property
  Add this new property to change the padding of the inner content in an easy way.

@punker76 punker76 changed the title from WIP HamburgerMenu and Item selection/hover brush improvements to HamburgerMenu and Item selection/hover brush improvements Jan 8, 2018

@punker76 punker76 merged commit 6536bbb into develop Jan 8, 2018

1 check passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@punker76 punker76 referenced this pull request Jan 8, 2018

Closed

Creators Hamburger Menu #2975

@amkuchta

This comment has been minimized.

Contributor

amkuchta commented Jan 8, 2018

clapping

@amkuchta

This comment has been minimized.

Contributor

amkuchta commented Jan 11, 2018

@punker76 how do I expose HamburgerMenuItemStyle so that I can create my own HamburgerMenuCreatorsItemStyle as you have done in HamburgerMenuCreatorsUpdate.xaml? Should we consider making both HamburgerMenuCreatorsItemStyle and HamburgerMenuCreatorsStyle out-of-the-box styles for ease of use?

@punker76 punker76 deleted the feature/HamburgerMenu_UWPCommunityToolkit_CreatorsStyle_pr2975_i2931 branch Jan 11, 2018

@punker76 punker76 added the Feature label Feb 11, 2018

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