Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resolutions page #28

Merged
merged 13 commits into from
Jul 9, 2017
Merged

Add resolutions page #28

merged 13 commits into from
Jul 9, 2017

Conversation

Hjdskes
Copy link
Member

@Hjdskes Hjdskes commented Jul 6, 2017

This PR adds the resolutions page according to the mockups (well, mostly). It's not entirely done but I would like some feedback and discussion:

  1. Libratbag doesn't yet support adding and removing resolutions (see RatbagdProfile needs a way to add and remove resolutions libratbag#211), how do I deal with this in Piper? At the moment, the widgets are there printing a message to stdout.
  2. To draw only one leader in the MouseMap in the resolutions page, I modified the SVG requirements (again...). I'm not particularly happy with this as the list of SVG requirements is already pretty long, but basically I grouped the paths and the little squares they connect to and gave this group the id buttonX-path. Commit fb068e3 should explain itself, I think. If we don't do this, the MouseMap in the resolutions page will draw all the leaders, even those without a "Switch resolution" label next to it.
  3. There is no option to set a resolution as the default; how shall I approach this? The mockups left this out.

I think that's all. Do try it out (any SVG from libratbag/libratbag#182 should work), and let me know what you think of it thus far. It would also be great if someone can test it with a device that supports separate X/Y resolutions, as I cannot do this myself.

@whot
Copy link
Member

whot commented Jul 7, 2017

General comments to your questions, I'll skip 1) because it's in the libratbag issue.

  1. I think grouping them is a good idea and fairly easy to do in inkscape. I think this is just a case of where an SVG evaluation tool needs to catch this early, that way it's the least annoying.

  2. Might be a question for @jimmac, but how about a little tick next to the (x) that works like a radiobutton? it's not really intuitive. The other option would be to have an 'advanced' button that pops up something like the breathing dialog in https://github.com/libratbag/piper/raw/wiki/redesign/leds.png. That dialog could handle the uneven x/y resolutions and include a checkbox for "make this the default resolution". This way you could also switch to equal x/y resolutions in the main window

Hjdskes added 10 commits July 7, 2017 13:40
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
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]: libratbag/libratbag#211
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.
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.
This allows us to selectively draw paths, so that for example in the
resolutions page only the page to the "Switch resolution" labels is
drawn.
Without this, when scrolling through the list over a scale, the scale
will steal the scroll event.
Mice don't do anything more fine-grained than this
@Hjdskes
Copy link
Member Author

Hjdskes commented Jul 7, 2017

@whot I fixed the issues you mentioned on IRC (scrolling over scales stops the scrolling in the list, separate X/Y resolutions being a niche case, hiding configuration when opening another and the scale snapping to multiples of 50). I also extracted the code for the resolutions stack page into its own class.

As for point 2, I updated the instructions in libratbag/libratbag#182 and the current three SVGs in there. That leaves only point 3 (assuming we'll do point 1 later when this is done in libratbag).

@whot whot merged commit 76694f1 into libratbag:rewrite Jul 9, 2017
@whot
Copy link
Member

whot commented Jul 9, 2017

We can track the design for 3 in a separate issue, I think this branch is good enough to merge. Let's do it before it gets too unwieldy or before we get side-tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants