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

feat: add theme feature on Linux, closes #387 #468

Merged
merged 1 commit into from
Jul 10, 2022
Merged

Conversation

keiya01
Copy link
Member

@keiya01 keiya01 commented Jul 8, 2022

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

Currently GTK does not support theme changed event...

@keiya01 keiya01 requested a review from a team as a code owner July 8, 2022 16:37
@keiya01 keiya01 linked an issue Jul 8, 2022 that may be closed by this pull request
@keiya01 keiya01 force-pushed the feat/impl-theme-linux branch 3 times, most recently from 01b3441 to ae69888 Compare July 9, 2022 00:45
@keiya01 keiya01 force-pushed the feat/impl-theme-linux branch from ae69888 to 0447edf Compare July 9, 2022 01:12
@keiya01 keiya01 merged commit 74425e8 into dev Jul 10, 2022
@keiya01 keiya01 deleted the feat/impl-theme-linux branch July 10, 2022 12:55
@github-actions github-actions bot mentioned this pull request Jul 10, 2022
if let Some(theme) = theme_name {
// Currently GTK doesn't provide feature for detect theme, so we need to check theme manually.
// ref: https://github.com/WebKit/WebKit/blob/e44ffaa0d999a9807f76f1805943eea204cfdfbc/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp#L587
if theme.ends_with("-dark") || theme.ends_with("-Dark") {
Copy link
Member

Choose a reason for hiding this comment

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

I use Arc-Darker theme :( really sucks having to detect the theme this way @keiya01 @wusyong

Copy link
Member

@amrbashir amrbashir Aug 2, 2022

Choose a reason for hiding this comment

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

probably should be

Suggested change
if theme.ends_with("-dark") || theme.ends_with("-Dark") {
if theme.contains("-dark") || theme.contains("-Dark") {

Copy link
Member Author

Choose a reason for hiding this comment

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

Darker ... I see. I will fix this issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lucasfernog
I created the PR. Could you check it when you have time?
#511

@keiya01 keiya01 mentioned this pull request Aug 3, 2022
13 tasks
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.

[feat] Read dark/light theme on MacOS and Linux
4 participants