Commit graph

514 commits

Author SHA1 Message Date
Felipe Borges
8efbae3c8f display: Use CcPanel.navigation instead of own navigation view 2024-05-17 09:18:00 +00:00
Matthijs Velsink
e7252dba4c display: Remove unsupported action from .ui file
Actions can be set in .ui files, but not callback actions. That's done
in the .c file anyways, but it was also put in the .ui file.

That used to be ignored, but since gtk!7121 that will generate a
warning.

So, remove that line.

Closes #3050
2024-05-08 18:04:41 +02:00
Automeris naranja
4de38989f0 display: Add an icon to the Night Light row 2024-05-01 14:36:09 +00:00
Automeris naranja
74c183f3f4 display, night-light: Remove "infobar_unsupported" leftover
"infobar_unsupported" GtkInfoBar was supposed to be removed
in [1], but was accidentally re-added during the code review.

[1] 909f068672
2024-04-29 08:55:13 +00:00
Automeris naranja
ac40bcb7cb night-light-page: Add a missing period
According to [1], the string "This could be the result of
the graphics driver being used, or the desktop being used
remotely" should end with a period. This wasn't addressed
in [2], so add the period to fix this issue.

[1] https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2020
[2] 909f068672
2024-04-25 21:38:33 -03:00
Felipe Borges
0e2073c474 display, night-light: Simplify status page description condition 2024-04-25 10:32:18 +02:00
Automeris naranja
909f068672 display, night-light: Use AdwStatusPage when night light is unavailable
Night light can be unavailable in three cases:

- Device being used remotely
- Unsupported graphics driver
- Using a virtual machine

