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

Fixed interaction with custom shell themes #271

Merged
merged 3 commits into from
May 7, 2020

Conversation

jambonmcyeah
Copy link
Contributor

@jambonmcyeah jambonmcyeah commented May 4, 2020

Combines my previous PR #269 with @scaryrawr 's PR #270

The reason for this is addressed in the comments on the comments in #270

Closes #231, Closes #230

@@ -29,7 +29,7 @@ export class Search {
) {
this.select_cb = select;
this.dialog = new ModalDialog({
styleClass: "pop-shell-search",
styleClass: "pop-shell-search modal-dialog",
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that we're using existing classes where they make sense here.

src/search.ts Outdated
@@ -170,13 +182,13 @@ export class Search {

let label = new St.Label({
text: title,
styleClass: "pop-shell-search-label",
styleClass: "pop-shell-search-label list-search-result-title",
Copy link
Contributor

Choose a reason for hiding this comment

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

Here (and the next one) also show good use of existing, supported style classes.

src/extension.ts Outdated Show resolved Hide resolved
@isantop
Copy link
Contributor

isantop commented May 5, 2020

Pushed a copy of this branch into our repo for building/CI purposes. Please merge this PR instead of that one.

@isantop isantop self-requested a review May 5, 2020 14:15
src/search.ts Outdated Show resolved Hide resolved
@jambonmcyeah
Copy link
Contributor Author

jambonmcyeah commented May 5, 2020

@isantop Completed all your requests

@jambonmcyeah jambonmcyeah requested review from isantop and removed request for a team May 5, 2020 18:41
@isantop isantop requested a review from a team May 5, 2020 18:43
src/search.ts Outdated
y_align: Clutter.ActorAlign.CENTER
});

label.clutter_text.set_ellipsize(Pango.EllipsizeMode.END);

let container = new widgets.Box({ styleClass: "pop-shell-search-element" })
let container = new widgets.Box({ styleClass: "pop-shell-search-element list-search-result" })
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks better in Pop and Adwaita, but in many themes it causes the text to become unreadable. I think the existing styling present for these widgets was fairly theme-agnostic and resulted in guaranteed-readable text.

@jambonmcyeah jambonmcyeah force-pushed the shell-theme-fix branch 2 times, most recently from ab56749 to a232e6d Compare May 5, 2020 21:33
@jambonmcyeah
Copy link
Contributor Author

jambonmcyeah commented May 5, 2020

I addressed all your requests. While fixing the issues I noticed a bug with stylesheets only loading when the extension is initially loaded and fixed it. Also added detection for shell theme changes instead of relying on gtk theme changes, since they can be changed separately.

@jambonmcyeah
Copy link
Contributor Author

jambonmcyeah commented May 5, 2020

There's an issue with using custom styling, which is themes that style the shell widgets dark even on light variants (Adwaita, Adapta, Plata, Ant-Dracula, etc.) don't work well. I removed the color in the css to make them work better, however it still doesn't work great. This is why I originally set the class of the search elements to button to get around this issue.

@jambonmcyeah jambonmcyeah requested review from isantop and removed request for a team May 5, 2020 21:43
scaryrawr and others added 2 commits May 5, 2020 17:53
When using `loadTheme` it merges the default GNOME theme with the style sheet passed into `setThemeStylesheet`. This change instead uses the existing theme and loads the pop style sheet on top of it (if a previous theme exists).

Co-authored-by: Jun Bo Bi <jambonmcyeah@gmail.com>
@jambonmcyeah
Copy link
Contributor Author

jambonmcyeah commented May 6, 2020

The real solution to this problem is to implement search items using St.Button which is the implementation in gnome-shell, instead of detecting arrow keys manually and faking focus. A proper implementation would enable mouse support and be compatible with custom themes. Yet I don't have nearly enough expertise on gtk and gnome to implement this properly, so I guess we have to live with this imperfect solution for now.

@isantop
Copy link
Contributor

isantop commented May 6, 2020

@mmstick Some notes about the implementation of the Launcher we might consider ☝️

@isantop
Copy link
Contributor

isantop commented May 6, 2020

@jambonmcyeah Can you post a screenshot of the issues you are seeing with the stock styling? I worked pretty hard to try and get the styling to be fairly theme-neutral while also looking good.

Copy link
Contributor

@isantop isantop left a comment

Choose a reason for hiding this comment

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

Using a dark theme, the current revision results in very poor contrast for the currently selected item. This affects Pop-Dark, Arc-Dark, Adwaita, Yaru-Dark, Materia-Dark, and Adapta-Nokto. There are likely others as well, but those are the ones I have handy for testing.

Screenshot from 2020-05-06 09-22-02

@jambonmcyeah jambonmcyeah force-pushed the shell-theme-fix branch 3 times, most recently from b6fab69 to fa89e55 Compare May 6, 2020 16:00
@jambonmcyeah
Copy link
Contributor Author

jambonmcyeah commented May 6, 2020

Should be fixed now, I tested all the themes you mentioned and some more and they all work fine
The original issue was that some themes style shell widgets dark even on light variants, I hard-coded most of those themes and it's fixed.
Peek 2020-05-06 12-18

@jambonmcyeah jambonmcyeah requested a review from isantop May 6, 2020 16:01
@jambonmcyeah jambonmcyeah force-pushed the shell-theme-fix branch 2 times, most recently from b815ab0 to 7854812 Compare May 6, 2020 16:05
- Launcher uses shell theme, not application theme
- Checking shell enables dark application theme with light shell theme

Co-authored-by: Jun Bo Bi <jambonmcyeah@gmail.com>
@mmstick mmstick changed the base branch from master_focal to dev_focal May 6, 2020 17:16
@mmstick mmstick force-pushed the dev_focal branch 2 times, most recently from c372d02 to 9d4271f Compare May 6, 2020 17:27
@isantop
Copy link
Contributor

isantop commented May 7, 2020

@pop-os/quality-assurance Testing branch for this is now jambonmcyeah-shell-theme-fix

@isantop isantop requested a review from a team May 7, 2020 15:14
Copy link
Contributor

@isantop isantop left a comment

Choose a reason for hiding this comment

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

Looks fine from my end.

Copy link
Member

@mmstick mmstick left a comment

Choose a reason for hiding this comment

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

I'll do some followup improvements to the code from here on. Thanks!

@mmstick mmstick merged commit 623a10f into pop-os:dev_focal May 7, 2020
mmstick pushed a commit that referenced this pull request May 7, 2020
Issue:

Pop Shell reverts the shell theme to the default shell theme on startup.

New Behavior:

Allow using custom themes with Pop Shell. Stop reverting custom themes back to the default theme. Fix all interactions with dark and light themes revolving around custom themes.

Origin: #271
Closes #230, Closes #231
mmstick pushed a commit that referenced this pull request May 7, 2020
Issue:

Pop Shell reverts the shell theme to the default shell theme on startup.

New Behavior:

Allow using custom themes with Pop Shell. Stop reverting custom themes back to the default theme. Fix all interactions with dark and light themes revolving around custom themes.

Origin: #271
Closes #230, Closes #231
mmstick pushed a commit that referenced this pull request May 7, 2020
Issue:

Pop Shell reverts the shell theme to the default shell theme on startup.

New Behavior:

Allow using custom themes with Pop Shell. Stop reverting custom themes back to the default theme. Fix all interactions with dark and light themes revolving around custom themes.

Origin: #271
Closes #230, Closes #231
mmstick pushed a commit that referenced this pull request May 7, 2020
Issue:

Pop Shell reverts the shell theme to the default shell theme on startup.

New Behavior:

Allow using custom themes with Pop Shell. Stop reverting custom themes back to the default theme. Fix all interactions with dark and light themes revolving around custom themes.

Origin: #271
Closes #230, Closes #231
@nicolae-stroncea
Copy link
Contributor

This also fixes #227 and #216

mmstick pushed a commit that referenced this pull request May 14, 2020
Issue:

Pop Shell reverts the shell theme to the default shell theme on startup.

New Behavior:

Allow using custom themes with Pop Shell. Stop reverting custom themes back to the default theme. Fix all interactions with dark and light themes revolving around custom themes.

Origin: #271
Closes #230, Closes #231
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.

Pop Shell does not respect shell theme choice Pop-Shell disrupts theme use
5 participants