-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
Updated the ECMA version to 2018
Removed Lang import (unused and deprecated)
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. |
Love this! |
1 similar comment
Love this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇
@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. 😸 |
@mhalano let me try to find some free time this week. |
Could you tag a new release too? thanks for all your work! |
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 overbuildPrefsWidget
, 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