In all of these cases, a GtkInfoBar is shown. However, GtkInfoBar is
deprecated. AdwBanner is the replacement, but it's meant for short
text and the text explaining the three cases above is quite long for
AdwBanner. AdwStatusPage can be used with longer text, so use it.
2024-04-25 10:32:18 +02:00
Matthijs Velsink
e7e9753aac display: Fix crash due to shortcut propagation phase
For a managed GtkShortcutController, changing its propagation phase
away from `GTK_PHASE_BUBBLE` currently results in a lingering reference
due to a bug in GTK (gtk#6246). This means the Escape key shortcut
remains active even after leaving the Display panel, resulting in a
crash when pressing Escape in any panel after leaving the Display panel.

This is now fixed in GTK (gtk!7115), but there seems to be no reason for
changing the propagation phase at all anyways. Since the callback
returns `GDK_EVENT_PROPAGATE` when it does not activate, the event
should still make it to other handlers.

So, to speed up the fix for gnome-control-center, we remove the
propagation phase changes althogether. There is also no need to let the
shortcut have global scope, managed is enough.

Closes #2768
2024-04-19 09:15:04 +00:00
Dor Askayo
3b6ed64196 display: Show the VRR range when possible
Show the full VRR (Variable Refresh Rate) range of a monitor in the
refresh rate expander row when a variable refresh rate mode is
selected and the minimum refresh rate of the monitor is known.
2024-03-02 20:14:38 +02:00
Dor Askayo
a4de91fb38 display: Add support for Variable Refresh Rate modes
This adds an expander row to allow configuration of display modes
based on whether they have a "fixed" or "variable" refresh rate.
2024-03-02 18:10:02 +00:00
Dor Askayo
63a957591c display-config: Use separate variables to get the closest mode
This will allow reusing the function in a following commit.

No change in behavior.
2024-03-02 18:10:02 +00:00
Dor Askayo
c454430220 display-config: Rename variables for clarity
This make it easier to modify this function in a following commit.

No change in behavior.
2024-03-02 18:10:02 +00:00
Automeris naranja
a02b47dadf night-light-page: Move page description to AdwPreferencesPage
The page description is inside an AdwPreferencesGroup,
which is wrong.
2024-02-21 08:34:38 +00:00
Automeris naranja
d997c6e0fa general: Remove "activatable" property from some CcListRows
The CcListRow template already sets the row
as activatable[1].

[1] https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/gnome-45/panels/common/cc-list-row.ui?ref_type=heads#L4
2024-02-20 07:32:37 +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
cd911dfa5d display: Use CcHostname to detect when running in a VM
Instead of a manual call to system-hostnamed to obtain the chassis-type
and compare whether it is equal to "vm".
2024-01-30 13:34:10 +00:00
Hari Rana
d1e31430a1 display-settings: Port to AdwSwitchRow 2024-01-08 10:05:45 +00:00
Hari Rana
afc690cb74 night-light-page: Port to AdwSwitchRow 2024-01-08 09:57:13 +00:00
Automeris naranja
f588b1ce3f night-light-page: Add missing mnemonics
Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541
2023-11-27 09:51:46 +00:00
Automeris naranja
33b45a6bf7 display-settings: Add missing mnemonics
Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541
2023-11-27 09:51:46 +00:00
Automeris naranja
c2a7e2e4ab display: Add missing mnemonics
Partially fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2541
2023-11-27 09:51:46 +00:00
Sam Hewitt
b244370368 display: Use tabular numbers for monitor-label; de-duplicate css 2023-11-02 10:05:21 +00:00
Marco Melorio
d91f9381f9 misc: Remove unused variables 2023-10-12 10:09:44 +02:00
Alice Mikhaylenko
7127c4373d display: Ellipsize the apply/cancel buttons 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
909c1fc51b display: Reduce the preview width 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
4680f362f3 Port to AdwNavigationSplitView 2023-08-25 08:00:43 +00:00
Alice Mikhaylenko
df06d76eab display: Port to AdwNavigationView and AdwToolbarView
Duplicate the apply titlebar between pages. This should really be
redesigned.
2023-08-25 08:00:43 +00:00
Lukáš Tyrychtr
ba79d849af displays: Use an AdwComboRow for the schedule type of the night light page
GtkComboBox is deprecated and not accessible, so this one is definitely better from this point of view.
2023-07-18 08:29:43 +00:00
Dirk Su
b7c0c42317 Check best_mode exist before adding flag
When there is no compatible clone mode, the best_mode will be NULL
. It will cause gnome-control-center crash when access to the
variable.
2023-06-27 23:34:23 +00:00
Robert Ancell
82ef9d6f05 display: Connect signal handlers in swapped form 2023-06-07 09:12:54 +12:00
sunflowerskater
266c55715a general: Add tooltips to headerbar controls
Acc. HIG, "controls in the header bars of primary windows should all have tooltips".

https://developer.gnome.org/hig/patterns/feedback/tooltips.html
2023-06-06 13:27:00 +00:00
Robert Ancell
c7ce4e8962 display: Fix name of parent class variable 2023-06-06 07:54:38 +00:00
Timotej Šulík
8bf042cf56 display: Fix invalid panel state after canceling changes
When switching from Mirror mode to Join mode
and opening a monitor leaflet child by clicking
its row, clicking Cancel on the title bar would
get the UI into an invalid state.

Closes #2513.
2023-06-01 08:30:20 +00:00
Robert Ancell
f756184e3b display: Do signal handlers in swapped form 2023-05-30 08:36:22 +00:00
Timotej Šulík
4102a16b40 display: Fix stuck window subtitle in the Displays panel
In case an inapplicable display configuration
is attempted, and the issue is then resolved,
the warning window subtitle remains displayed
even under the "Apply Changes?" title.

Closes #2512.
2023-05-30 00:58:16 +02:00
Timotej Šulík
4fe26944d8 display: Fix gaps when numbering unusable displays 2023-05-28 22:16:10 +00:00
Timotej Šulík
4ed1af010a display: Allow mirroring for any number of displays 2023-05-25 21:35:30 +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
Chris Mayo
92c4b6a706 Fix panel crashes due to unknown types in UI descriptions
Error building template class 'CcSearchPanel' for an instance of type 'CcSearchPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcDisplayPanel' for an instance of type 'CcDisplayPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcMousePanel' for an instance of type 'CcMousePanel': .:0:0 Invalid object type 'CcIllustratedRow'

Error building template class 'CcKeyboardPanel' for an instance of type 'CcKeyboardPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcRegionPanel' for an instance of type 'CcRegionPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcUaPanel' for an instance of type 'CcUaPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcUserPanel' for an instance of type 'CcUserPanel': .:0:0 Invalid object type 'CcAvatarChooser'
Error building template class 'CcUserPanel' for an instance of type 'CcUserPanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcDateTimePanel' for an instance of type 'CcDateTimePanel': .:0:0 Invalid object type 'CcTzDialog'
cc_tz_dialog_get_selected_location: assertion 'CC_IS_TZ_DIALOG (self)' failed
dumped core
Error building template class 'CcDateTimePanel' for an instance of type 'CcDateTimePanel': .:0:0 Invalid object type 'CcListRow'

Error building template class 'CcInfoOverviewPanel' for an instance of type 'CcInfoOverviewPanel': .:0:0 Invalid object type 'CcHostnameEntry'
2023-04-17 12:14:58 +00:00
Automeris naranja
fe5257bc9e general: Remove a11y labels when they aren't needed
A11y labels aren't needed when using the "activatable-widget"
property, because the relation is set automatically:

https://gitlab.gnome.org/GNOME/libadwaita/-/blob/main/src/adw-action-row.c#L661
2023-04-12 18:34:20 -03:00
Timotej Šulík
4702757b93 display: Fix display enabled toggle visibility 2023-04-11 12:16:54 +00:00
Emad Saadat
ce9c7c289a
display: Make nightlight widgets clamped to same size as other panels
by using an AdwPreferencesPage instead of a plain GtkBox. And also
move disabled infobar out of night_light_settings.
2023-04-06 00:38:32 -07:00
Jonas Ådahl
e561f32d9c display/night-light: Don't leak config manager proxy 2023-04-04 13:39:36 +00:00
Jonas Ådahl
80af5137c1 display/night-light: Disconnect config manager changed handler
Use g_signal_connect_object() to automatically disconnect the signal
handle when the listener object gets destroyed.

Closes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2333
2023-04-04 13:39:36 +00:00
Emilia Daria Majewska
4bfa57887b display: Removed the loop from the snapping function
In all my tests, the snapping algorithm was successful on the first pass.
2023-03-23 15:52:15 +00:00
Emilia Daria Majewska
4218aa6e4b display: Remove the monitor argument for cc_display_config_snap_output
The function tries to snap all the outputs anyway,
so might as well remove the unnecessary argument.
2023-03-23 15:52:15 +00:00
Emilia Daria Majewska
0aede82e58 display: Try snapping all the displays after a config change
This issue was originally addressed in !257 ("display snap after changes").
However it only dealt with a two-monitor setup, so the user is still
unable to rotate the middle display with three or more monitors.

This commit tries to snap the displays until all are adjacent to
another.
2023-03-23 15:52:15 +00:00
Marco Trevisan (Treviño)
852b39cdc6 dispaly: Allow configuring all monitors and apply settings at once
When multiple monitors are available, it's not possible anymore to
configure them all and eventually apply all the changed parameters.

To make this possible again, add a back button in the apply titlebar
that is shown only when we are in the display-settings child.

See: https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/2012043
2023-03-21 15:33:16 +00:00
Markus Göllnitz
98f7a40d24 multiple panels: show start title buttons in header bar
The start title buttons of the main window should be displayed if and
only if the end title buttons are. Only the left-most header bar should have
the start title button set and only right-most header bar the end title buttons.

Therefore, the title buttons property should be bound to the leaflet state:
When unfolded the start title buttons of the sidebar's header bar are
the only ones visible then, and not a second pair in the panel's header bar.
Likewise, in a folded state of the leaflet, the panel's header bar displays
all availble title buttons – start and end – as the panel is the only widget
displaying a header bar.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2023-03-16 13:18:37 +00:00
Jan Pokorný
705ff06d64 display: Add 32:9 to known aspect ratios
Resolution dropdown previously did not show an aspect ratio hint for
32:9 resolutions. This adds the 32:9 aspect ratio to recognized ones.

Fixes #2334
2023-02-09 14:08:46 +00:00