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

Launcher: Add iconsize setting #190

Merged
merged 6 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions data/Launcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ launcher {
padding: 6px;
}

launcher image {
-gtk-icon-size: 48px;
}

.bounce {
animation: bounce 200ms cubic-bezier(0.4, 0, 0.2, 1) infinite;
animation-direction: alternate;
Expand Down
6 changes: 6 additions & 0 deletions data/dock.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema path="/io/elementary/dock/" id="io.elementary.dock">
<key type="i" name="icon-size">
<default>48</default>
<summary>Logical pixel size of app launcher icons</summary>
<description>Logical pixel size of app launcher icons</description>
</key>

<key type="as" name="launchers">
<default>['gala-multitaskingview.desktop', 'org.gnome.Epiphany.desktop', 'io.elementary.mail.desktop', 'io.elementary.tasks.desktop', 'io.elementary.calendar.desktop', 'io.elementary.music.desktop', 'io.elementary.videos.desktop', 'io.elementary.photos.desktop', 'io.elementary.switchboard.desktop', 'io.elementary.appcenter.desktop']</default>
<summary>An ordered array of app id's to show as launchers</summary>
Expand Down
5 changes: 5 additions & 0 deletions src/Launcher.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Dock.Launcher : Gtk.Button {

public GLib.List<AppWindow> windows { get; private owned set; }

private static Settings settings;
private static Gtk.CssProvider css_provider;

private Gtk.Image image;
Expand All @@ -34,6 +35,8 @@ public class Dock.Launcher : Gtk.Button {
static construct {
css_provider = new Gtk.CssProvider ();
css_provider.load_from_resource ("/io/elementary/dock/Launcher.css");

settings = new Settings ("io.elementary.dock");
}

construct {
Expand Down Expand Up @@ -103,6 +106,8 @@ public class Dock.Launcher : Gtk.Button {
gesture_click.released.connect (popover.popup);

clicked.connect (() => launch ());

settings.bind ("icon-size", image, "pixel-size", DEFAULT);
}

~Launcher () {
Expand Down