mirror of
https://github.com/libratbag/piper.git
synced 2026-04-21 06:47:50 -04:00
The welcome and error screens both require a different "perspective" into Piper, while being in the same window. For this reason, we introduce a titlebar and a regular stack and the concept of a "perspective", which is defined as a certain view into Piper. A perspective needs to implement an interface of sorts of two methods: one to retrieve its string name, and another to retrieve its widget titlebar. Different scenarios can then show different perspectives, that have full control over the main widget and the titlebar displayed. This commit introduces the MousePerspective, which is a perspective showing the mouse configuration. Future commits will add an ErrorPerspective and a WelcomePerspective, and even further into the future we can add a KeyboardPerspective as well.
203 lines
8.5 KiB
XML
203 lines
8.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- Generated with glade 3.20.0 -->
|
|
<interface>
|
|
<requires lib="gtk+" version="3.20"/>
|
|
<template class="MousePerspective" parent="GtkOverlay">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<child>
|
|
<object class="GtkStack" id="stack">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="transition_duration">400</property>
|
|
<property name="transition_type">slide-left-right</property>
|
|
<child>
|
|
<placeholder/>
|
|
</child>
|
|
</object>
|
|
<packing>
|
|
<property name="index">-1</property>
|
|
</packing>
|
|
</child>
|
|
<child type="overlay">
|
|
<object class="GtkRevealer" id="notification_commit">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="halign">center</property>
|
|
<property name="valign">start</property>
|
|
<property name="transition_duration">100</property>
|
|
<child>
|
|
<object class="GtkFrame">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="label_xalign">0</property>
|
|
<child>
|
|
<object class="GtkBox">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<child>
|
|
<object class="GtkLabel" id="notification_commit_label">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="margin_right">30</property>
|
|
<property name="margin_end">30</property>
|
|
<property name="label" translatable="yes">Failed to commit changes to the device</property>
|
|
<property name="ellipsize">middle</property>
|
|
<property name="max_width_chars">50</property>
|
|
</object>
|
|
<packing>
|
|
<property name="expand">False</property>
|
|
<property name="fill">True</property>
|
|
<property name="position">0</property>
|
|
</packing>
|
|
</child>
|
|
<child>
|
|
<object class="GtkButton" id="notification_commit_close">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">True</property>
|
|
<property name="focus_on_click">False</property>
|
|
<property name="receives_default">True</property>
|
|
<property name="relief">none</property>
|
|
<signal name="clicked" handler="_on_notification_commit_close_clicked" swapped="no"/>
|
|
<child>
|
|
<object class="GtkImage">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="icon_name">window-close-symbolic</property>
|
|
<property name="icon_size">2</property>
|
|
</object>
|
|
</child>
|
|
<style>
|
|
<class name="image-button"/>
|
|
</style>
|
|
</object>
|
|
<packing>
|
|
<property name="expand">False</property>
|
|
<property name="fill">True</property>
|
|
<property name="position">1</property>
|
|
</packing>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child type="label_item">
|
|
<placeholder/>
|
|
</child>
|
|
<style>
|
|
<class name="app-notification"/>
|
|
</style>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</template>
|
|
<object class="GtkHeaderBar" id="_titlebar">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="show_close_button">True</property>
|
|
<child>
|
|
<object class="GtkMenuButton">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">True</property>
|
|
<property name="receives_default">True</property>
|
|
<property name="tooltip_text" translatable="yes">Select another profile</property>
|
|
<property name="popover">popover_profiles</property>
|
|
<child>
|
|
<object class="GtkLabel" id="label_profile">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="label" translatable="yes">Profile 1</property>
|
|
<property name="justify">center</property>
|
|
<property name="track_visited_links">False</property>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child type="title">
|
|
<object class="GtkStackSwitcher">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="stack">stack</property>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkButton">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">True</property>
|
|
<property name="receives_default">True</property>
|
|
<property name="tooltip_text" translatable="yes">Commit the changes to the device</property>
|
|
<signal name="clicked" handler="_on_save_button_clicked" swapped="no"/>
|
|
<child>
|
|
<object class="GtkImage">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="icon_name">document-save-symbolic</property>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
<packing>
|
|
<property name="pack_type">end</property>
|
|
<property name="position">1</property>
|
|
</packing>
|
|
</child>
|
|
<style>
|
|
<class name="titlebar"/>
|
|
</style>
|
|
</object>
|
|
<object class="GtkPopover" id="popover_profiles">
|
|
<property name="can_focus">False</property>
|
|
<property name="border_width">2</property>
|
|
<child>
|
|
<object class="GtkBox">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="orientation">vertical</property>
|
|
<property name="spacing">6</property>
|
|
<child>
|
|
<object class="GtkScrolledWindow">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">True</property>
|
|
<property name="shadow_type">in</property>
|
|
<property name="propagate_natural_width">True</property>
|
|
<property name="propagate_natural_height">True</property>
|
|
<child>
|
|
<object class="GtkViewport">
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<child>
|
|
<object class="GtkListBox" id="listbox_profiles">
|
|
<property name="width_request">180</property>
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">False</property>
|
|
<property name="tooltip_text" translatable="yes">Click to switch to another profile</property>
|
|
<signal name="row-activated" handler="_on_profile_row_activated" swapped="no"/>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
<packing>
|
|
<property name="expand">True</property>
|
|
<property name="fill">True</property>
|
|
<property name="position">0</property>
|
|
</packing>
|
|
</child>
|
|
<child>
|
|
<object class="GtkButton" id="add_profile_button">
|
|
<property name="label" translatable="yes">Add profile</property>
|
|
<property name="visible">True</property>
|
|
<property name="can_focus">True</property>
|
|
<property name="receives_default">True</property>
|
|
<property name="tooltip_text" translatable="yes">Add a new profile to the device</property>
|
|
<signal name="clicked" handler="_on_add_profile_button_clicked" swapped="no"/>
|
|
</object>
|
|
<packing>
|
|
<property name="expand">False</property>
|
|
<property name="fill">True</property>
|
|
<property name="position">1</property>
|
|
</packing>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</interface>
|