Changes
16 changed files (+588/-30)
-
-
@@ -25,12 +25,15 @@ SPDX-License-Identifier: Apache-2.0<file preprocess="xml-stripblanks">ui/playback-toolbar.ui</file> <file preprocess="xml-stripblanks">ui/server-list.ui</file> <file preprocess="xml-stripblanks">ui/generic-error-dialog.ui</file> <file preprocess="xml-stripblanks">ui/keyboard-shortcut-row.ui</file> <file preprocess="xml-stripblanks">ui/keyboard-shortcuts-dialog.ui</file> <file preprocess="xml-stripblanks">ui/preferences-dialog.ui</file> <file preprocess="xml-stripblanks">ui/server-connecting.ui</file> <file preprocess="xml-stripblanks">ui/server-list-network-error-dialog.ui</file> <file preprocess="xml-stripblanks">ui/zone-output-row.ui</file> <file preprocess="xml-stripblanks">icons/scalable/actions/audio-volume-high-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/audio-volume-low-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/entry-clear-outline-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/go-next-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/go-previous-symbolic.svg</file> <file preprocess="xml-stripblanks">icons/scalable/actions/image-missing-symbolic.svg</file>
-
-
-
@@ -0,0 +1,6 @@<?xml version="1.0" encoding="UTF-8"?> <!-- SPDX-FileCopyrightText: Gnome Developers SPDX-License-Identifier: CC0-1.0 --> <svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 7 1 c -2.054688 0 -3.703125 1.503906 -4.933594 2.984375 c -0.613281 0.742187 -1.121094 1.507813 -1.484375 2.179687 c -0.183593 0.335938 -0.332031 0.648438 -0.441406 0.945313 c -0.1054688 0.292969 -0.1992188 0.535156 -0.1835938 0.929687 c 0.0273438 0.703126 0.2929688 1.160157 0.6601568 1.835938 c 0.367187 0.671875 0.867187 1.429688 1.472656 2.160156 c 1.214844 1.46875 2.828125 2.945313 4.851562 2.949219 l 5.054688 0.015625 c 2.199218 0.007812 4.003906 -1.804688 4.003906 -4 v -6 c 0 -2.195312 -1.804688 -4 -4 -4 z m 0 2 h 5 c 1.09375 0 2 0.90625 2 2 v 6 c 0 1.09375 -0.90625 2.003906 -2 2 l -5.050781 -0.015625 c -0.921875 0 -2.28125 -0.96875 -3.316407 -2.21875 c -0.519531 -0.628906 -0.960937 -1.296875 -1.261718 -1.851563 c -0.226563 -0.417968 -0.355469 -0.84375 -0.398438 -0.953124 c 0.007813 -0.039063 0.019532 -0.09375 0.042969 -0.15625 c 0.066406 -0.171876 0.175781 -0.414063 0.324219 -0.6875 c 0.296875 -0.546876 0.742187 -1.21875 1.265625 -1.851563 c 1.054687 -1.269531 2.449219 -2.265625 3.394531 -2.265625 z m 0.007812 2.015625 c -0.261718 0 -0.519531 0.101563 -0.707031 0.289063 c -0.386719 0.390624 -0.386719 1.027343 0 1.414062 l 1.292969 1.296875 l -1.292969 1.289063 c -0.386719 0.390624 -0.386719 1.027343 0 1.414062 c 0.390625 0.390625 1.023438 0.390625 1.414063 0 l 1.292968 -1.289062 l 1.292969 1.289062 c 0.390625 0.390625 1.023438 0.390625 1.414063 0 c 0.390625 -0.386719 0.390625 -1.023438 0 -1.414062 l -1.292969 -1.289063 l 1.292969 -1.296875 c 0.390625 -0.386719 0.390625 -1.023438 0 -1.414062 c -0.1875 -0.1875 -0.441406 -0.289063 -0.707032 -0.289063 c -0.261718 0 -0.519531 0.101563 -0.707031 0.289063 l -1.292969 1.296874 l -1.292968 -1.296874 c -0.1875 -0.1875 -0.441406 -0.289063 -0.707032 -0.289063 z m 0 0" fill="#222222"/></svg>
-
-
-
@@ -93,5 +93,40 @@ SPDX-License-Identifier: Apache-2.0<summary>Default category</summary> <description>Category ID to be selected on startup.</description> </key> <!-- Keyboard shortcuts --> <key name="accelerator-app-open-menu" type="s"> <default>""</default> </key> <key name="accelerator-playback-toggle-play-pause" type="s"> <default>""</default> </key> <key name="accelerator-playback-previous" type="s"> <default>""</default> </key> <key name="accelerator-playback-next" type="s"> <default>""</default> </key> <key name="accelerator-playback-stop" type="s"> <default>""</default> </key> <key name="accelerator-playback-focus-seekbar" type="s"> <default>""</default> </key> <key name="accelerator-browse-focus-category" type="s"> <default>""</default> </key> <key name="accelerator-browse-toggle-category-open" type="s"> <default>""</default> </key> <key name="accelerator-browse-focus-search-entry" type="s"> <default>""</default> </key> <key name="accelerator-browse-focus-first-browse-row" type="s"> <default>""</default> </key> <key name="accelerator-browse-back" type="s"> <default>"BackSpace"</default> </key> </schema> </schemalist>
-
-
-
@@ -51,17 +51,6 @@ SPDX-License-Identifier: Apache-2.0<style> <class name="flat" /> </style> <child> <object class="GtkShortcutController"> <property name="scope">managed</property> <child> <object class="GtkShortcut"> <property name="trigger">BackSpace</property> <property name="action">activate</property> </object> </child> </object> </child> </object> </child> <child>
-
-
-
@@ -0,0 +1,88 @@<?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2026 Shota FUJI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 --> <interface> <template class="PlacGtkAdwaitaKeyboardShortcutRow" parent="AdwPreferencesRow"> <property name="activatable">true</property> <property name="selectable">false</property> <child> <object class="GtkBox"> <property name="orientation">vertical</property> <property name="spacing">4</property> <style> <class name="toolbar" /> </style> <child> <object class="GtkLabel"> <property name="single-line-mode">true</property> <property name="halign">start</property> <binding name="label"> <lookup name="label" type="PlacGtkAdwaitaKeyboardShortcutRow" /> </binding> <style> <class name="subtitle" /> </style> </object> </child> <child> <object class="GtkBox"> <property name="orientation">horizontal</property> <property name="spacing">4</property> <child> <object class="AdwShortcutLabel"> <property name="hexpand">true</property> <property name="disabled-text">---</property> <property name="visible" bind-source="PlacGtkAdwaitaKeyboardShortcutRow" bind-property="capturing" bind-flags="invert-boolean|sync-create" /> <binding name="accelerator"> <lookup name="accelerator" type="PlacGtkAdwaitaKeyboardShortcutRow" /> </binding> </object> </child> <child> <object class="GtkLabel"> <property name="hexpand">true</property> <property name="halign">start</property> <property name="label">Press keys...</property> <property name="visible" bind-source="PlacGtkAdwaitaKeyboardShortcutRow" bind-property="capturing" bind-flags="sync-create" /> </object> </child> <child> <object class="GtkBox"> <property name="orientation">horizontal</property> <style> <class name="linked" /> </style> <child> <object class="GtkButton" id="change"> <property name="label">Edit</property> </object> </child> <child> <object class="GtkButton" id="clear"> <property name="label">Clear</property> <property name="icon-name">entry-clear-outline-symbolic</property> </object> </child> </object> </child> </object> </child> </object> </child> </template> </interface>
-
-
-
@@ -0,0 +1,43 @@<?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2026 Shota FUJI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 --> <interface> <template class="PlacGtkAdwaitaKeyboardShortcutsDialog" parent="AdwPreferencesDialog"> <property name="title">Keyboard Shortcuts</property> <child> <object class="AdwPreferencesPage"> <property name="description">Configure application global keyboard shortcuts. System keys reserved by GTK are unavailable. Press Esc to cancel edit mode.</property> <child> <object class="AdwPreferencesGroup" id="general"> <property name="title">General</property> </object> </child> <child> <object class="AdwPreferencesGroup" id="playback"> <property name="title">Playback</property> </object> </child> <child> <object class="AdwPreferencesGroup" id="browse"> <property name="title">Browse</property> </object> </child> </object> </child> </template> </interface>
-
-
-
@@ -54,7 +54,7 @@ SPDX-License-Identifier: Apache-2.0<child type="top"> <object class="AdwHeaderBar" id="header_bar"> <child type="start"> <object class="GtkToggleButton"> <object class="GtkToggleButton" id="sidebar_toggle_button"> <property name="icon-name">sidebar-show-symbolic</property> <property name="tooltip-text">Toggle Sidebar</property> <property
-
@@ -66,7 +66,7 @@ SPDX-License-Identifier: Apache-2.0</object> </child> <child type="end"> <object class="GtkMenuButton"> <object class="GtkMenuButton" id="menu_button"> <property name="direction">none</property> <property name="menu-model">app_menu</property> <property name="use-underline">true</property>
-
@@ -131,6 +131,10 @@ SPDX-License-Identifier: Apache-2.0<attribute name="label">_Preferences</attribute> <attribute name="action">app.preferences</attribute> </item> <item> <attribute name="label">_Keyboard Shortcuts</attribute> <attribute name="action">app.keyboard-shortcuts</attribute> </item> <item> <attribute name="label">_About Plac</attribute> <attribute name="action">app.about</attribute>
-
-
-
@@ -105,6 +105,10 @@ SPDX-License-Identifier: Apache-2.0<attribute name="label">_Preferences</attribute> <attribute name="action">app.preferences</attribute> </item> <item> <attribute name="label">_Keyboard Shortcuts</attribute> <attribute name="action">app.keyboard-shortcuts</attribute> </item> <item> <attribute name="label">_About Plac</attribute> <attribute name="action">app.about</attribute>
-
-
-
@@ -21,6 +21,10 @@ namespace PlacGtkAdwaita {name = "preferences", activate = on_preferences, }, GLib.ActionEntry() { name = "keyboard-shortcuts", activate = on_keyboard_shortcuts, }, GLib.ActionEntry() { name = "about", activate = on_about,
-
@@ -68,6 +72,11 @@ namespace PlacGtkAdwaita {dialog.present(this.active_window); } private void on_keyboard_shortcuts() { var shortcuts_dialog = new KeyboardShortcutsDialog(); shortcuts_dialog.present(this.active_window); } private void on_quit() { this.quit(); }
-
-
-
@@ -0,0 +1,62 @@// Copyright 2026 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 namespace PlacGtkAdwaita { class ConfigurableShortcut : GLib.Object { public Gtk.Shortcut shortcut { get; construct; } public string setting_key { get; construct; } private Settings settings = new Settings(); public ConfigurableShortcut(string setting_key, Gtk.ShortcutAction action) { var shortcut = new Gtk.Shortcut(Gtk.NeverTrigger.get(), action); Object(setting_key: setting_key, shortcut: shortcut); } // This constructor sets "NothingAction" at initialization, assuming caller configures an action // later on. This is for "CallbackAction", where instantiation on class initializer is impossible // due to closure's userdata capture. public ConfigurableShortcut.lazy(string setting_key) { var shortcut = new Gtk.Shortcut(Gtk.NeverTrigger.get(), Gtk.NothingAction.get()); Object(setting_key: setting_key, shortcut: shortcut); } construct { configure(); settings.settings.changed[setting_key].connect(() => { configure(); }); } private void configure() { var accelerator = settings.settings.get_string(setting_key); if (accelerator == null || accelerator == "") { shortcut.trigger = Gtk.NeverTrigger.get(); } else { shortcut.trigger = Gtk.ShortcutTrigger.parse_string(accelerator); } } // Install shortcut to a widget. Mostly for "ActivateAction". public void install(Gtk.Widget widget, Gtk.ShortcutScope scope = MANAGED) { var controller = new Gtk.ShortcutController(); controller.scope = scope; controller.add_shortcut(this.shortcut); widget.add_controller(controller); } } }
-
-
-
@@ -33,6 +33,20 @@ namespace PlacGtkAdwaita {public const string DISABLE_CSD = "disable-csd"; public const string STARTUP_CATEGORY = "startup-category"; public class Shortcuts { public const string OPEN_MENU = "accelerator-app-open-menu"; public const string TOGGLE_PLAY_PAUSE = "accelerator-playback-toggle-play-pause"; public const string PREVIOUS_TRACK = "accelerator-playback-previous"; public const string NEXT_TRACK = "accelerator-playback-next"; public const string STOP = "accelerator-playback-stop"; public const string FOCUS_SEEKBAR = "accelerator-playback-focus-seekbar"; public const string FOCUS_BROWSE_CATEGORY = "accelerator-browse-focus-category"; public const string TOGGLE_BROWSE_CATEGORY = "accelerator-browse-toggle-category-open"; public const string FOCUS_SEARCH = "accelerator-browse-focus-search-entry"; public const string FOCUS_BROWSE_ROW = "accelerator-browse-focus-first-browse-row"; public const string BROWSE_BACK = "accelerator-browse-back"; } public GLib.Settings settings; public Settings() {
-
-
-
@@ -36,6 +36,10 @@ namespace PlacGtkAdwaita {[GtkChild] private unowned Gtk.Button back; private ConfigurableShortcut back_shortcut = new ConfigurableShortcut( Settings.Shortcuts.BROWSE_BACK, Gtk.ActivateAction.get() ); [GtkChild] private unowned Gtk.ListView items;
-
@@ -49,6 +53,14 @@ namespace PlacGtkAdwaita {[GtkChild] private unowned Adw.ToastOverlay toasts; private ConfigurableShortcut focus_search_query_shortcut = new ConfigurableShortcut.lazy( Settings.Shortcuts.FOCUS_SEARCH ); private ConfigurableShortcut focus_first_item_shortcut = new ConfigurableShortcut.lazy( Settings.Shortcuts.FOCUS_BROWSE_ROW ); private GLib.ListStore items_store = new GLib.ListStore(typeof (BrowseItem.Item)); private Plac.Connection? conn = null;
-
@@ -132,6 +144,7 @@ namespace PlacGtkAdwaita {load_page(false, false); }); back_shortcut.install(back); back.clicked.connect(() => { if (!this.is_loading) { pop();
-
@@ -144,6 +157,23 @@ namespace PlacGtkAdwaita {this.item = null; load_page(); }); focus_search_query_shortcut.shortcut.action = new Gtk.CallbackAction(() => { search_query.grab_focus(); }); focus_first_item_shortcut.shortcut.action = new Gtk.CallbackAction(() => { if (items_store.n_items > 0) { items.grab_focus(); items.scroll_to(0, FOCUS, null); } }); var shortcut_controller = new Gtk.ShortcutController(); shortcut_controller.scope = GLOBAL; shortcut_controller.add_shortcut(focus_search_query_shortcut.shortcut); shortcut_controller.add_shortcut(focus_first_item_shortcut.shortcut); this.add_controller(shortcut_controller); } public void start(Plac.Connection? conn, Plac.ZonesModel zones_model) {
-
-
-
@@ -0,0 +1,115 @@// Copyright 2026 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 namespace PlacGtkAdwaita { [GtkTemplate(ui = "/jp/pocka/plac/gtk-adwaita/ui/keyboard-shortcut-row.ui")] class KeyboardShortcutRow : Adw.PreferencesRow { public signal void capture_started(); public signal void cancelled(); public signal void configured(string new_accelerator); public string label { get; set construct; } public string accelerator { get; set construct; default = ""; } public bool capturing { get; set; default = false; } [GtkChild] private unowned Gtk.Button change; [GtkChild] private unowned Gtk.Button clear; public KeyboardShortcutRow(string label) { Object(label: label, accelerator: ""); } construct { var controller = new Gtk.EventControllerKey(); this.add_controller(controller); this.notify["capturing"].connect(() => { change.label = capturing ? "Cancel" : "Edit"; }); this.activate.connect(() => { if (!this.capturing) { this.start_capture(); } }); change.clicked.connect(() => { if (!this.capturing) { this.start_capture(); } else { this.cancel_capture(); } }); clear.clicked.connect(() => { this.capturing = false; this.configured(""); }); controller.key_pressed.connect((_self, keyval, keycode, modifier) => { if (!capturing) { return false; } switch (keyval) { case Gdk.Key.Escape: this.cancel_capture(); return true; case Gdk.Key.Tab: this.cancel_capture(); return false; case Gdk.Key.space: case Gdk.Key.Return: // Modifier keys case Gdk.Key.Control_L: case Gdk.Key.Control_R: case Gdk.Key.Shift_L: case Gdk.Key.Shift_R: case Gdk.Key.Alt_L: case Gdk.Key.Alt_R: case Gdk.Key.Meta_L: case Gdk.Key.Meta_R: case Gdk.Key.Super_L: case Gdk.Key.Super_R: case Gdk.Key.Hyper_L: case Gdk.Key.Hyper_R: return true; } this.end_capture(keyval, modifier); return true; }); } private void start_capture() { this.capturing = true; this.capture_started(); } private void cancel_capture() { this.capturing = false; this.cancelled(); } private void end_capture(uint keyval, Gdk.ModifierType modifiers) { this.capturing = false; this.configured(Gtk.accelerator_name(keyval, modifiers)); } } }
-
-
-
@@ -0,0 +1,84 @@// Copyright 2026 Shota FUJI // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // SPDX-License-Identifier: Apache-2.0 namespace PlacGtkAdwaita { [GtkTemplate(ui = "/jp/pocka/plac/gtk-adwaita/ui/keyboard-shortcuts-dialog.ui")] class KeyboardShortcutsDialog : Adw.PreferencesDialog { [GtkChild] private unowned Adw.PreferencesGroup general; [GtkChild] private unowned Adw.PreferencesGroup playback; [GtkChild] private unowned Adw.PreferencesGroup browse; private Settings settings = new Settings(); public KeyboardShortcutRow? current_capturing { get; set; default = null; } public KeyboardShortcutsDialog() { (typeof (KeyboardShortcutRow)).ensure(); Object(); } construct { register_shortcut(general, "Open application menu", Settings.Shortcuts.OPEN_MENU); register_shortcut(playback, "Toggle play/pause", Settings.Shortcuts.TOGGLE_PLAY_PAUSE); register_shortcut(playback, "Previous track", Settings.Shortcuts.PREVIOUS_TRACK); register_shortcut(playback, "Next track", Settings.Shortcuts.NEXT_TRACK); register_shortcut(playback, "Stop playback", Settings.Shortcuts.STOP); register_shortcut(playback, "Focus seekbar", Settings.Shortcuts.FOCUS_SEEKBAR); register_shortcut(browse, "Focus category menu", Settings.Shortcuts.FOCUS_BROWSE_CATEGORY); register_shortcut(browse, "Toggle category menu open/close", Settings.Shortcuts.TOGGLE_BROWSE_CATEGORY); register_shortcut(browse, "Focus search input", Settings.Shortcuts.FOCUS_SEARCH); register_shortcut(browse, "Focus first browse item", Settings.Shortcuts.FOCUS_BROWSE_ROW); register_shortcut(browse, "Browse back", Settings.Shortcuts.BROWSE_BACK); } private void register_shortcut(Adw.PreferencesGroup group, string title, string setting_name) { var row = new KeyboardShortcutRow(title); row.capture_started.connect(() => { if (current_capturing != null) { current_capturing.capturing = false; } current_capturing = row; }); row.cancelled.connect(() => { if (current_capturing == row) { current_capturing = null; } }); row.configured.connect((accelerator) => { if (current_capturing == row) { current_capturing = null; } settings.settings.set_string(setting_name, accelerator); }); settings.settings.bind(setting_name, row, "accelerator", GET); group.add(row); } } }
-
-
-
@@ -29,18 +29,34 @@ namespace PlacGtkAdwaita {[GtkChild] private unowned Gtk.Button play; private ConfigurableShortcut play_shortcut = new ConfigurableShortcut( Settings.Shortcuts.TOGGLE_PLAY_PAUSE, Gtk.ActivateAction.get() ); [GtkChild] private unowned Gtk.Button pause; private ConfigurableShortcut pause_shortcut = new ConfigurableShortcut( Settings.Shortcuts.TOGGLE_PLAY_PAUSE, Gtk.ActivateAction.get() ); [GtkChild] private unowned Gtk.Button stop; [GtkChild] private unowned Gtk.Button prev; private ConfigurableShortcut prev_shortcut = new ConfigurableShortcut( Settings.Shortcuts.PREVIOUS_TRACK, Gtk.ActivateAction.get() ); [GtkChild] private unowned Gtk.Button next; private ConfigurableShortcut next_shortcut = new ConfigurableShortcut( Settings.Shortcuts.NEXT_TRACK, Gtk.ActivateAction.get() ); [GtkChild] private unowned Gtk.Button seek_backwards_10;
-
@@ -69,6 +85,14 @@ namespace PlacGtkAdwaita {[GtkChild] private unowned Artwork artwork; // Stop button can be invisible depending on user preferences. // This shortcut has to be callback otherwise it won't stop playback when the button is hidden. private ConfigurableShortcut stop_shortcut = new ConfigurableShortcut.lazy(Settings.Shortcuts.STOP); private ConfigurableShortcut focus_seek_shortcut = new ConfigurableShortcut.lazy( Settings.Shortcuts.FOCUS_SEEKBAR ); private bool is_seeking = false; private int64? next_seek = null;
-
@@ -153,6 +177,7 @@ namespace PlacGtkAdwaita {} }); play_shortcut.install(play); play.clicked.connect(() => { if (conn == null || selected_zone == null || !is_actions_available) { return;
-
@@ -170,6 +195,7 @@ namespace PlacGtkAdwaita {}); }); pause_shortcut.install(pause); pause.clicked.connect(() => { if (conn == null || selected_zone == null || !is_actions_available) { return;
-
@@ -188,25 +214,10 @@ namespace PlacGtkAdwaita {}); stop.clicked.connect(() => { if (conn == null || selected_zone == null || !is_actions_available) { return; } this.disable_actions(); this.control_async.begin(conn, selected_zone, STOP, (_obj, res) => { try { this.control_async.end(res); } catch (GLib.Error error) { GLib.log("Plac", LEVEL_CRITICAL, "Stop control failed: %s", error.message); } this.enable_actions(); seek.set_value(0); schedule_seek(0); }); try_stop(); }); prev_shortcut.install(prev); prev.clicked.connect(() => { if (conn == null || selected_zone == null || !is_actions_available) { return;
-
@@ -224,6 +235,7 @@ namespace PlacGtkAdwaita {}); }); next_shortcut.install(next); next.clicked.connect(() => { if (conn == null || selected_zone == null || !is_actions_available) { return;
-
@@ -276,6 +288,20 @@ namespace PlacGtkAdwaita {settings.settings.bind(Settings.SHOW_SEEK_BY_10SECS, seek_forward_10, "visible", GET); settings.settings.bind(Settings.SHOW_STOP_BUTTON, stop, "visible", GET); focus_seek_shortcut.shortcut.action = new Gtk.CallbackAction(() => { seek.grab_focus(); }); stop_shortcut.shortcut.action = new Gtk.CallbackAction(() => { try_stop(); }); var shortcut_controller = new Gtk.ShortcutController(); shortcut_controller.scope = GLOBAL; shortcut_controller.add_shortcut(focus_seek_shortcut.shortcut); shortcut_controller.add_shortcut(stop_shortcut.shortcut); this.add_controller(shortcut_controller); this.render(); }
-
@@ -491,5 +517,25 @@ namespace PlacGtkAdwaita {throw new PlaybackToolbarError.SEEK_FAILED(@"Expected Success response, got $(res.meta.service)."); } } private void try_stop() { if (conn == null || selected_zone == null || !is_actions_available) { return; } this.disable_actions(); this.control_async.begin(conn, selected_zone, STOP, (_obj, res) => { try { this.control_async.end(res); } catch (GLib.Error error) { GLib.log("Plac", LEVEL_CRITICAL, "Stop control failed: %s", error.message); } this.enable_actions(); seek.set_value(0); schedule_seek(0); }); } } }
-
-
-
@@ -49,9 +49,27 @@ namespace PlacGtkAdwaita {[GtkChild] private unowned Gtk.ListBox browse_hierarchy; [GtkChild] private unowned Gtk.ToggleButton sidebar_toggle_button; private ConfigurableShortcut sidebar_toggle_shortcut = new ConfigurableShortcut( Settings.Shortcuts.TOGGLE_BROWSE_CATEGORY, Gtk.ActivateAction.get() ); [GtkChild] private unowned Gtk.MenuButton menu_button; private ConfigurableShortcut menu_button_shortcut = new ConfigurableShortcut( Settings.Shortcuts.OPEN_MENU, Gtk.ActivateAction.get() ); [GtkChild] private unowned Adw.HeaderBar header_bar; private ConfigurableShortcut focus_browse_hierarchy_shortcut = new ConfigurableShortcut.lazy( Settings.Shortcuts.FOCUS_BROWSE_CATEGORY ); private Settings settings = new Settings(); private Plac.Server? server = null;
-
@@ -121,6 +139,14 @@ namespace PlacGtkAdwaita {settings.settings.bind(Settings.DISABLE_CSD, header_bar, "show-title", GET | INVERT_BOOLEAN); settings.settings.bind(Settings.DISABLE_CSD, header_bar, "show-end-title-buttons", GET | INVERT_BOOLEAN); menu_button_shortcut.install(menu_button); sidebar_toggle_shortcut.install(sidebar_toggle_button); focus_browse_hierarchy_shortcut.shortcut.action = new Gtk.CallbackAction(() => { browse_hierarchy.get_selected_row()?.grab_focus(); }); focus_browse_hierarchy_shortcut.install(browse_hierarchy); } public void start() {
-