Commit graph

264 commits

Author SHA1 Message Date
Sam Hewitt
a5f6efaddb Update and clean up symbolic icon assets
- refresh the symbolic icons to sync some style changes and update the source sheet
- rename assets for the privacy subpanel's symbolic icons
- delete deprecated/unused symbolic icons
- add new icon for system panel
- add new icon for remote desktop so it isn't using displays icons
2024-02-10 16:17:35 +00:00
Automeris naranja
9209f5f149 power: Ship "info-symbolic" icon as a gresource
The Power panel currently installs "info-symbolic"
in /usr/share/icons, which makes this icon to appear
as a pre-installed system icon. This makes app
developers to use this icon in their apps
under that assumption.

Ship this icon as a gresource to fix this.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2865
2024-02-08 10:20:36 +00:00
Matthijs Velsink
3a253bc4b1 general: Use g_clear_handle_id to remove GSources
Using `g_clear_handle_id()` in combination with `g_source_remove()` can
save a lot of boiler plate code.

This removes about 110 lines of code for free.
2024-02-06 09:22:07 +00:00
Felipe Borges
e924a830b4 common: Make CcHostnameEntry use CcHostname to access hostnamed 2024-01-30 13:34:10 +00:00
Felipe Borges
8def72a266 common: Introduce CcHostname
This object allows for panels to interact with systemd-hostnamed over
DBus using a simple API that abstracts the GVariant and DBus specifics
involved.
2024-01-30 13:34:10 +00:00
Automeris naranja
b1d1302053 general: Remove a11y labels from buttons that have tooltips
Orca also reads tooltips, so having both a11y labels
and tooltips is redundant.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2023#note_1915854
2024-01-30 13:28:48 +00:00
Carlos Garnacho
17d8013769 common: Query Virtual core pointer for currently used tablet
This code does not work as expected in X11, since the GdkDevice
that GTK gives us is the Virtual core pointer, and not the hardware
device that is driving it at the moment.

Since there's no way to ask for this information to GTK4, query
XI2 indirectly about it, by checking the source device that the
Virtual core pointer inherited its XIValuatorClass classes from
(e.g. pressure), then querying that source device /dev node path.
2023-12-20 20:57:52 +01:00
Automeris naranja
3febca7bb2 cc-list-row-info-button: Add tooltip to the "More Information" button 2023-11-29 10:12:30 +00:00
Lukáš Tyrychtr
5d24919f14 common: Mark a string as not containing printf specifiers
The gettext heuristic was erroneously marking one of the date strings as
printf format ones, so it could not get translated properly.

Fixes #2761
2023-11-22 10:40:45 +01:00
Automeris naranja
0a0a7bb881 cc-list-row: Add use-underline property 2023-11-13 09:55:36 +00:00
Automeris naranja
47ab556b57 cc-split-row: Add use-underline property
Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/2004>
2023-11-06 17:46:25 +00:00
Marco Melorio
b136406210 cc-split-row: Reduce GtkPicture horizontal margins to avoid blurriness
There is a difference between the aspect ratio of the CCSplitRow widget
and the videos from the Mouse & Touchpad panel, which causes the videos
to appear blurry.

This change reduces the video margins so they can better align with the pixel grid.
See also: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1960#note_1869031

Part-of: <https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1960>

Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2631
2023-10-20 10:24:27 +00:00
Marco Melorio
2fc0e26d79 illustrated-row: Use correct property to scale down image
This widget was using halign instead of content-fit to scale down the
image to the correct resolution, and it was making the image blurry in
some cases.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2382.
2023-10-10 12:39:39 +00:00
Alice Mikhaylenko
ec8a2c8b6d split-row: Add :compact property
Allow to make split rows vertical.
2023-08-25 08:00:43 +00:00
Felipe Borges
ef359060ee common: Fix "selectable" state of the ListRow InfoButton
Originally the screen reader wasn't reading the text of the label
within the popover. It read when we set label.selectable = True.
That had the side-effect of making the label have the visual look
of a selectable label (as expected).

This hack unsets the selectable state of the popover when it is
visible, but that still allows the screen reader to read the label.

Fixes #2508
2023-08-22 11:53:44 +02:00
Cyber Phantom
9b6993607f info-overview: Show each graphics device in it's own row
Part 1:

Currently all graphics devices have to share a single row for their names, this method doesn't pretty well for devices with long names or computers that may have multiple GPUs.
The new mockup fixes this by having a separate entry for each graphics device.

This commit turns graphics_row into a GtkBox, graphics_row is going to act like a space where gpu entries will be placed.
graphics_row will be populated in the code using create_graphics_row() to have separate entries for each graphics device

Part 2:

Currently all graphics devices have to share a single row for their names, this method doesn't pretty well for devices with l>
The new	mockup fixes this by having a separate entry for each graphics device.

