From 44889b2c9b7ce7026b0f9c6294712afaf77fb7be Mon Sep 17 00:00:00 2001 From: elementaryBot Date: Mon, 7 Oct 2024 15:33:40 +0000 Subject: [PATCH 01/10] Update translation template --- po/extra/extra.pot | 10 +++++++++- po/io.elementary.dock.pot | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/po/extra/extra.pot b/po/extra/extra.pot index ea196ea8..3e844a64 100644 --- a/po/extra/extra.pot +++ b/po/extra/extra.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: extra\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-08 17:19+0000\n" +"POT-Creation-Date: 2024-10-07 15:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,5 +30,13 @@ msgid "elementary, Inc." msgstr "" #: data/dock.metainfo.xml.in:29 +msgid "Updated translations" +msgstr "" + +#: data/dock.metainfo.xml.in:30 +msgid "Fixes a crash when dragging a file that's not a launcher to the dock" +msgstr "" + +#: data/dock.metainfo.xml.in:39 msgid "Complete rewrite 🎉️" msgstr "" diff --git a/po/io.elementary.dock.pot b/po/io.elementary.dock.pot index c2b2fa38..66489b92 100644 --- a/po/io.elementary.dock.pot +++ b/po/io.elementary.dock.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: io.elementary.dock\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-08 17:19+0000\n" +"POT-Creation-Date: 2024-10-07 15:33+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From ba4cdb39ac445bdae1c01043439538520b1da2cc Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:42:07 +0200 Subject: [PATCH 02/10] Launcher: Hide indicators while moving (#271) --- data/dock.metainfo.xml.in | 1 + src/Launcher.vala | 45 ++++++++++++++++++++++++++++++++------- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/data/dock.metainfo.xml.in b/data/dock.metainfo.xml.in index 84385d62..2a27fd8b 100644 --- a/data/dock.metainfo.xml.in +++ b/data/dock.metainfo.xml.in @@ -28,6 +28,7 @@

Updated translations

Fixes a crash when dragging a file that's not a launcher to the dock

+

Hide badges, progressbars, and running indicators while dragging a launcher

