Commit graph

459 commits

Author SHA1 Message Date
Felipe Borges
e8a046765f wacom: Fix typo in UI file property name
Fixes #1777
2022-04-24 12:04:38 +00:00
Felipe Borges
c2f89ef7ba wacom: Mark two more strings as translatable
See c5d0437c0f (note_1433556)
2022-04-20 18:09:21 +02:00
oscfdezdz
c5d0437c0f wacom: mark some strings as translatable
Some UI strings were not marked as translatable when the panel was ported to GTK4.
2022-04-19 16:46:59 +00:00
Carlos Garnacho
0d82613258 wacom: Bring back empty state view
This went mistakenly missing in the recent UI updates. Since this
panel is still accessible through search despite tablet availability,
we should have a proper empty state view when moving to the panel
with no tablets available.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1684
2022-03-04 15:19:21 +00:00
Carlos Garnacho
7371dbb35c wacom: Explicitly discard input from touchscreens
Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1612
2022-02-12 16:03:37 +00:00
Carlos Garnacho
57e5144f41 wacom: Avoid reset on spurious size changes
This is a possible reason for undesired calibration resets.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1613
2022-02-12 16:03:37 +00:00
Carlos Garnacho
3f12a7d2cb wacom: Allow NULL monitors in calibration
Unfortunately, this may be the case, it is better to show wonky UI
than no UI at all.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
6c6499e23e wacom: Pass GdkMonitor directly to calibrator object
Instead of figuring out a monitor number from a GdkMonitor, and
look the GdkMonitor back up, pass the GdkMonitor directly.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
6756710996 wacom: Make calibrator retrieve dimensions from window
So we can fullscreen on a monitor and forget.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
ec5ad4d3e4 wacom: Turn CcCalibArea into a window subclass
Modernize a bit the code, since it will be easier to do some things
as a window subclass.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
fce8b631cc wacom: Rename calibrator API
Add "Cc" prefix so it's more consistent with the rest of the project.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
1777a42aef wacom: Update/unbreak calibrator
It got to a building state in the GTK4 port, but was broken at
runtime. Update event handlers and builder objects so it works again.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
e26ea4e6d1 wacom: Drop dead code
These dimensions are no longer used.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
3d4d785588 wacom: Drop unused API
This function was only used for logging purposes, we can do
without it.
2022-02-12 16:03:37 +00:00
Carlos Garnacho
a9127145d3 wacom: Move tablet/stylus sections to AdwPreferencesGroup
There is now the header-suffix property that makes it possible to add
tablet/stylus icons besides the title/description, so we can simply
use this widget.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
653d66b7a7 wacom: Add description subtitles to tablet devices 2022-02-01 14:18:53 +00:00
Carlos Garnacho
04bb70a5b3 wacom: Add description subtitles to styli 2022-02-01 14:18:53 +00:00
Carlos Garnacho
9bd0b94527 wacom: Use right function to find whether stylus has eraser tip
We are looking for paired styli that act as standalone erasers, this is
not what we are looking for here.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
2bbc1fd2bb wacom: Update tablet images
These had some additional padding that is undesirable in the new
UI. Drop that so things are nicely aligned.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
0379531980 wacom: Restore stylus icons
These images needed updating, this is done separately in this commit.
With this, stylus sections also get a nice icon.
2022-02-01 14:18:53 +00:00
Carlos Garnacho
7806b88460 wacom: Refresh UI
Use libadwaita widgets, and follow recent mockups for this panel.
2022-02-01 14:18:53 +00:00
Jakub Steiner
13376ecb8b Add individual app icons 2022-01-31 14:08:22 +00:00
Georges Basile Stavracas Neto
4300a4a290 panels: Use new CcPanel helpers for title widgets
This should significantly simplify these panels, by not forcing
them to override GObject.constructed all the time. Most panels
were quite straightfoward.
2022-01-20 02:23:42 +00:00
Georges Basile Stavracas Neto
0ab20af9ba panels: Switch to CcPanel content
Start porting panels to the new panel format. This commit
temporarily makes panels have two titlebar, which will be
fixed soon.
2022-01-20 02:23:42 +00:00
Jan Beich
37b29c32cb meson: drop unused argument for i18n.merge_file()
Ignored in Meson < 0.60.0, deprecated since 0.60.1 and fatal since 0.61.0.