This commit adds a method to popuplate graphics_row with GPU information entries.
It uses the existing logic from get_renderer_from_switcheroo to iterate over a list of graphics devices and build a CcInfoEntry for each device.
It finally appends the widget to graphics_row

Part 3:

Currently all graphics devices have to share a single row for their names, this method doesn't pretty well for devices with l>
The new mockup fixes this by having a separate entry for each graphics device.

The list of graphics devices is now processed in create_graphics_rows function, so remove that logic from get_renderer_from_switcheroo () and return a GSList instead of a string.
graphics_hardware_string has been renamed to graphics_hardware_list to imply the change.
Since create_graphics_rows expects a list, get_graphics_hardware method has been modified to create a renderer list from the outputs of get_renderer_from_session or get_renderer_from_helper in case that get_renderer_from_switcheroo fails.
2023-07-17 09:25:26 +00:00
Felipe Borges
5bc8ffe8e0 common: Handle when CcPermissionInfobar doesn't have a GPermission
The widget should default to showing the error message when its
missing its respective GPermission object, instead of throwing
a critical error message.

We also hide the "Unlock" button when there's no GPermission set.

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1708
2023-07-12 15:57:06 +00:00
Felipe Borges
9ff812f6e8 common: Add default title to Permission Infobar
Whenever there isn't a GPermission set, the infobar should show
"Error: some settings cannot be unlocked".

See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1708#note_1742075
2023-07-12 15:57:06 +00:00
Marco Melorio
2a33247f52 common: Remove switch feature to CcListRow
AdwSwitchRow should be used now instead.
2023-06-30 09:06:56 +00:00
Robert Ancell
88d0cba1e6 common: Connect signal handlers in swapped form 2023-06-07 09:12:54 +12:00
Felipe Borges
f444852449 common: Fix name of internal InfoButton get/set functions
This was a copy-pasta mistake when creating the CcListRowInfoButton
class from the CcListRow class.

The mistake was harmless but fixing it is good for the sake of
consistency and to avoid confusion in backtraces.
2023-05-31 21:34:03 +00:00
Robert Ancell
426f9a9302 common: Do signal handlers in swapped form 2023-05-30 08:36:22 +00:00
Felipe Borges
bb351a1b51 common: Fix time entry for RTL languages
While GTK will flip most things for RTL languages, that shouldn't be
the case for displaying time.

These changes make sure that the time-entry/editor behave as expected
in RTL languages.

Fixes #2504
2023-05-26 01:03:45 +00:00
Lukáš Tyrychtr
3f47fd0dea common: Make the info button labels selectable
That allows a screen reader to read the information, which was previously
unreachable in any meaningful way.
2023-05-24 12:55:12 +02:00
Lukáš Tyrychtr
41cb03db76 a11y: Present the checked state on the list row itself
That allows the visually impaired user to get the information quicker,
and, as a result of that, we can simplify the focus chain as well.
2023-05-24 09:04:02 +00:00
Pablo Correa Gómez
7f7b65545c all: meson: do not specify resources from gresource files as dependencies
Meson extracts them by itself and add them as dependencies for the target.
It means one less location to keep track of files, and a lot less boilerplate
around the meson files
2023-05-24 08:34:14 +00:00
Felipe Borges
00a71d46da common: Introduce CcListRowInfoButton widget
This simplifies the display of additional text information for our
rows.

See #1571
2023-05-16 13:32:21 +00:00
sunflowerskater
c95dcf2a9a general: Add placeholder text to various search entries
Acc. HIG, "text fields should have placeholder text or a label".

https://developer.gnome.org/hig/patterns/controls/text-fields.html

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2190
2023-04-21 12:40:42 +00:00
Felipe Borges
7e12d653ba common: Don't set the CcHostnameEntry widget sensitivity twice 2023-04-20 14:08:29 +00:00
Christopher Davis
d25c0e345d general: Use AdwBanner in CcPermissionInfobar
AdwBanner is a new adaptive widget that replaces GtkInfoBar.
AdwBanner adapts better to mobile sizes and has an API
that fits with how we use infobars.

This commit changes CcPermissionInfobar to use an AdwBanner
internally instead of a GtkInfoBar. It also re-implements
part of GtkLockButton, as AdwBanner does not support adding
arbitrary widgets.
2023-04-11 12:23:16 +00:00
Sayan Bhattacharjee
0524a6eee6 info-overview: Show each GPU in it's own line
When having multiple GPUs, each GPUs are now seperated by a newline
instead of the previously used seperator: " / ".
This particular fix works ONLY for systems that use switcheroo-control.

