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 gnome-shell 42 and Libadwaita #54

Merged
merged 4 commits into from
Apr 6, 2022

Conversation

fjsevilla-dev
Copy link
Collaborator

This PR should provide support for Gnome 42, while implementing the use of Libadwaita widgets for this version and maintaining backwards compatibility with previous versions. I've tested it on Gnome 41 and 42 and there don't seem to be any problems.

Some notes:

  • The change would only affect the preferences window .

  • I've been hesitating quite a bit about how to implement it, in the end I've simply opted to isolate both implementations, leaving the pre-42 code intact (So all the previous prefs.js code, minus the necessary imports, could be removed and the extension would work without problems in Gnome 42).
    This results in some more code, but no more conditionals added to the previous code, which I think can be confusing (especially when using different widgets in the new version). This also makes it easier to maintain. However, there are more ways to implement this, it is not necessarily the best one.

  • The current implementation is quite simple, I use three classes that, basically, the main thing they do is allow the definition of two properties to bind the widgets with their respective GSettings keys. In addition, the fillPreferencesWindow function is added, which in Gnome 42 takes precedence over buildPrefsWidget, allowing backwards compatibility.

  • I just realized that EsLint is angry with me because I use spread syntax (...) in class constructors :( It could be resolved by moving from 2017 ECMA version (which now uses the linter) to 2018, but I don't know if this can be a problem...

Just as a note, originally it used composite templates (.ui files) but since the extension doesn't make use of them and the interface is relatively simple, I've dropped it. However, the window can be fully defined in a .ui file if desired, including assigning its respective key in GSettings. I don't think it has much importance, but if it turns out to be convenient in the future, the possibility exists.

Resolves #52, resolves #53

@fjsevilla-dev
Copy link
Collaborator Author

Hi @gicmo, I have made this PR based on your comment in #53. I'm aware that I have basically rewritten everything for the new version 😳, so feel completely free to comment on anything that you think is wrong, that could be improved or that you would simply like differently in the implementation, in the code style, variable/class/property names, visual appearance or any other aspect.

@fjsevilla-dev fjsevilla-dev marked this pull request as ready for review April 5, 2022 13:39
@gicmo
Copy link
Owner

gicmo commented Apr 6, 2022

Love this!

1 similar comment
@gicmo
Copy link
Owner

gicmo commented Apr 6, 2022

Love this!

Copy link
Owner

@gicmo gicmo left a comment

Choose a reason for hiding this comment

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

🙇

@gicmo gicmo merged commit d777753 into gicmo:master Apr 6, 2022
@mhalano
Copy link

mhalano commented Apr 6, 2022

@gicmo Do you have a release date for the newer version with this change? I ask that because I'm already using Ubuntu 22.04 which comes with GNOME 42. 😸

@gicmo
Copy link
Owner

gicmo commented Apr 6, 2022

@mhalano let me try to find some free time this week.

@gicmo gicmo mentioned this pull request Apr 7, 2022
@highvoltage
Copy link

Could you tag a new release too? thanks for all your work!

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.

Adopt libadwaita in gnome-shell 42? gnome 42 support?
4 participants