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

chore: Use InfoBadge for TabBarItem badge support #1142

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

morning4coffe-dev
Copy link
Member

@morning4coffe-dev morning4coffe-dev commented May 16, 2024

GitHub Issue (If applicable): closes #1134

This PR adds support for using WinUI InfoBadge for TabBarItem while maintaining the support for old Badge properties. On Skia, the InfoBadge might be a little offset: unoplatform/uno#10326

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature

PR Checklist

Please check if your PR fulfills the following requirements:

Decided to not make a breaking change with the InfoBadge change at the moment. Now, users can use both and we can deprecate BadgeVisibility and BadgeValue in later releases.
@morning4coffe-dev morning4coffe-dev marked this pull request as ready for review June 3, 2024 07:49
@morning4coffe-dev morning4coffe-dev marked this pull request as draft June 12, 2024 14:08
@morning4coffe-dev
Copy link
Member Author

@MartinZikmund @agneszitte @kazo0 Can we merge this now? The InfoBadge alignment issues on are now fixed with Skia and WASM is off only very slightly and it's not much noticable.

@@ -29,26 +28,68 @@ partial class TabBarItem
DependencyProperty.Register(nameof(Icon), typeof(IconElement), typeof(TabBarItem), new PropertyMetadata(null, OnPropertyChanged));
#endregion

// UNO TODO: Deprecate and remove BadgeVisibility and BadgeValue properties and use InfoBadge instead
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have an issue to track in Toolkit to do this for the next major version bump?

Do we have docs written in the migration section for this deprecation or recommendation to use InfoBadge explicitly?

Copy link
Member Author

@morning4coffe-dev morning4coffe-dev Jul 12, 2024

Choose a reason for hiding this comment

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

Thanks @kazo0, I will take a look 👍

Comment on lines +11 to +25
<StaticResource x:Key="MaterialInfoBadgeBottomTabBarItemBackground"
ResourceKey="ErrorBrush" />
<StaticResource x:Key="MaterialInfoBadgeBottomTabBarItemForeground"
ResourceKey="OnErrorBrush" />

<!-- Small InfoBadge-->
<x:Double x:Key="MaterialSmallInfoBadgeBottomTabBarItemHeight">6</x:Double>
<x:Double x:Key="MaterialSmallInfoBadgeBottomTabBarItemWidth">6</x:Double>
<Thickness x:Key="MaterialSmallInfoBadgeBottomTabBarItemMargin">0,4,20,0</Thickness>


<!-- Large InfoBadge-->
<x:Double x:Key="MaterialLargeInfoBadgeBottomTabBarItemHeight">16</x:Double>
<Thickness x:Key="MaterialLargeInfoBadgeBottomTabBarItemMargin">32,4,0,0</Thickness>
<CornerRadius x:Key="MaterialLargeInfoBadgeBottomTabBarItemCornerRadius">8</CornerRadius>
Copy link
Contributor

Choose a reason for hiding this comment

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

These need to be inside of ThemeDictionaries to be able to be overridden via lightweight styling

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

Successfully merging this pull request may close these issues.

[TabBar] Use InfoBadge for TabBarItem badge support
4 participants