From 52bb5e3781dedbf044acc4c1be2a07fecfaec8c7 Mon Sep 17 00:00:00 2001 From: Jente Hidskes Date: Wed, 2 Aug 2017 12:53:30 +0200 Subject: [PATCH] Introduce perspectives to manage different screens 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. --- data/piper.gresource.xml | 3 +- data/ui/MousePerspective.ui | 202 ++++++++++++++++++++++++++++++++++++ data/ui/Window.ui | 192 ++-------------------------------- piper/mouseperspective.py | 133 ++++++++++++++++++++++++ piper/window.py | 149 +++++++------------------- 5 files changed, 380 insertions(+), 299 deletions(-) create mode 100644 data/ui/MousePerspective.ui create mode 100644 piper/mouseperspective.py diff --git a/data/piper.gresource.xml b/data/piper.gresource.xml index 77768b1..7a19590 100644 --- a/data/piper.gresource.xml +++ b/data/piper.gresource.xml @@ -7,9 +7,10 @@ AboutDialog.ui ui/ButtonDialog.ui ui/ButtonRow.ui + ui/MousePerspective.ui ui/LedDialog.ui ui/OptionButton.ui - ui/ProfileRow.ui + ui/ProfileRow.ui ui/ResolutionRow.ui ui/ResolutionsPage.ui ui/Window.ui diff --git a/data/ui/MousePerspective.ui b/data/ui/MousePerspective.ui new file mode 100644 index 0000000..7fa395b --- /dev/null +++ b/data/ui/MousePerspective.ui @@ -0,0 +1,202 @@ + + + + + + + True + False + True + + + True + True + True + Select another profile + popover_profiles + + + True + False + Profile 1 + center + False + + + + + + + True + False + stack + + + + + True + True + True + Commit the changes to the device + + + + True + False + document-save-symbolic + + + + + end + 1 + + + + + + False + 2 + + + True + False + vertical + 6 + + + True + True + in + True + True + + + True + False + + + 180 + True + False + Click to switch to another profile + + + + + + + + True + True + 0 + + + + + Add profile + True + True + True + Add a new profile to the device + + + + False + True + 1 + + + + + + diff --git a/data/ui/Window.ui b/data/ui/Window.ui index 13ebfd4..891043b 100644 --- a/data/ui/Window.ui +++ b/data/ui/Window.ui @@ -2,203 +2,27 @@ - - False - 2 - - - True - False - vertical - 6 - - - True - True - in - True - True - - - True - False - - - 180 - True - False - Click to switch to another profile - - - - - - - - True - True - 0 - - - - - Add profile - True - True - True - Add a new profile to the device - - - - False - True - 1 - - - - -