44 Commits

Author SHA1 Message Date
Florian Müllner
ac937b9549 user-theme: Make rows non-selectable
A row has to be activated to select a theme, not merely selected.
The selection therefore doesn't do anything, so disable it.
2020-04-29 21:44:13 +02:00
Florian Müllner
5b2bdd138a user-themes: Support session mode styles
Session mode stylesheets are installed in gnome-shell's theme
directory instead of a subdirectory of the global themes direc-
tory.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/118
2020-04-17 16:33:03 +00:00
Florian Müllner
739b1e11a0 user-themes: Add preference widget
While we don't endorse or support 3rd party theming, the extension
exists and is actively used. However right now the most convenient
way of setting it up is by installing Tweak Tool; give users an
alternative by providing a simple settings dialog ourselves.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/117
2020-04-12 04:13:25 +02:00
Florian Müllner
eb79f5b512 cleanup: Require "dangling" commas
Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
2db4589dea cleanup: Re-order imports
They should be grouped between external (GI/gjs) and shell and in
alphabetical order. Until commit bab4be1a ExtensionUtils was special
as it was required for some imports, but that's no longer the case
for most extensions.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/76
2019-06-28 21:51:38 +02:00
Florian Müllner
a26380d56e user-theme: Clarify some code
Commit 2582ab accidentally pointed out that the current theme loading code
obfuscates which directories are searched for themes. Rewrite it with modern
JS features to make it more obvious.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/60
2019-03-04 19:35:18 +01:00
Florian Müllner
ab334d95e0 Revert "User theme: compatibility with XDG Base Directory"
We already handled themes in XDG_DATA_HOME before commit 2582ab
by prepending it to the system dirs.

This reverts commit 2582ab4fd0.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/60
2019-03-04 19:35:10 +01:00
Tomasz Gąsior
2582ab4fd0 User theme: compatibility with XDG Base Directory
See https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/55
2019-02-20 01:15:49 +01:00
Florian Müllner
0d41643866 cleanup: Use destructuring for imports from GI
This is *much* nicer than repetitive "imports.gi" lines ...

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/54
2019-02-16 00:49:44 +01:00
Florian Müllner
bab4be1a59 extensions: Drop Convenience library
Its methods are now provided by gnome-shell itself and can be used
as an easy drop-in replacement.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/44
2019-02-06 20:17:59 +01:00
Florian Müllner
3861ffae31 extensions: Mark exported symbols
eslint obviously doesn't know about gnome-shell's extension API, so
the various entry points trigger unused-variable errors. To fix,
explicitly mark those symbols as exported.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50
2019-01-28 06:51:20 +01:00
Florian Müllner
8a2b9abc09 style: Stop using string concatenation
String concatenation is considered bad style after ES6 added
template strings. The latter is the replacement we generally
want, except where the aforementioned xgettext bug would trip
over the backtick/slash combination.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
f75d1d75af style: Fix stray/missing semi-colons
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
194e294d2c user-theme: Don't use concatenation to build filenames
Since template strings were added in ES6, string concatenation is
considered bad style. There's a catch though: xgettext currently
has a nasty bug concerning the combination of backticks and slashes.
Avoid that issue by building filenames with the corresponding GLib
helper function.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49
2019-01-28 06:37:28 +01:00
Florian Müllner
ba27cc4a64 cleanup: Get rid of Lang.bind()
After replacing Lang.Class with ES6 classes and adopting arrow notation
for anonymous callbacks, we only use the Lang module to bind `this` to
named callbacks. However since ES5, this functionality is already provided
by Function.prototype.bind() - in fact, Lang.bind() itself uses it when
no extra arguments are specified.

So just use the built-in function directly instead of the wrapper.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:52 +01:00
Florian Müllner
48399d46c0 cleanup: Port non-GObject classes to ES6 classes
ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:46 +01:00
Florian Müllner
30e7ff5a8f cleanup: Use method syntax
Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for porting to ES6 classes.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/30
2017-12-01 20:50:28 +01:00
Florian Müllner
ba38019049 build: Remove autotools support
Complete the switch to meson and drop autotools support ...

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31
2017-12-01 17:43:21 +01:00
Florian Müllner
3ab01aebec build: Support the meson build system
Meson is on track to replace autotools as the build system of choice,
so support it in addition to autotools.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/31
2017-12-01 17:41:04 +01:00
Florian Müllner
db3e910b76 build: Say good-bye to intltool
intltool is unmaintained nowadays while upstream gettext gained
support for everything we used it for, so make the switch.

