Commit Graph

645 Commits

Author SHA1 Message Date
sizzlesloth
71431bd5de Text box can be used to set DPI (#960)
* Add dpi_entry GtkEntry objects to UI file and Python.
Find and apply closest resolution in self.resolutions.
[Needed?] Store value on textbox focus in.
[Needed?] Do not apply DPI value if the same as previous value.
DPI entry and resolution sliders affect each others' values.

* Remove pointless recursive logic.
Remove focus methods.

* Calculate DPI text box width based on max supported resolution.

* Renamed methods/signals to be consistent with current convention.

* Add a 'focus-in-event' signal to the DPI entry field.
Pass reference to ResolutionsPage when initialising ResolutionRow.
Use reference to invoke `ResolutionsPage._on_row_activated()`.
Do not toggle Revealer on DPI entry text box focus-in-event if Revealer is already expanded.
Grammar: dpi -> DPI

* Add type hints.
Prefix unused vars with underscores.
Actioned suggested import order from linter.

* Actually apply the closest res value (oops).
Apply the res value on focus-out-event.

* Toggle allow editing of DPI entry if 'disable' button clicked.

* Use set_sensitive() on DPI entry.

* rm pointless var.

* Create custom class for DPI text entry to circumvent assertion warning.
Grab DPIEntry focus when revealing ResolutionRow.
Revert import order.
Removed unused 'previous DPI value' var.
Remove 'private' convention underscore from ResolutionsPage._on_row_activate().
Remove callback method for DPI entry on ResolutionRow.
UI file uses DPIEntry.
Remove insert-text signal for DPIEntry from UI file.

* Line lengths

* Removed unused import.
Underscored unused parameter (PEP convention).

* Reverted underscore convention as to not break existing stuff.

* Use underscore convention, but also use it when invoking the method.

* Renamed handler name for ResolutionsPage to match method.

* Clarified docstring.

---------

Co-authored-by: Dan <64416644+brittle-bones@users.noreply.github.com>
2024-07-24 22:17:09 +00:00
czinehuba
71f96db865 data: add Logitech MX Anywhere 3B
Update svg-lookup.ini as image isn't showing for the mx 3 anywhere
business
2024-07-25 00:50:29 +03:00
Vincent Verdier
031c5cc57a Update French translation 2024-07-03 20:48:19 +02:00
NkosenhleDuma
efa2712fcb Update README.md - Using ninja test command
I believe the intended command was `ninja`.
`meson -C ...` gives:
```
meson -C builddir test
usage: meson [-h] {setup,configure,dist,install,introspect,init,test,wrap,subprojects,rewrite,compile,devenv,env2mfile,help} ...
meson: error: unrecognized arguments: -C
```

Whereas `ninja -C builddir test` gives:
```
ninja: Entering directory `builddir'
[0/1] Running all tests.
1/6 piper / validate appdata file        OK              0.02s
2/6 piper / python-ruff-check            SKIP            0.01s   exit status 77
3/6 piper / svg-lookup-check             OK              0.04s
4/6 piper:all / files-in-git             OK              0.08s
5/6 piper / check-svg                    OK              0.09s
6/6 piper / python-black-check           OK              0.32s

Ok:                 5   
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            1   
Timeout:            0   

Full log written to /home/ratbag/Workspace/piper/builddir/meson-logs/testlog.txt
```
2024-06-04 18:38:23 +03:00
Domenico
edd88a208b data: add svg for Glorious Model O/O- 2024-06-04 18:33:05 +03:00
Nadeflore
66c1897540 Add svg for Logitech G705 Mouse 2024-02-18 18:00:45 +01:00
Daniel Levi-Minzi
d553d97b3e add svg for asus rog harpe wireless 2024-01-18 17:06:40 -05:00
BigBoiMan123
8c7cc088c2 Add device image for ASUS ROG Keris Wireless AimPoint 2023-12-23 16:21:17 +03:00
rpachon
c15910bf59 add glorious model-d svg 2023-12-01 14:17:21 +01:00
Yaroslav Chvanov
3c3e3fc240 buttondialog: simplify keyboard grabbing
Following GNOME Control Center. :)

By the way, this does not (and did not) do anything on Wayland, it will
only can only work on Wayland with GDK 4 API.
2023-09-24 20:14:54 +03:00
Yaroslav Chvanov
3411723f4e Refactor some easy typing issues 2023-09-24 20:14:23 +03:00
detiam
e39ebd3d5c Add zh_CN translation 2023-09-19 18:10:29 +03:00
Kyoken
fe95fa3b61 asus: add chakram x svg 2023-09-19 18:06:49 +03:00
Ahmet Sait
dcf6db1c3e Fix blank app icon issues with KDE application launcher 2023-08-30 14:17:26 +03:00
Yaroslav Chvanov
042dd619a3 resolutionrow: disable the "disable" button for the default resolution
Ideally I would like it to also show the reason for example on hover,
but this is already better.
2023-07-18 21:29:07 +03:00
Peter Hutterer
1e426df58e flatpak: sync the flatpak JSON file with the one from flathub
This bumps us 3 GNOME versions up, and updates some of the other
dependencies too.
2023-07-13 08:45:15 +10:00
Peter Hutterer
435152ce2d data: don't make the appstreamcli tool required
We don't want every builder to have to install this.
2023-07-12 09:53:14 +10:00
Peter Hutterer
b8a97fd367 meson.build: fix the ratbagd runtime check
find_program(required: true) exits with the meson error message if the
program is not found so we never get to our pretty error message.
Fix this and make the message an actual error too.

Also indent the else condition correctly while we're here.
2023-07-12 09:53:14 +10:00
Domefemia
c7e1ad8fab Removed unneeded stuff 2023-04-23 18:25:40 +03:00
Domefemia
e4b3f59ebb Replaced multiple comparison with in function 2023-04-23 18:25:40 +03:00
Domefemia
da0056500d Converted strings to f string 2023-04-23 18:25:40 +03:00
Heimen Stoffels
b9527c85c1 po: update the Dutch translation 2023-04-14 13:44:39 +03:00
Yaroslav Chvanov
264dc10bc1 po: add the "advanced" page to translatable files 2023-04-13 13:04:05 +03:00
Heimen Stoffels
9713c86f7e po: update the Dutch translation 2023-04-13 12:43:44 +03:00
Yaroslav Chvanov
a7ae0c6e32 piper: fix an optional access warning 2023-03-20 22:01:51 +03:00
Yaroslav Chvanov
21943b9064 piper: add more missing and fix wrong type hints 2023-03-20 22:01:30 +03:00
Yaroslav Chvanov
e5aae89fc7 mouseperspective: enable the "commit" button if any profile is dirty
..not only the active one.
This fixes the "commit" button not getting active when another profile
is disabled outside of Piper (e.g. ratbagctl).
2023-03-18 21:28:14 +03:00
Yaroslav Chvanov
b7ba399c94 mouseperspective: enable add profile if at least one is disabled 2023-03-09 18:01:29 +03:00
Yaroslav Chvanov
3a30459d76 profilerow: don't allow "deleting" the active profile
I think libratbag doesn't return any kind of error in such case, this is
something to work on.
2023-03-09 18:01:03 +03:00
Yaroslav Chvanov
fc27089d3c mouseperspective: don't ever hide the add profile button in the list
Following my design choice to disable all unavailable actions instead of
hiding them.
Another way to go here would be to move the deleted snippet to
_on_profile_notify_disabled(), so that the button is not hidden after
removing a profile from a full profile list.
2023-03-09 18:00:31 +03:00
Yaroslav Chvanov
ac6e557529 piper: listen to notify::disabled on profiles
It was actually already listening to notify::enabled, so this is a very
simple change.
2023-03-09 18:00:31 +03:00
Yaroslav Chvanov
c69a8a4ea9 ratbagd.py: listen and notify about RatabgdProfile.Disabled changes 2023-03-09 17:37:02 +03:00
Yaroslav Chvanov
05cd7a7031 buttonspage: support BTN_* events in key-type button actions
Technically it can contain moues button events as it's just event codes
under the hood.
2023-03-09 17:12:50 +03:00
Yaroslav Chvanov
e0318b6bfc ratbagd.py: sync with libratbag
Fixes crash on `BTN_*` event codes in macros.
2023-03-09 17:09:36 +03:00
Yaroslav Chvanov
8570535f15 ratbagd.py: notify about external updates to LED properties
Piper was already listening for the `notify::mode` signal, so it now
shows update LED type.
2023-03-06 22:58:01 +03:00
Yaroslav Chvanov
985064bf7b advancedpage: listen for external angle snapping value changes 2023-03-06 22:58:01 +03:00
Yaroslav Chvanov
41a2d1405c ratbagd.py: notify about external angle snapping value changes 2023-03-06 22:58:01 +03:00
Yaroslav Chvanov
d8c0442feb advancedpage: listen for external debounce time updates 2023-03-06 22:58:01 +03:00
Yaroslav Chvanov
797afcc050 ratbagd.py: notify about debounce time changes in the profile 2023-03-06 22:58:01 +03:00
Yaroslav Chvanov
a959d00fb3 ratbagd.py: use try-except when checking changed props on D-Bus
I'd argue this is a bit more Pythonic to do for dicts on top of being
slightly more performant.
Still, I must say all of this repeated handling is kind of ugly.
2023-03-06 22:58:00 +03:00
Yaroslav Chvanov
c96799da74 mouseperspective: show the advanced page if report rates are supported
Should've been a part of cdd1be7095.
2023-03-06 22:58:00 +03:00
Yaroslav Chvanov
d24c7b7b30 advancedpage: listen for external report rate updates 2023-03-06 22:58:00 +03:00
Yaroslav Chvanov
21ccf86af1 ratbagd.py: notify on report rate changes 2023-03-06 22:58:00 +03:00
Yaroslav Chvanov
dfb371ce08 ratbagd.py: update the report rate of the profile
Another regression by me.
2023-03-06 22:58:00 +03:00
Yaroslav Chvanov
5cc09a0dfe resolutionrow: listen for external resolution changes
This adds some duplicated code.
TODO: refactor this file.
2023-03-06 22:58:00 +03:00
Yaroslav Chvanov
6e464692a4 ratbagd.py: notify on external resolution changes 2023-03-06 22:36:09 +03:00
Yaroslav Chvanov
2875e85e28 ratbagd.py: add a helper for getting non-null values from D-Bus
This should probably return a custom exception instead of an ValueError
but it's okay for now.
2023-03-06 22:36:09 +03:00
Yaroslav Chvanov
3f03024259 mouseperspective: update profile list when a profile is set to active
This fixes profile list becoming wrong when you change active profile
with ratbagctl.
2023-03-06 22:36:09 +03:00
Yaroslav Chvanov
3b99861834 ratbagd.py: remove LED types
They were long deprecated and removed in libratbag.
2023-03-06 22:36:09 +03:00
Yaroslav Chvanov
590f80fbc9 piper: make util an explicit namespace 2023-03-06 22:36:09 +03:00