Skip to content

ThemeSelector Update Phase2#418

Draft
rabbitism wants to merge 5 commits intomainfrom
theme
Draft

ThemeSelector Update Phase2#418
rabbitism wants to merge 5 commits intomainfrom
theme

Conversation

@rabbitism
Copy link
Copy Markdown
Member

@rabbitism rabbitism commented Sep 20, 2024

  1. ThemeSelector now has a new property: ThemeSource.
  2. ThemeToggleButton actually controls ThemeSource if it is not set.
  3. Instead of maintaining a nullable boolean as internal state, ThemeToggleButton now just looking for next Theme available in ThemeSource.
  4. ThemeToggleButton always respect RequestThemeVariant on initialized. if it is set.
  5. Introduce a new Control, ThemeSelector. It behaves like a combobox.

Further fix of #340

@rabbitism rabbitism requested a review from zdpcdt September 20, 2024 14:39
Comment thread demo/Ursa.Demo/App.axaml Outdated
Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
{
AvaloniaObject? result = TargetScope;
result ??= this.GetLogicalAncestors().OfType<ThemeVariantScope>().FirstOrDefault();
result ??= TargetScope;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the line duplicated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes its redundant.

@zdpcdt
Copy link
Copy Markdown
Collaborator

zdpcdt commented Sep 23, 2024

In Controller+ThreeState mode, if the system defaults to Dark theme, the toggle can switch between three states. If the system defaults to Light theme, the toggle can only switch between two states

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.

2 participants