panels/applications/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/background/meson.build:10:5: ERROR: Function does not take positional arguments.
panels/camera/meson.build:10:5: ERROR: Function does not take positional arguments.
[...]
2022-01-07 17:22:43 +00:00
Georges Basile Stavracas Neto
d189a67000 flatpak: Update dependencies to GTK4 2021-12-14 22:34:21 -03:00
Georges Basile Stavracas Neto
816e6203e3 wacom: Port to GTK4
Many part of this commit were made by Carlos
Garnacho <carlosg@gnome.org>

WIP wacom: Port to GTK4

Lots of stuff missing and probably broken.

wacom: Port CcDrawingArea input to gestures

We have a handy GtkGestureStylus to use here, which avoids direct
handling of GdkEvents.

wacom: Update current stylus tracking to GtkGestureStylus

Use the ::proximity signal to notice when we are being hovered with
a tablet stylus, and look up the tool from there.
2021-12-14 22:34:21 -03:00
Bastien Nocera
4b1f7011c4 wacom: Add scenario tester
Running the helper will launch gnome-control-center with a mocked Wacom
Cintiq tablet through umockdev when one isn't present or easily available.

The Cintiq was selected as it will trigger showing all the different
buttons Wacom tablets can make the panel spawn.
2021-11-18 14:57:22 +00:00
Bastien Nocera
8ac36f479e wacom: Add a fake stylus when mocking a tablet 2021-11-18 14:57:22 +00:00
Bastien Nocera
a93a023229 wacom: Split off notebook switching for detected stylus
This will reduce code duplication for mocking styli.
2021-11-18 14:57:22 +00:00
Bastien Nocera
d47b9be08a wacom: Print errors for libwacom_new_from_*() calls
This helps with debugging.
2021-11-18 14:57:22 +00:00
Philip Withnall
e522e5e732 wacom: Fix a critical warning if loading a cursor fails
It’s possible for `gdk_cursor_new_for_display()` to return `NULL`. It’s
OK to pass `NULL` to `gdk_window_set_cursor()`, but not OK to then unref
it.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-02 21:41:03 +00:00
Carlos Garnacho
297906685e wacom: Group pad/stylus devices together with the group name
This will cover the regular case of pads attached to a tablet, but
also the EKR case where the pad is a separate device logically
grouped with a tablet.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/415
2020-09-04 21:46:19 +00:00
Carlos Garnacho
eb14c5a64f wacom: Cater for multiple pads in the CcWacomPage
We don't need to track them much specifically, as we delegate pad
button mapping UI on GNOME Shell. It is however possible to have
tablets with 0 to N pads (upper bound within sanity = 2), so we
must at least reflect that in the "Map Buttons..." button visibility.

This distinction is most important for the combination of EKR plus
Cintiq 27QHD, as this is a pad-less tablet, for which we wouldn't
usually show the "Map buttons..." action.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/415
2020-09-04 21:46:19 +00:00
Carlos Garnacho
e50f27a96b wacom: Let CcWacomPage track pad devices
This puts stylus/pad tracking on 2 separate levels. The CcWacomPanel
will look for styli, and treat them as "device leaders", adding a
CcWacomPage for them.

The CcWacomPage will then track the related pad, and update the
"Map buttons..." action visibility according to it.

