Update: Improve drag handle styling by using GNOME Settings style

This also finally makes the style `<class name="drag-handle"/>` in
`prefs-box-order-item-row.ui` actually do something.
This commit is contained in:
Julian 2023-04-20 12:33:30 +02:00
parent fa379607ee
commit 5c8523322b
Signed by: julian
GPG Key ID: 094C2AC34192FA11
3 changed files with 21 additions and 0 deletions

9
data/css/prefs.css Normal file
View File

@ -0,0 +1,9 @@
/* Taken from: https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/43.5/shell/style.css */
.drag-handle {
color: alpha(@theme_fg_color, 0.4);
}
.drag-handle:backdrop {
color: alpha(@theme_unfocused_fg_color, 0.4);
}

View File

@ -9,4 +9,5 @@ gnome-extensions pack "$REAL_BASE_DIR/src" \
--extra-source extensionModules \ --extra-source extensionModules \
--extra-source prefsModules \ --extra-source prefsModules \
--extra-source ../data/ui \ --extra-source ../data/ui \
--extra-source ../data/css \
--schema ../data/org.gnome.shell.extensions.top-bar-organizer.gschema.xml --schema ../data/org.gnome.shell.extensions.top-bar-organizer.gschema.xml

View File

@ -1,11 +1,22 @@
"use strict"; "use strict";
/* exported buildPrefsWidget, init */ /* exported buildPrefsWidget, init */
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
const ExtensionUtils = imports.misc.extensionUtils; const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension(); const Me = ExtensionUtils.getCurrentExtension();
const PrefsPage = Me.imports.prefsModules.PrefsPage; const PrefsPage = Me.imports.prefsModules.PrefsPage;
const provider = new Gtk.CssProvider();
provider.load_from_path(Me.dir.get_path() + "/css/prefs.css");
Gtk.StyleContext.add_provider_for_display(
Gdk.Display.get_default(),
provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
);
function buildPrefsWidget() { function buildPrefsWidget() {
return new PrefsPage.PrefsPage(); return new PrefsPage.PrefsPage();
} }