Commit Graph

28 Commits

Author SHA1 Message Date
Jente Hidskes
52bb5e3781 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.
2017-08-09 19:17:45 +01:00
Jente Hidskes
d452c50e6b 404: remove caption and resize 2017-08-09 19:17:45 +01:00
Jente Hidskes
ee6f91bd49 ResolutionRow: do not display frame label "Resolution"
See #79
2017-08-04 08:49:42 +01:00
Jente Hidskes
83e215f08f ResolutionRow: remove "Resolution x"
See #75 and #79
2017-08-04 08:49:42 +01:00
Jente Hidskes
da3efd0374 Window: add profile switch popover
This commits adds the necessary bits in the UI to switch between
popovers. Following commits will propagate profile changes through the
rest of Piper so that all control widgets update corresponding to
profile changes.
2017-08-01 16:39:30 +01:00
Jente Hidskes
fc9d9bffc6 Keystroke: remove clear, add cancel 2017-08-01 10:22:34 +01:00
Jente Hidskes
e874c81c69 Merge key mappings with macros 2017-08-01 10:22:34 +01:00
Jente Hidskes
510e3b6b31 ButtonDialog: merge all stack pages into a list
For the user anyway, all different mappings will look the same. It makes
no sense to make this more complicated for them by separating them into
different concepts.
2017-08-01 10:22:34 +01:00
Jente Hidskes
334f3bf27e ButtonDialog: add special mapping page 2017-08-01 10:22:34 +01:00
Jente Hidskes
847d8fcf3a ButtonDialog: add key mapping stack page
ratbag's key mapping signature is forcing us to treat modifiers
different from regular keys. To detect them, we need several workarounds
over Gdk.EventKey which makes the code uglier than it could be. Perhaps
we should just skip this altogether and implement macros only; since
they don't differentiate between modifiers and regular keys all these
workaround can then be removed while providing the same functionality.
2017-08-01 10:22:34 +01:00
Jente Hidskes
0773bbcbca ButtonDialog: add button map page 2017-08-01 10:22:34 +01:00
Jente Hidskes
96a77f024b Add ButtonsPage to configure buttons
This commit adds the initial buttons page and a skeleton configuration
dialog to configure button mappings.
2017-08-01 10:22:34 +01:00
Jente Hidskes
67ffb25e64 Window.ui: let Glade move things around 2017-07-27 09:36:42 +02:00
Jente Hidskes
b78aade8aa data/ui: add tooltips to control widgets
Every control widget should have a tooltip to explain its purpose.

Fixes #40
2017-07-27 09:36:42 +02:00
Jente Hidskes
ee07784a28 Add LED page to configure LEDs 2017-07-27 09:36:42 +02:00
Jente Hidskes
4aa36cfab7 OptionButton: a Gtk.Button with a cog 2017-07-27 09:36:41 +02:00
Jente Hidskes
fa5c72c8c0 data: move ui files into subdirs
It's getting quite messy to let's put in some structure.
2017-07-27 09:36:41 +02:00
Jente Hidskes
4679c9f3fa Window: extract resolution code into ResolutionsPage class 2017-07-27 09:36:41 +02:00
Jente Hidskes
518f3b412d ResolutionRow: snap resolution values to multiples of 50
Mice don't do anything more fine-grained than this
2017-07-27 09:36:40 +02:00
Jente Hidskes
ec718cf314 ResolutionRow: remove support for separate x/y resolutions 2017-07-27 09:36:40 +02:00
Jente Hidskes
78137cf108 Window: block the scroll event on the scales
Without this, when scrolling through the list over a scale, the scale
will steal the scroll event.
2017-07-27 09:36:40 +02:00
Jente Hidskes
e96d2ee9fd Window: hook up report rate buttons to ratbagd
For now we only expose report rates of 500 and 1000 Hz; we can add more
later when we know if people care about it.
2017-07-27 09:36:40 +02:00
Jente Hidskes
f12a708adf Window: add in-app notification for failed commit
Now the user will at least know why his or her changes have not been
applied. In the future we may want to include why, but for now this
suffices.
2017-07-27 09:36:39 +02:00
Jente Hidskes
3213b6bd62 Window: add list of resolutions
This list can set a profile's resolutions. Currently, it is limited to
the active profile because there is no support for profiles other than
the default.

Adding and removing resolutions is not yet implemented because this is
not yet exposed through libratbag (see [1]).

[1]: https://github.com/libratbag/libratbag/issues/211
2017-07-27 09:36:39 +02:00
Jente Hidskes
8d77e4bf6c Window: use GtkTemplate to instantiate from a GtkBuilder template
In C/GTK+, templates allow one to define the UI in .ui files, from which
implementations can be instantiated. This significantly reduces
boilerplate code that creates widgets, sets their desired properties and
connects their signals[1, 2].

For several reasons, this does not work in Python[3]. gi_composites.py[4] is an
implementation in Python that does make this work. It's been used by
several projects for a few months now and none report issues. See the
project's README for more information[5].

Taking these facts into mind, let's experiment for a bit and see how it
can serve Piper.

[1]: https://wiki.gnome.org/HowDoI/CustomWidgets#Templates
[2]: https://blogs.gnome.org/tvb/2013/04/09/announcing-composite-widget-templates/
[3]: https://bugzilla.gnome.org/show_bug.cgi?id=701843
[4]: https://github.com/virtuald/pygi-composite-templates/
[5]: https://github.com/virtuald/pygi-composite-templates/blob/master/README.rst
2017-07-27 09:36:39 +02:00
Jente Hidskes
a87bfc1b6e Window: add a skeleton window
This is just a quick skeleton window for now to be able to test the
MouseMap widget. Eventually this will turn into the mockups.

piper.py is still around to steal code from; it will be removed
eventually when all useful bits have found a place in the new codebase.
2017-07-27 09:36:39 +02:00
Jente Hidskes
33afa03f14 Application: a Gtk.Application subclass
A Gtk.Application subclass to handle the application's initialization
and integration with the GNOME stack. It implements the do_startup and
do_activate methods and is responsible for the application's menus,
icons, title and lifetime.
2017-07-04 15:53:05 +10:00
Jente Hidskes
45c669b8ad Port to Meson
As discussed in #5, this enables better integration with the GNOME stack
through Meson's GNOME module. This will allow us to use GSchemas,
AppData and other GNOME technologies much easier. It will also simplify
building Flatpaks of Piper.
2017-06-07 17:07:13 +02:00