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

WIP: Adapt to yaru.dart changes #324

Merged
merged 10 commits into from
May 5, 2022
Merged

WIP: Adapt to yaru.dart changes #324

merged 10 commits into from
May 5, 2022

Conversation

Feichtmeier
Copy link
Member

No description provided.

lib/view/app_theme.dart Outdated Show resolved Hide resolved
lib/app.dart Outdated Show resolved Hide resolved
lib/app.dart Show resolved Hide resolved
@jpnurmi
Copy link
Contributor

jpnurmi commented May 4, 2022

This branch seems to work fine in its current state, without any modifications, when running with a self-built version of Flutter that has theme detection fixed (flutter/engine#33100).

yaru_changes.mp4

EDIT: Oops, the mouse cursor is missing. Just imagine that I'm moving the mouse back and forth between the apps and changing themes from both apps.

@jpnurmi
Copy link
Contributor

jpnurmi commented May 4, 2022

I pushed a change to restore context.watch<ThemeMode>() and pass it to YaruTheme. This is a workaround required until Flutter reports the correct theme.

@Feichtmeier
Copy link
Member Author

nice works!
only nitpick is that it switches back to orange when you toggle the dark theme but only after the launch.

@jpnurmi
Copy link
Contributor

jpnurmi commented May 5, 2022

Maybe it's better to take a step back and only adapt to the YaruColors.xxx changes at this point?

@Feichtmeier
Copy link
Member Author

Feichtmeier commented May 5, 2022

Now that I know of the super nice trick.... here is a screen recording 👯
https://user-images.githubusercontent.com/15329494/166871693-06c14995-f1c6-4d0a-93c3-d348d11272b8.mp4

The only bit left is dark mode listening. Everything else works in both directions. Dark mode only from the inside of the app

@Feichtmeier
Copy link
Member Author

Maybe it's better to take a step back and only adapt to the YaruColors.xxx changes at this point?

I don't know. After your changes there is no regression. Only a positive addition which is the color listening from inside the app to gnome. However I would also not recommend this whole procedure to somehow who is not involved in the situation currently

@jpnurmi
Copy link
Contributor

jpnurmi commented May 5, 2022

As said, platform brightness detection is being fixed in the Flutter engine. I'm hesitant to start building a workaround for that because flutter/engine#33100 is already being reviewed and is expected to land soon.

Notice that the transition to YaruTheme for the settings app that has built its own mechanism for runtime theme updates and at the same time messes with theme-related system settings is a lot more complicated than for an average app.

Normally, all it takes is to replace

theme: yaruLight
darkTheme: yaruDark

with

YaruTheme(child: ...)

@Feichtmeier
Copy link
Member Author

As said, platform brightness detection is being fixed in the Flutter engine. I'm hesitant to start building a workaround for that because flutter/engine#33100 is already being reviewed and is expected to land soon.

I totally agree. So I think this is good to go if you agree? 😸

@jpnurmi
Copy link
Contributor

jpnurmi commented May 5, 2022

Apply only minimal YaruColors changes if you prefer that things continue working the same they do today.

Go with this if you want to adapt to use YaruTheme as well, which is an optional step and does not work 100% until flutter/engine#33100 has reached Flutter stable.

@Feichtmeier
Copy link
Member Author

Well. this branch already has more features (listening to color changes from outside) than master. So I prefer this approach. :) This is still alpha software so I think it's great :) Thank you for the help

@Feichtmeier Feichtmeier marked this pull request as ready for review May 5, 2022 07:23
@Feichtmeier Feichtmeier merged commit 4cb86b3 into master May 5, 2022
@Feichtmeier Feichtmeier deleted the yaru_changes branch February 26, 2024 15:12
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.

3 participants