Also, this commit allows the 'secondary_label' of 'CcListRow' to have
'lines' set to '4' and 'wrap' to 'True', along with 'hexpand'
and 'halign' set to 'True' to accommodate long strings on all labels
which previously suffered from a issue of getting truncated if
the strings are too long.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2125
2023-04-11 11:20:28 +00:00
Maksym Hazevych
e00f773b2f Remove unnecessary visibility change 2023-03-29 14:26:55 +13:00
Maksym Hazevych
d831e5cb48 Replace all occurrences of 'gtk_widget_show'
Replace all occurrences of 'gtk_widget_show(smth)' with
'gtk_widget_set_visible(smth, TRUE)'.
2023-03-29 14:26:55 +13:00
Marco Trevisan (Treviño)
da0f0ec021 illustrated-row, split-row: Add widget name and css class
It's not possible to theme them right now, while it could be useful so
make them more recognizable in the widget tree.
2023-03-28 13:52:12 +00:00
Marco Trevisan (Treviño)
81c1bf437c split-row / illustrated-row: Keep track of the resources path
We pass to the setter a const char* but we don't control the ownership
of that and it may be returned later from the property getter.

While this is not causing any crash right now, going in the inspector
and try to check the property leads to some scrambled chars which seems
an indication of a memory error.

In general the string passed to these APIs could come from anywhere and
it's not guaranteed that it's always a constant string (and in fact is
not in some cases).
2023-03-23 22:58:56 +00:00
Mohammed Sadiq
f0f1ee168f common: hostname-entry: Update hostname only after apply is clicked
Since the entry already shows an apply button, update hostname only
after the apply button is clicked.  It's not required to update
hostname after every character change.
2023-03-15 13:37:15 +00:00
Felipe Borges
75e92da6d2 common: Use GtkPicture for CcSplitRow and CcIllustrationRow videos
So we can preserve the aspect-ratio.

Fixes #2345
2023-02-17 02:09:50 +00:00
Felipe Borges
6b4e8ca316 common: Pause CcSplitRow/CcIllustrated videos when pointer leaves
Fixes #2346
2023-02-17 00:48:51 +00:00
Felipe Borges
42cfa6dcb5 common: Introduce CcSplitRow 2023-02-14 13:31:23 -03:00
Felipe Borges
c4e569610d common, multitasking: Introduce CcIllustratedRow
The CcIllustratedRow is a generalization of CcMultitaskingRow to
be used later in the Mouse settings.
2023-02-14 13:31:23 -03:00
Felipe Borges
9871a09143 common, info-overview, sharing: Use AdwEntryRow for Hostname entries
See mockups in https://gitlab.gnome.org/Teams/Design/settings-mockups/-/issues/48
2022-12-13 16:16:08 +00:00
Mohammed Sadiq
c917fa73c3 common: Don't Handle list-row switch state manually
This was a hack added for libhandy-0, which is no longer required.
Also, this hack results in the switch not working when gtk animations
are turned off.
2022-11-18 04:08:22 +00:00
Kate Hsuan
fbafcc77a0 firmware-security: improve datetime format parsing
Showing the datetime string using cc_util_get_smart_date_time().
2022-10-25 23:49:16 +00:00
Kate Hsuan
df2bd37837 panels: cc-util: a smart date time
Convert the DateTime to string with time.
The format will be:
smart_date, \%X
2022-10-25 23:49:16 +00:00
Mohammed Sadiq
ff39de678b common: time-editor: Fix initial AM/PM label value
We set AM/PM label on format change in init(),
but we shall not have set the time in the editor
in init() which results in wrong label if the time
is PM.

Fix it by updating clock label after time changes
2022-08-14 21:34:07 +05:30
Mohammed Sadiq
57c919b7d9 common: time-entry: Emit time-changed on time change 2022-08-14 21:33:52 +05:30
Jan Tojnar
7c4428eb59 region: Fix creating rows for locales without country
When creating a language row for Esperanto (eo.UTF-8), gnome-desktop throws a critical:

    gnome_get_country_from_code: assertion 'code != NULL' failed
2022-05-26 19:05:16 +00:00
Pablo Correa Gómez
42cb548115 common: Wrap CcPermissionInfobar labels to fit in narrower screens 2022-05-10 04:37:42 +00:00
Dor Askayo
9401881a38 common: Add a missing dependency on cc-common-resources.h
cc-common-resources.h is used by both libwidgets and liblanguage, and
so must be generated before they build. However, Meson wasn't aware
of this dependency which resulted in a race condition during build.

Conveniently, "generates_sources_dep" already contains other generated
sources used by these two libraries, so adding cc-common-resources.h
to this list is enough to declare the dependency.
2022-02-25 16:10:58 +00:00
Georges Basile Stavracas Neto
c591ab3f77 common: Slightly increase default width of CcLanguageChooser
So it doesn't cut the title label in Portuguese.
2022-02-07 07:03:42 -03:00