This simplifies tablet page creation (eg. have it completed in one
step), and decouples the device grouping logic from CcWacomPanel,
which will be useful in future commits.
2020-09-04 21:46:19 +00:00
Yuri Chornoivan
e7050ab6f4 Fix minor typos 2020-07-20 10:38:09 +03:00
Robert Ancell
e6128c9ffd wacom: Connect signals with g_signal_connect_object in swapped form 2020-03-30 16:18:50 +13:00
Carlos Garnacho
7c85d5a871 wacom: Pick libwacom's Generic Pen stylus if tool ID is 0
We generally use tool ID 0 if the ID is actually unknown, libwacom however
assigns 0xfffff to such device. Make it sure we find the "Generic Pen"
stylus description in that case.
2020-02-13 22:15:00 +00:00
Robert Ancell
93b14a4339 panel: Move shared GCancellable code into panel class
Make the panel class provide a cancellable that will be cancelled when the panel
is destroyed. Panel implementations can use this and not have to mangage the
cancellable themselves. Consolidate cases where panels had multiple cancellables
that were all being used for this behaviour.
2020-02-03 09:36:24 +13:00
Carlos Garnacho
edd7f97422 wacom: Avoid poking disposed object
A little above in the function, we update the page UI, maybe destroying
the bits that allow decoupling display-attached tablets from their display.
Later on, we unconditionally update its GtkSwitch.

This can't bode well on tablets where the widget was already destroyed.
2019-12-18 00:24:22 +00:00
Robert Ancell
34cb560009 wacom: Replace ifdefs with #pragma once 2019-11-27 21:56:10 +00:00
Carlos Garnacho
c9ef4fee0f wacom: Snap tip/eraser pressure feel to the allowed values
And add markers for those. We only allow a total of 7 fixed pressure curve
values, so make the UI clear about it.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/483
2019-09-09 22:52:44 +00:00
Carlos Garnacho
a209fed611 wacom: Allow decoupling screen tablets from their respective output
This is useful for 2 cases:
- Tablet-input-driven setups where it makes sense to be able to quickly
  reach other monitors with the tablet.
- (Hopefully a minority) Cases where our display mapping heuristics go
  wrong and tablet gets assigned to a wrong monitor.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/239
2019-09-10 10:47:17 +12:00
Robert Ancell
dab5f5301f wacom: Use g_auto for variables 2019-09-09 22:08:26 +00:00
Georges Basile Stavracas Neto
75f150d5a2 shell: Add position to cc_shell_embed_widget_in_header()
So we can control where the widget should be added to. The
main window only supports left and right positions.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/528
2019-05-21 12:59:36 -03:00
Carlos Garnacho
8f825c5cc0 wacom: Dispose custom style provider with calibrator
Each CalibArea created adds a style provider that is never removed,
remove it on calib_area_free() to avoid the leak.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/504
2019-05-01 16:10:06 +02:00
Carlos Garnacho
dbd78496e1 wacom: Ensure calibrator UI CSS only applies to its UI
Set a name on the fullscreen window, and require it in all selectors
in the custom CSS. Fixes style leaking to other g-c-c bits.

https://gitlab.gnome.org/GNOME/gnome-control-center/issues/504
2019-05-01 16:09:58 +02:00
Carlos Garnacho
4860f3637c wacom: Update "Test your settings" button sensitivity on device availability
The button/popover are meaningless if there's no device to test with. Set
it inactive (so the popover hides if visible) and set insensitive if no
devices are found.
2019-02-12 00:40:14 +00:00
Carlos Garnacho
67c8ef42d7 wacom: Align buttons/links to the left side
Looks more natural this way. All buttons and links have been moved
into the main grid so this is possible. The links additionally had
to be removed all the padding so they actually align visually.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/238
2019-01-07 21:24:15 +00:00
Carlos Garnacho
a4cc9d35b9 wacom: Always try to add the stylus page UI on proximity
This used to be done only if the stylus was "brand new", because pages for
previously known styli are added when the tablet is detected/plugged. There
are however situations where this may break: eg. the stylus was previously
known through a tablet that is not plugged ATM. The tool is however "not
new" so no UI is added for it.

We should try to add the stylus invariably on proximity, add_stylus_page()
ensures there is only one page per tool anyway.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/315
2019-01-05 12:36:59 +00:00