https://bugzilla.gnome.org/show_bug.cgi?id=769077
2016-08-19 22:17:07 +02:00
Florian Müllner
8c6644f1be Revert "user-theme: Temporarily work around a gnome-shell regression"
The issue has been fixed in gnome-shell master, so we can revert the
workaround.
2014-11-27 14:49:43 +00:00
Florian Müllner
dd3c7ca199 user-theme: Temporarily work around a gnome-shell regression
setThemeStylesheet() stopped accepting %null to revert to the default
stylesheet. The issue is fixed in gnome-shell master, but work around
it for 3.15.2 to not ship broken (again).
2014-11-27 14:42:01 +00:00
Giovanni Campagna
ae9df9f001 user-theme: look for gnome-shell themes in ~/.local/share too
Just like we look in XDG_DATA_DIRS, we should honor XDG_DATA_HOME
as well.
For compatibility reasons, we look in ~/.themes first, then ~/.local/share,
then /usr/share.
2013-07-14 15:19:14 +02:00
Giovanni Campagna
274a6f040c Update descriptions of extensions
Mark classic mode extensions as such, so bug reports don't go
lost in my inbox.
2013-05-20 19:06:59 +02:00
Giovanni Campagna
9b6374881d all: port to the new class framework
A long due update, since this was merged in gjs and core shell.
We no longer need to mess with __proto__ and prototype, and can
use decent syntax for true object oriented programming.
(This affects all except xrandr-indicator, since I want to port
that to GDBus too, using the new bindings right from the start)
2012-02-10 15:16:46 +01:00
Giovanni Campagna
3630228cac all: port to the new convienence module
Retrieve Convenience from the extension helper object (Me), and
pass no arguments to initTranslations and getSettings (since the
metadata has all that is required)
2012-02-09 18:43:28 +01:00
Giovanni Campagna
9ebfd1f495 build system: factor out setting schema generation
Introduce a common settings.mk file, which is included in extensions
that need GSettings, to ensure that conventions are respected, and
necessary fixes can be applied from one place.
2012-02-08 18:01:00 +01:00
Giovanni Campagna
dfca68062c build system: add additional automatic metadata
Add "gettext-domain", "extension-id" (containing the base part of the
UUID) and "gschemabase" (which, combined with "extension-id", gives
the GSettings schema) to metadata.json, autogenerated by the build
system.
2012-02-08 18:00:56 +01:00
Giovanni Campagna
c49c20fe38 user-theme: fix enable after disable
In disable(), _settings was cleared, despite being created in
init(), therefore a subsequent enable() would find it null.
2012-01-11 17:41:28 +01:00
Giovanni Campagna
7a6777f703 Remove all references to localedir from metadata.json
It is not used anymore, now that translations are bundled with
the extension. Also, in the zip files it ended up with my home
folder, which is not nice.
2011-11-20 00:40:20 +01:00
Giovanni Campagna
c5d79240fd Introduce a convenience module for initialization
Common code for retrieving translations and GSettings schemas has
been factored out into lib/convenience.js, which is part of
every extension installation.
Since that code relies on renames done at zip file creation time,
extensions can no longer be installed with "make install". Instead,
one should create the zip file and install it with the tweak-tool.
There is also a bash script, local-install.sh, that will install
everything in zip-files.
Also, since the GSettingsSchemaSource code is not yet in a stable
GLib release, extensions using GSettings have seen their stable
shell version removed.
2011-11-19 16:54:20 +01:00
Giovanni Campagna
9e4156a706 Add capability to build extension zip-files
Now, typing "make zip-file" will create a standard zip-file for each
extension, with everything necessary, including translations and GSettings schemas.
These files can then be installed with the tweak-tool or uploaded
at extensions.gnome.org

Based on an earlier patch by Jasper St. Pierre.
2011-11-19 15:42:27 +01:00
Giovanni Campagna
00bb650c6c Add 3.2 tags to supported version
This is the stable release, so we support all of GNOME Shell
stable cycle without updates.
(As said earlier, dock and alternate-tab have issues, so they're
not marked 3.2 but just 3.2.0)
2011-10-03 17:33:28 +01:00
Giovanni Campagna
1eb245c514 user-theme: port to new extension API
main() has been	replaced by init(), enable() and disable()
2011-08-02 23:35:37 +02:00
malcolmlewis
048e29f3ed Fix zero-length warning for stylesheets
rpmlint emits a warning if you install a zero-lenght file. Fix that
by adding a comment in each empty file.

Signed-off-by: malcolmlewis <malcolmlewis@opensuse.org>

https://bugzilla.gnome.org/show_bug.cgi?id=654274
2011-07-09 15:06:01 +02:00
Giovanni Campagna
47b478df60 Revert "Add 3.0 to user-theme"
This reverts commit 60bc404d95.

master branch is for master gnome-shell, which is 3.0.1 and unstable.
gnome-3-0 branch is for stable shell, and has 3.0 for everything
which is supported by shell developers.
Next time, please ask me before committing.
2011-05-31 20:25:19 +02:00
John Stowers
60bc404d95 Add 3.0 to user-theme 2011-05-31 14:10:11 +12:00
Martin Dengler
72583b1bf6 fix undeclared file variable in user-theme/extension.js
Eliminates the warning message about assigning to an undeclared
variable when User Theme extension is used. Fixes BZ #651374.
2011-05-31 14:09:16 +12:00
Elad Alfassa
268fd462ac Support globally installed themes
If a theme cannot be found in the user directory, try in system
data dirs (XDG_DATA_DIRS, usually /usr/share and /usr/local/share)

Signed-off-by: Giovanni Campagna <gcampagna@src.gnome.org>
2011-05-02 18:31:19 +02:00
Giovanni Campagna
d942e255f7 user-theme: fix resetting theme to null
Previously null stylesheets were ignored, making it impossible to
reset the default. We still need to filter out invalid (non existing)
stylesheets, as no check is performed by shell code.
2011-05-02 18:07:39 +02:00
Giovanni Campagna
0ce994ba46 Revert "Mark extensions that require only public API"
This reverts commit 6cd9530862, and
reopens development againts GNOME Shell master. Time for 3.2!
2011-04-26 01:17:23 +02:00
Giovanni Campagna
6cd9530862 Mark extensions that require only public API
Extensions that use public Shell API are expected to work for all
stable 3.0 releases, so we skip setting the minor version. (This
means that they'll work in 3.0.0 and 3.0.1 without rebuilding).
Notably absent are auto-move-windows and windowsNavigator, that
hook deep into Shell code and could be broken by next minor release.
2011-04-05 16:42:48 +02:00
Giovanni Campagna
a4d7a4eba4 User Themes: don't load a null stylesheet
If the stylesheet is not set, or it cannot be found, don't try to
load it.
2011-03-19 18:21:27 +01:00
John Stowers
27a1714f37 Add user-theme extension
https://bugzilla.gnome.org/show_bug.cgi?id=644271
2011-03-11 13:12:27 +13:00