Skip to content

Commit

Permalink
Add globalshortcuts demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorota Czaplejewicz committed Jun 22, 2024
1 parent 09339f9 commit 59bc64d
Show file tree
Hide file tree
Showing 7 changed files with 392 additions and 1 deletion.
1 change: 1 addition & 0 deletions ashpd-demo/data/resources.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<file compressed="true" preprocess="xml-stripblanks" alias="email.ui">resources/ui/email.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="file_chooser.ui">resources/ui/file_chooser.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="inhibit.ui">resources/ui/inhibit.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="global_shortcuts.ui">resources/ui/global_shortcuts.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="location.ui">resources/ui/location.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="network_monitor.ui">resources/ui/network_monitor.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="notification.ui">resources/ui/notification.ui</file>
Expand Down
93 changes: 93 additions & 0 deletions ashpd-demo/data/resources/ui/global_shortcuts.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GlobalShortcutsPage" parent="PortalPage">
<child>
<object class="AdwClamp">
<child>
<object class="GtkBox">
<property name="hexpand">True</property>
<property name="spacing">12</property>
<property name="orientation">vertical</property>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Global Shortcuts</property>
<property name="description" translatable="yes">Comma-separated list of shortcuts to request, in the form: "name:description:optional trigger"</property>
<child>
<object class="AdwEntryRow" id="shortcuts">
<property name="title" translatable="yes">Shortcuts</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">_Start Session</property>
<property name="use-underline">True</property>
<property name="halign">start</property>
<property name="action-name">global_shortcuts.start_session</property>
<style>
<class name="pill" />
<class name="suggested-action" />
</style>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">_Close Session</property>
<property name="use-underline">True</property>
<property name="halign">start</property>
<property name="sensitive">False</property>
<property name="action-name">global_shortcuts.stop</property>
<property name="halign">end</property>
<property name="hexpand">True</property>
<style>
<class name="pill" />
<class name="destructive-action" />
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="activations_group">
<property name="title" translatable="yes">Activations</property>
<property name="visible">False</property>
<property name="margin-top">24</property>
<child>
<object class="GtkLabel" id="activations_label">
<property name="valign">center</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="general_group">
<property name="title" translatable="yes">Info</property>
<property name="margin-top">24</property>
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Binding changes count</property>
<child>
<object class="GtkLabel" id="rebind_count_label">
<property name="valign">center</property>
<style>
<class name="dim-label" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="page-content" />
</style>
</object>
</child>
</template>
</interface>
14 changes: 14 additions & 0 deletions ashpd-demo/data/resources/ui/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
<property name="page-name">file_chooser</property>
</object>
</child>
<child>
<object class="SidebarRow">
<property name="title" translatable="yes">Global Shortcuts</property>
<property name="page-name">global_shortcuts</property>
</object>
</child>
<child>
<object class="SidebarRow">
<property name="title" translatable="yes">Inhibit</property>
Expand Down Expand Up @@ -261,6 +267,14 @@
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">global_shortcuts</property>
<property name="child">
<object class="GlobalShortcutsPage" id="global_shortcuts" />
</property>
</object>
</child>
<child>
<object class="GtkStackPage">
<property name="name">location</property>
Expand Down
1 change: 1 addition & 0 deletions ashpd-demo/po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ data/resources/ui/camera.ui
data/resources/ui/email.ui
data/resources/ui/file_chooser.ui
data/resources/ui/inhibit.ui
data/resources/ui/global_shortcuts.ui
data/resources/ui/location.ui
data/resources/ui/notification.ui
data/resources/ui/open_uri.ui
Expand Down
Loading

0 comments on commit 59bc64d

Please sign in to comment.