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

[Windows] Fix issues setting Shell TabBar appearance #15690

Merged
merged 6 commits into from
Jun 19, 2023
Merged

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jun 15, 2023

Description of Change

Windows portion of the following PR
#15447

Priority of how the colors are applied.

The APIs available to us are fairly limiting in scope. Ideally, we would make this all work through the VSM and just use two APIs (IconColor/TitleColor) but for now we are just making these APIs consistent between the platforms.

The three properties users have to influence the TabItem coloring are: TabBarUnselectedColor, TabBarTitleColor, and TabBarForegroundColor

  • If the user only sets Shell.TabBarTitleColor that will color the Title and Icon of the selected item. I realize this is a bit weird for TitleColor to change Icon color but this is currently how Android works and it's not really worth breaking this until we just introduce new APIs.
  • If Shell.TabBarTitleColor is not set then the TitleColor will match the TabBarForegroundColor
  • If TabBarForegroundColor is set and TabBarUnselectedColor isn't set then TabBarForegroundColor will be the color used for the text/icon of the selected TabItem
  • If TabBarUnselectedColor is the only thing set then that will be used for the text/icon color on the unselected Tab Item.

Examples

  • TabBarTitleColor: Green
    • Selected Icon is Green, Selected Text is Green, Unselected item matches system colors
  • TabBarForegroundColor: Blue
  • Selected Icon is Blue, Selected Text is Blue, Unselected item matches system colors
  • TabBarForegroundColor: Blue, TabBarTitleColor: Green
  • Selected Icon is Blue, Selected Text is Green, Unselected item matches system colors
  • Shell.ForegroundColor: Blue, TabBarTitleColor: Green (ForegroundColor propagates to TabBarForegroundColor).
  • Selected Icon is Blue, Selected Text is Green, Unselected item matches system colors
  • TabBarForegroundColor: Blue, TabBarTitleColor: Green, TabBarUnselectedColor: Pink
  • Selected Icon is Blue, Selected Text is Green, Unselected text and Icon is Pink

Breaking changes

  • TabbedPage.UnselectedColor and TabbedPage.SelectedColor used to set the color of the tab background but now they just set the color of the text to stay consistent with android/ios
    • users can call UpdateTopNavigationViewItemBackgroundUnselectedColor and UpdateTopNavigationViewItemBackgroundSelectedColor if they want to set the background colors on the tabs

Issues Fixed

Fixes #12386
Fixes #6929

Video

ShellTabBarColors.mp4

@jsuarezruiz jsuarezruiz added platform/windows 🪟 area-controls-shell Shell Navigation, Routes, Tabs, Flyout labels Jun 16, 2023
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@PureWeen PureWeen merged commit 503b534 into main Jun 19, 2023
@PureWeen PureWeen deleted the fix-12386-windows branch June 19, 2023 13:43
@samhouts samhouts added the backport/NO This change should not be backported. It may break customers. label Aug 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.6.8686 Look for this fix in 8.0.0-preview.6.8686! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout backport/NO This change should not be backported. It may break customers. fixed-in-8.0.0-preview.6.8686 Look for this fix in 8.0.0-preview.6.8686! needs-breaking-change-doc-created platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TabBar / Tab colours not working correctly on Windows Shell on Windows: Tabbar redraw problems
3 participants