Changing Dock size left the dock with extra empty space diff --git a/src/Launcher.vala b/src/Launcher.vala index 2e7b92cd..cfe87b7f 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -19,20 +19,33 @@ public class Dock.Launcher : Gtk.Box { public double current_pos { get; set; } + private bool _moving = false; public bool moving { + get { + return _moving; + } + set { + _moving = value; + if (value) { image.clear (); } else { image.gicon = app.app_info.get_icon (); } + + update_badge_revealer (); + update_progress_revealer (); + update_running_revealer (); } } private static Settings settings; private Gtk.Image image; - private Gtk.Image running_indicator; + private Gtk.Revealer progress_revealer; + private Gtk.Revealer badge_revealer; + private Gtk.Revealer running_revealer; private Adw.TimedAnimation bounce_up; private Adw.TimedAnimation bounce_down; private Adw.TimedAnimation timed_animation; @@ -83,7 +96,7 @@ public class Dock.Launcher : Gtk.Box { }; badge.add_css_class (Granite.STYLE_CLASS_BADGE); - var badge_revealer = new Gtk.Revealer () { + badge_revealer = new Gtk.Revealer () { can_target = false, child = badge, transition_type = SWING_UP @@ -93,16 +106,16 @@ public class Dock.Launcher : Gtk.Box { valign = END }; - var progress_revealer = new Gtk.Revealer () { + progress_revealer = new Gtk.Revealer () { can_target = false, child = progressbar, transition_type = CROSSFADE }; - running_indicator = new Gtk.Image.from_icon_name ("pager-checked-symbolic"); + var running_indicator = new Gtk.Image.from_icon_name ("pager-checked-symbolic"); running_indicator.add_css_class ("running-indicator"); - var running_revealer = new Gtk.Revealer () { + running_revealer = new Gtk.Revealer () { can_target = false, child = running_indicator, overflow = VISIBLE, @@ -206,7 +219,8 @@ public class Dock.Launcher : Gtk.Box { settings.bind ("icon-size", image, "pixel-size", DEFAULT); - app.bind_property ("count-visible", badge_revealer, "reveal-child", SYNC_CREATE); + app.notify["count-visible"].connect (update_badge_revealer); + update_badge_revealer (); current_count_binding = app.bind_property ("current_count", badge, "label", SYNC_CREATE, (binding, srcval, ref targetval) => { var src = (int64) srcval; @@ -221,9 +235,12 @@ public class Dock.Launcher : Gtk.Box { }, null ); - app.bind_property ("progress-visible", progress_revealer, "reveal-child", SYNC_CREATE); + app.notify["progress-visible"].connect (update_progress_revealer); + update_progress_revealer (); app.bind_property ("progress", progressbar, "fraction", SYNC_CREATE); - app.bind_property ("running-on-active-workspace", running_revealer, "reveal-child", SYNC_CREATE); + + app.notify["running-on-active-workspace"].connect (update_running_revealer); + update_running_revealer (); var drop_target_file = new Gtk.DropTarget (typeof (File), COPY); add_controller (drop_target_file); @@ -450,4 +467,16 @@ public class Dock.Launcher : Gtk.Box { launcher_manager.move_launcher_after (source, target_index); } + + private void update_badge_revealer () { + badge_revealer.reveal_child = !moving && app.count_visible; + } + + private void update_progress_revealer () { + progress_revealer.reveal_child = !moving && app.progress_visible; + } + + private void update_running_revealer () { + running_revealer.reveal_child = !moving && app.running_on_active_workspace; + } } From b6becaf0e2335e16462669a7a5a4b6ce6162e0eb Mon Sep 17 00:00:00 2001 From: elementaryBot Date: Mon, 7 Oct 2024 15:42:57 +0000 Subject: [PATCH 03/10] Update translation template --- po/extra/extra.pot | 9 +++++++-- po/io.elementary.dock.pot | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/po/extra/extra.pot b/po/extra/extra.pot index 3e844a64..ca4f8073 100644 --- a/po/extra/extra.pot +++ b/po/extra/extra.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: extra\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-07 15:33+0000\n" +"POT-Creation-Date: 2024-10-07 15:42+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,6 +37,11 @@ msgstr "" msgid "Fixes a crash when dragging a file that's not a launcher to the dock" msgstr "" -#: data/dock.metainfo.xml.in:39 +#: data/dock.metainfo.xml.in:31 +msgid "" +"Hide badges, progressbars, and running indicators while dragging a launcher" +msgstr "" + +#: data/dock.metainfo.xml.in:40 msgid "Complete rewrite 🎉️" msgstr "" diff --git a/po/io.elementary.dock.pot b/po/io.elementary.dock.pot index 66489b92..cc9a4ca2 100644 --- a/po/io.elementary.dock.pot +++ b/po/io.elementary.dock.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: io.elementary.dock\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-07 15:33+0000\n" +"POT-Creation-Date: 2024-10-07 15:42+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From d86adb8e899eb46e153c8647d6a5f08fa3a0d16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 11 Oct 2024 12:51:05 -0700 Subject: [PATCH 04/10] GSettings: add installer to default launchers (#290) --- data/dock.gschema.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/dock.gschema.xml b/data/dock.gschema.xml index 28a7f906..6b50086d 100644 --- a/data/dock.gschema.xml +++ b/data/dock.gschema.xml @@ -22,7 +22,7 @@ - ['gala-multitaskingview.desktop', 'io.elementary.files.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.settings.desktop', 'io.elementary.appcenter.desktop'] + ['gala-multitaskingview.desktop', 'io.elementary.files.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.settings.desktop', 'io.elementary.appcenter.desktop', 'io.elementary.installer.desktop'] An ordered array of app id's to show as launchers An ordered array of app id's to show as launchers From 043437b608624a2c812eda37bdcdbcf832dc435b Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:34:18 +0200 Subject: [PATCH 05/10] Only keep progressbar while needed (#296) --- src/Launcher.vala | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/Launcher.vala b/src/Launcher.vala index cfe87b7f..46e34742 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -102,13 +102,8 @@ public class Dock.Launcher : Gtk.Box { transition_type = SWING_UP }; - var progressbar = new Gtk.ProgressBar () { - valign = END - }; - progress_revealer = new Gtk.Revealer () { can_target = false, - child = progressbar, transition_type = CROSSFADE }; @@ -140,6 +135,14 @@ public class Dock.Launcher : Gtk.Box { insert_action_group (ACTION_GROUP_PREFIX, app.action_group); + // We have to destroy the progressbar when it is not needed otherwise it will + // cause continuous layouting of the surface see https://github.com/elementary/dock/issues/279 + progress_revealer.notify["child-revealed"].connect (() => { + if (!progress_revealer.child_revealed) { + progress_revealer.child = null; + } + }); + app.launching.connect (animate_launch); var bounce_animation_target = new Adw.CallbackAnimationTarget ((val) => { @@ -237,7 +240,6 @@ public class Dock.Launcher : Gtk.Box { app.notify["progress-visible"].connect (update_progress_revealer); update_progress_revealer (); - app.bind_property ("progress", progressbar, "fraction", SYNC_CREATE); app.notify["running-on-active-workspace"].connect (update_running_revealer); update_running_revealer (); @@ -474,6 +476,16 @@ public class Dock.Launcher : Gtk.Box { private void update_progress_revealer () { progress_revealer.reveal_child = !moving && app.progress_visible; + + // See comment above and https://github.com/elementary/dock/issues/279 + if (progress_revealer.reveal_child && progress_revealer.child == null) { + var progress_bar = new Gtk.ProgressBar () { + valign = END + }; + app.bind_property ("progress", progress_bar, "fraction", SYNC_CREATE); + + progress_revealer.child = progress_bar; + } } private void update_running_revealer () { From c06b054d4dd432b00871dece14948325349911e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 14 Oct 2024 12:35:15 -0700 Subject: [PATCH 06/10] Update dock.metainfo.xml.in --- data/dock.metainfo.xml.in | 1 + 1 file changed, 1 insertion(+) diff --git a/data/dock.metainfo.xml.in b/data/dock.metainfo.xml.in index 2a27fd8b..a0deffae 100644 --- a/data/dock.metainfo.xml.in +++ b/data/dock.metainfo.xml.in @@ -32,6 +32,7 @@ Changing Dock size left the dock with extra empty space + Dock using too much CPU/RAM From dc1db3e1dbc6a8c2b01fadcd4f419d6009868880 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:41:43 +0200 Subject: [PATCH 07/10] Launcher: Hide badge if do not disturb is active (#295) --- data/dock.metainfo.xml.in | 1 + src/Launcher.vala | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/data/dock.metainfo.xml.in b/data/dock.metainfo.xml.in index a0deffae..a95946cc 100644 --- a/data/dock.metainfo.xml.in +++ b/data/dock.metainfo.xml.in @@ -33,6 +33,7 @@ Changing Dock size left the dock with extra empty space Dock using too much CPU/RAM + Hide notification badges when Do Not Disturb is on diff --git a/src/Launcher.vala b/src/Launcher.vala index 46e34742..07c81c22 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -4,6 +4,17 @@ */ public class Dock.Launcher : Gtk.Box { + private static Settings settings; + private static Settings? notify_settings; + + static construct { + settings = new Settings ("io.elementary.dock"); + + if (SettingsSchemaSource.get_default ().lookup ("io.elementary.notifications", true) != null) { + notify_settings = new Settings ("io.elementary.notifications"); + } + } + public signal void revealed_done (); // Matches icon size and padding in Launcher.css @@ -40,8 +51,6 @@ public class Dock.Launcher : Gtk.Box { } } - private static Settings settings; - private Gtk.Image image; private Gtk.Revealer progress_revealer; private Gtk.Revealer badge_revealer; @@ -70,10 +79,6 @@ public class Dock.Launcher : Gtk.Box { set_css_name ("launcher"); } - static construct { - settings = new Settings ("io.elementary.dock"); - } - construct { popover = new Gtk.PopoverMenu.from_model (app.menu_model) { autohide = true, @@ -238,6 +243,10 @@ public class Dock.Launcher : Gtk.Box { }, null ); + if (notify_settings != null) { + notify_settings.changed["do-not-disturb"].connect (update_badge_revealer); + } + app.notify["progress-visible"].connect (update_progress_revealer); update_progress_revealer (); @@ -471,7 +480,8 @@ public class Dock.Launcher : Gtk.Box { } private void update_badge_revealer () { - badge_revealer.reveal_child = !moving && app.count_visible; + badge_revealer.reveal_child = !moving && app.count_visible + && (notify_settings == null || !notify_settings.get_boolean ("do-not-disturb")); } private void update_progress_revealer () { From 26cd2bbfd3951c3c630db09a632d42436744671e Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Tue, 15 Oct 2024 00:52:58 +0200 Subject: [PATCH 08/10] Launcher: Pin app on drag (#294) --- data/dock.metainfo.xml.in | 1 + src/Launcher.vala | 2 ++ 2 files changed, 3 insertions(+) diff --git a/data/dock.metainfo.xml.in b/data/dock.metainfo.xml.in index a95946cc..70f2ef5c 100644 --- a/data/dock.metainfo.xml.in +++ b/data/dock.metainfo.xml.in @@ -34,6 +34,7 @@ Changing Dock size left the dock with extra empty space Dock using too much CPU/RAM Hide notification badges when Do Not Disturb is on + Drag running app to pin diff --git a/src/Launcher.vala b/src/Launcher.vala index 07c81c22..cf28a6a2 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -395,6 +395,8 @@ public class Dock.Launcher : Gtk.Box { var paintable = new Gtk.WidgetPaintable (image); //Maybe TODO How TF can I get a paintable from a gicon?!?!? drag_source.set_icon (paintable.get_current_image (), drag_offset_x, drag_offset_y); moving = true; + + app.pinned = true; // Dragging communicates an implicit intention to pin the app } private bool on_drag_cancel (Gdk.Drag drag, Gdk.DragCancelReason reason) { From 0abdbc6048023e97ed5184c43f97a4858fb54793 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Tue, 15 Oct 2024 21:31:02 +0200 Subject: [PATCH 09/10] Launcher: Only act on actual scrolls not begin (#293) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Danielle Foré --- data/dock.metainfo.xml.in | 1 + src/Launcher.vala | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/data/dock.metainfo.xml.in b/data/dock.metainfo.xml.in index 70f2ef5c..3890d664 100644 --- a/data/dock.metainfo.xml.in +++ b/data/dock.metainfo.xml.in @@ -31,6 +31,7 @@

Hide badges, progressbars, and running indicators while dragging a launcher

+ Clicking a launcher almost always registers a scroll Changing Dock size left the dock with extra empty space Dock using too much CPU/RAM Hide notification badges when Do Not Disturb is on diff --git a/src/Launcher.vala b/src/Launcher.vala index cf28a6a2..5b826be5 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -219,7 +219,6 @@ public class Dock.Launcher : Gtk.Box { var scroll_controller = new Gtk.EventControllerScroll (VERTICAL); add_controller (scroll_controller); - scroll_controller.scroll_begin.connect (() => app.next_window.begin (false)); scroll_controller.scroll.connect ((dx, dy) => { app.next_window.begin (dy > 0); return Gdk.EVENT_STOP; From 7c85f028162600a8c9e2722317248ee1ad3e8637 Mon Sep 17 00:00:00 2001 From: Leonhard <106322251+leolost2605@users.noreply.github.com> Date: Fri, 18 Oct 2024 20:35:29 +0200 Subject: [PATCH 10/10] Indicate that an app is running on another workspace with a grey dot (#270) --- data/Application.css | 4 ++++ src/App.vala | 2 ++ src/Launcher.vala | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/Application.css b/data/Application.css index 520d55e1..cbd3b266 100644 --- a/data/Application.css +++ b/data/Application.css @@ -53,3 +53,7 @@ launcher progressbar progress { -gtk-icon-size: 9px; margin-top: -3px; } + +.running-indicator:disabled { + color: @text_color; +} diff --git a/src/App.vala b/src/App.vala index 079ec15a..3d443962 100644 --- a/src/App.vala +++ b/src/App.vala @@ -20,6 +20,7 @@ public class Dock.App : Object { public bool progress_visible { get; set; default = false; } public double progress { get; set; default = 0; } public bool prefers_nondefault_gpu { get; private set; default = false; } + public bool running { get { return windows.size > 0; } } public bool running_on_active_workspace { get { foreach (var win in windows) { @@ -174,6 +175,7 @@ public class Dock.App : Object { } notify_property ("running-on-active-workspace"); + notify_property ("running"); } public AppWindow? find_window (uint64 window_uid) { diff --git a/src/Launcher.vala b/src/Launcher.vala index 5b826be5..1ea5fce7 100644 --- a/src/Launcher.vala +++ b/src/Launcher.vala @@ -249,7 +249,9 @@ public class Dock.Launcher : Gtk.Box { app.notify["progress-visible"].connect (update_progress_revealer); update_progress_revealer (); - app.notify["running-on-active-workspace"].connect (update_running_revealer); + app.bind_property ("running-on-active-workspace", running_revealer, "sensitive", SYNC_CREATE); + + app.notify["running"].connect (update_running_revealer); update_running_revealer (); var drop_target_file = new Gtk.DropTarget (typeof (File), COPY); @@ -500,6 +502,6 @@ public class Dock.Launcher : Gtk.Box { } private void update_running_revealer () { - running_revealer.reveal_child = !moving && app.running_on_active_workspace; + running_revealer.reveal_child = !moving && app.running; } }