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

Add support for high contrast theme #682

Merged
merged 7 commits into from
Mar 24, 2023
Merged

Conversation

d-loose
Copy link
Member

@d-loose d-loose commented Mar 23, 2023

Adds high contrast borders to

  • YaruTitleBar
  • YaruWindowControl
  • YaruMasterTile

image

@d-loose d-loose marked this pull request as ready for review March 23, 2023 16:59
@d-loose d-loose changed the title WIP: Add support for high contrast theme Add support for high contrast theme Mar 23, 2023
Copy link
Member

@Jupi007 Jupi007 left a comment

Choose a reason for hiding this comment

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

Great, thanks @d-loose

LGTM 👍

@jpnurmi
Copy link
Member

jpnurmi commented Mar 23, 2023

Thanks, @d-loose! Any concerns with this approach @Feichtmeier and @Jupi007? Unlike my earlier attempt with "barely noticeable" borders, this keeps the normal themes untouched.

Copy link
Member

@Feichtmeier Feichtmeier left a comment

Choose a reason for hiding this comment

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

Since it doesn't affect the normal themes it's ok

@Jupi007
Copy link
Member

Jupi007 commented Mar 23, 2023

I just have one note: is adding a border change the size of the window controls?

@Feichtmeier
Copy link
Member

I just have one note: is adding a border change the size of the window controls?

that would be bad 🤔

@d-loose
Copy link
Member Author

d-loose commented Mar 23, 2023

I just have one note: is adding a border change the size of the window controls?

Hm, unfortunately it does:
(upper is gnome-settings, lower is yaru_widgets example)

Normal High Contrast
image image

I'll look into a cleaner solution tomorrow!

@jpnurmi
Copy link
Member

jpnurmi commented Mar 23, 2023

@Jupi007 good catch!

@Jupi007
Copy link
Member

Jupi007 commented Mar 23, 2023

Well, this need to be fixed as it can create unexpected situations :)

I see two solution:

  • reduce the control size in HC mode ;
  • or use a border of the same colour as the background in non-HC mode (be careful to the colour transition).

Edit: I suppose there is the same problem with YaruMasterTile.

@Feichtmeier
Copy link
Member

Feichtmeier commented Mar 23, 2023

There is one more option: just make the windoh window controls black/white and the icons on them white/black 🤷

@d-loose
Copy link
Member Author

d-loose commented Mar 24, 2023

Learned about strokeAlign :)

Dark Light
Normal image image
High Contrast image image

Copy link
Member

@Jupi007 Jupi007 left a comment

Choose a reason for hiding this comment

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

Great, thanks @d-loose

I didn't know this strokeAlign property

Copy link
Member

@Feichtmeier Feichtmeier left a comment

Choose a reason for hiding this comment

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

Bildschirmaufzeichnung.vom.24.03.2023.11.00.04.webm

can't see any visual regression

@d-loose d-loose merged commit fc99c7b into ubuntu:main Mar 24, 2023
@d-loose d-loose deleted the high-contrast branch March 24, 2023 10:10
d-loose added a commit to d-loose/yaru.dart that referenced this pull request Mar 24, 2023
* bump yaru version

* YaruTitleBar: add high contrast border

* YaruWindowControl: add high contrast border

* YaruMasterTile: add high contrast border

* example: enable high contrast themes

* fix border alignment

* use named constants for `strokeAlign`
@jpnurmi jpnurmi mentioned this pull request Mar 28, 2023
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.

None yet

4 participants