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

Adjust colors based on window focus, like native apps #395

Open
GroovinChip opened this issue Mar 21, 2023 · 6 comments
Open

Adjust colors based on window focus, like native apps #395

GroovinChip opened this issue Mar 21, 2023 · 6 comments
Assignees
Labels
improvement Improvements to existing features

Comments

@GroovinChip
Copy link
Collaborator

Image

This will involve either using the desktop_lifecycle plugin or writing our own.

I've attempted this with desktop_lifecycle and it works quite well.

We'll need to add a dynamic color to MacosColors to represent inactive colors for the sidebar and toolbar (both use the same), and a style in MacosTypography that colors inactive text in the sidebar and toolbar. We'll also need inactive icon colors, and a utility to darken the primary color where appropriate.

We will need to determine whether to check if the window is active in each widget that needs to be adjusted, or do it top-level (like in MacosApp) and propagate the result of the check through the widget tree via MacosThemeData or another InheritedWidget.

@GroovinChip GroovinChip self-assigned this Mar 21, 2023
@GroovinChip GroovinChip added this to the Version 2.0 milestone Mar 21, 2023
@GroovinChip GroovinChip added the improvement Improvements to existing features label Mar 21, 2023
@Adrian-Samoticha
Copy link
Member

Adrian-Samoticha commented Mar 25, 2023

macos_window_utils’s NSWindowDelegate can also be used to detect window focus events and since we’ll already be depending on that, it might be a better idea to use that, instead (assuming cross-platform support isn’t targetted, of course).

EDIT: That said, macos_window_utils uses NSWindowDelegate while desktop_lifecycle uses NotificationCenter, so perhaps desktop_lifecycle might be a better choice compatibility-wise.

EDIT 2: Nevermind the first edit, we are already using NSWindowDelegate anyway because we need NSAppPresentationOptions, so the compatibility argument doesn’t actually hold.

@glanium
Copy link

glanium commented Mar 28, 2023

and Please add widgets equivalent to material InkWell Widget.

InkWell widget provides focus visual change and mouse hover effects.
Macos UI's ListTile can't get focus.
Material's ListTile is built on based on InkWell then can get focus.

Thx.

@GroovinChip
Copy link
Collaborator Author

and Please add widgets equivalent to material InkWell Widget.

InkWell widget provides focus visual change and mouse hover effects.

Macos UI's ListTile can't get focus.

Material's ListTile is built on based on InkWell then can get focus.

Thx.

Please file a new issue for this, as it is not connected to this.

@glanium
Copy link

glanium commented Mar 28, 2023

Ok
Done. #399
Thx.

@ralph-bergmann
Copy link

It works with the system's accent color:

SCR-20231207-meta SCR-20231207-mevn

@Adrian-Samoticha
Copy link
Member

It works with the system's accent color:

It works with widgets that have the accent color already implemented. Currently, that only includes the buttons and the sidebar items, once #484 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvements to existing features
Projects
Status: In Discovery
Development

No branches or pull requests

4 participants