Commit graph

678 commits

Author SHA1 Message Date
Carlos Garnacho
7196e8aaea shell: Avoid handling map events from other windows
The CcWindow tries to unset the focus when first mapping the window.
However this pretty wide check intercepts mapping events from other
windows than the toplevel (e.g. subsurfaces, for popovers). This
causes the focus to move away from the popover, overriding its
modality.

Check that the event received is addressed to the CcWindow's
GDK window before unsetting the focus, so we don't mess with popover
focus.

Fixes: https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1327
2021-04-21 20:54:06 +02:00
Ian Douglas Scott
b804fdb01a shell: Fix bug when multiple panels use custom sidebar widget
This is not currently a problem because the feature is only used in the
Applications panel, but this fixes the behavior if a custom sidebar is used
in more than one panel.
2021-04-19 14:31:44 +00:00
Felix Riemann
c6bde9770d help-overlay: Show correct 'Back' shortcut in RTL locales
The 'Back' shortcut automatically switches to Alt+Right in RTL locales.
Add direction properties to achieve the same effect in the help overlay.

Fixes #939.
2021-02-01 03:41:33 +00:00
Adrien Plazas
9ef266eda5 data: List compatible form-factors
This will allow the app to be available in Phosh and PureOS Store.
2020-11-11 19:57:58 +00:00
Ian Douglas Scott
f4f44f511e shell: Do not show panel description by default
01874f7 added this `gtk_widget_show (label)` call, which seems to be
erroneous. The previous `g_object_new()` call had `"visible", FALSE,`.

It should only be shown when searching panels. This fixes that,
restoring the older behavior.
2020-10-29 20:22:58 +00:00
Robert Ancell
01874f7650 shell: Replace g_object_new with gtk widget methods
This improves compile time type checking.
2020-10-19 04:07:53 +00:00
Adrien Plazas
fd60c313df Stop using HANDY_USE_UNSTABLE_API
It isn't needed anymore since libhandy 0.90.0.
2020-08-18 02:51:04 +00:00
Yuri Chornoivan
e7050ab6f4 Fix minor typos 2020-07-20 10:38:09 +03:00
Adrien Plazas
0c9b828d6f window: Use HdyLeaflet:folded
Replace the dropped fold enum property by the folded boolean one, and
directly bind booleans in UI files where possible.
2020-07-20 08:05:45 +02:00
Adrien Plazas
080e145e23 window: Use HdyHeaderGroup:decorate-all
Replace the dropped focus property by the decorate-all boolean one.
2020-07-20 08:04:28 +02:00
Adrien Plazas
3f20b9b572 window: Use HdyLeaflet:transition-type
Replace the dropped mode and child specific transition type properties
by the unified one.
2020-07-20 08:04:28 +02:00
Adrien Plazas
726684e9e0 Adapt to changes in hdy_init()
It must now be called after initializing GTK, and doesn't take
parameters.
2020-07-20 08:04:28 +02:00
Adrien Plazas
611ffdbe7d window: Fix a typo in a comment 2020-07-03 10:07:58 +02:00
Robert Ancell
60875cc4f2 shell: Don't use the OnlyShowIn/NotShowIn flags from desktop files to hide panels
It was added in 3e04b1c53b to allow downstreams to hide panels that don't make
sense in their environment. Later on the ability for panels to hide themselves
was added in a78cbe3963, which is a better solution for this case.

The current situation is confusing if you are not a known environment, as then no
panels show.

Fixes #163
2020-02-17 23:23:25 +00:00
Robert Ancell
de2b8f305a shell: Remove dead code 2020-02-10 11:19:23 +13: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
Georges Basile Stavracas Neto
86a8ecb705 panel-list: Temporarily move the Network panel to below Wi-Fi
This is until we merge the Network, Wi-Fi, and Mobile Broadband
panels.
2020-01-06 15:15:30 +00:00
Georges Basile Stavracas Neto
aa98bf47da panel-list: Move Thunderbolt to the Privacy section 2020-01-06 15:15:30 +00:00
Georges Basile Stavracas Neto
5f640b9903 panel-list: Reorganize Devices section
Move the Power and Sound panel to there.
2020-01-06 15:15:30 +00:00
Georges Basile Stavracas Neto
a99ad542ae panel-list: Remove the Devices subsection
Same case of the Details subsection, it's now part of the
main list.
2020-01-06 15:15:30 +00:00
Georges Basile Stavracas Neto
e7f221e1b9 panel-list: Reorganize panel order 2020-01-06 15:15:30 +00:00
Georges Basile Stavracas Neto
64756d6b08 region, universal-access: Move to the Details section
They need to have their desktop files updated too.
2020-01-06 15:15:30 +00:00
Georges Basile Stavracas Neto
f0d246a8b0 panel-list: Remove Details subsection
As per the latest mockups, the Details section is a toplevel
section, and not an actual subsection.

Remove all the code that implemented Details as a subsection,
and simply treat these panels as toplevel ones.
2020-01-06 15:15:30 +00:00
Robert Ancell
5dbbc20918 shell: Show the submenu icon hint for the applications panel
The panel swarms details/devices/privacy show this icon. Since the applications
panel is not made from sub-panels, this doesn't show. For consistency this shows
the icon so the transition isn't as jarring for the user.

Add a flat into the panel .desktop file to enable this - other panels might
require this in the future
2019-11-28 11:20:41 +13:00
Robert Ancell
d16cddeccf shell: Replace ifdefs with #pragma once 2019-11-27 21:56:09 +00:00
Robert Ancell
19ccad96ae Whitespace fixes for g_autoptr coding style 2019-11-08 09:42:10 +13:00
Georges Basile Stavracas Neto
aed05547f3 panel-list: Reorganize panel order
This does not currently implements all the changes
in panel order defined by the latest mockups [1],
but only moves Privacy and Applications to their
appropriate places.

[1] https://gitlab.gnome.org/Teams/Design/settings-mockups/blob/master/shell/settings-cleanup.png
2019-11-07 14:40:07 +13:00
Georges Basile Stavracas Neto
e677539b28 panel-list: Only use panel id to sort
Right now, the sort function checks for two different
fields when comparing panel rows: the category of the
row, and the id of the panel. When comparing using the
category, it relies on the order of the enum values of
CcPanelCategory. When comparing by panel ids, it uses
the hardcoded positions defined in the 'panel_order'
array.

Using categories, however, is unecessary for our case,
and makes sorting a tad more complicated than it should
be.

Remove the category comparison of the sort function, and
rely only on the positions defined in 'panel_order'.
2019-11-07 14:40:07 +13:00
Matthias Clasen
a4bdc37760 Remove the privacy panel
It has been turned into a herd of panels.
2019-11-07 14:40:07 +13:00
Matthias Clasen
13a4f9a2af Add a diagnostic panel
This is a broken out version of the privacy panel dialog.
2019-11-07 14:40:06 +13:00
Matthias Clasen
3860a2e2af shell: Add a new privacy section
This will be filled out in the next commits.

Probably doesn't build because it includes all the type funcs.
2019-11-07 14:19:23 +13:00
Ian Santopietro
3493b50be9 Use @theme_fg_color for .drag-handle
Instead of using @borders for drag handles, we use @theme_fg_color at 40% opacity. Because these are widgets intended to be interacted with by users instead of drawing borders, we should use a semantically appropriate color which updates according to whether a user has a dark theme selected or not. This ensures that the drag handles contrast with the background no matter what stylesheet the user is using.

This improves the contrast of these widgets in the light theme from 1.7:1 to 2.9:1, which is still rather low, but greatly improves the usability of these widgets without having too large an impact on the look of the widgets in-situ. The contrast ratio is unchanged in the HighContrast style (4.0:1).

This also improves the situation if we eventually adopt a dark style preference for users, and improves the portability of the application.
2019-10-15 18:54:30 +00:00
Felipe Borges
ad83235bf9 shell: Use a meson option to determine that we're in a sandbox 2019-10-14 20:25:39 +00:00
Robert Ancell
9a2e821fe5 Initialize autoptr values to NULL.
These cases were safe, but if the code changed this risked freeing uninitialized
memory.
2019-10-03 10:58:38 +13:00
Robert Ancell
c6965d9e30 shell: Use g_autofree for strings 2019-10-02 17:04:15 +00:00
Robert Ancell
92e1abf6f2 log: Replace deprecated functions with modern equivalents 2019-09-30 14:31:39 +00:00
Robert Ancell
d99613a320 window: Use self variable name consistently 2019-09-23 14:00:42 +00:00
Robert Ancell
bb9fe942d1 window: Connect signals in swapped form 2019-09-23 14:00:42 +00:00
Robert Ancell
a80fc89f48 window: Use GTK+ widget types 2019-09-23 14:00:42 +00:00
Robert Ancell
d843802f98 window: Remove unused variables 2019-09-23 14:00:42 +00:00
Robert Ancell
c2567b9c3e window: Replace child names with widget references
Using child names can cause code to be broken if a name is changed - this wont
be picked up as an error in the compiler.
2019-09-23 14:00:42 +00:00
Mohammed Sadiq
62c7176304 window: Set sidebar as the default visible child
This doesn't make any difference when the UI isn't folded.
Otherwise (Eg., on small screens) the sidebar will be shown
first instead of some panel.
2019-09-21 03:43:34 +00:00
Josselin Mouette
68d5b340c0 gnome-control-center.desktop: Use the "Settings" category
Use the "Settings" category instead of "System"
as per mentioned in spec-file [1].

Cherry-picked from debian packaging for g-c-c [2].

[1] https://standards.freedesktop.org/menu-spec/latest/apa.html
[2] https://salsa.debian.org/gnome-team/gnome-control-center/blob/debian/1%253.34.0.1-1/debian/patches/01_menu_category.patch
2019-09-13 13:57:30 +00:00
Robert Ancell
1f34dd67dd info: Split removable-media into its own panel 2019-09-09 21:52:07 +00:00
Robert Ancell
e743b8efd7 info: Split default-apps into its own panel 2019-09-09 21:52:07 +00:00
Mohammed Sadiq
661df1b683 window: Disable selection when panel list is folded
When the panel list is folded, either the panel items list or the
panel itself is shown, not both.  And when the list is shown it
doesn’t mean anything for an item to be marked as selected.
2019-08-27 13:26:21 +00:00
Ting-Wei Lan
299647f970 build: Include generated sources in declared dependencies
Sometimes ninja decides to compile tests/interactive-panels/main.c,
which requires shell/resources.h, before shell/resources.h is generated.

The fix is to use 'sources' argument of declare_dependency to properly
declare the dependency on generated headers.

A fix for tests/datetime and panels/datetime is also included in the
commit to fix a similar problem.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/472
2019-08-25 09:42:22 +00:00
Allan Day
eb8263454f region: Use correct icon for the drag handle
There's a dedicated icon for drag handles - we should make use of
it. Also, change the color of the handle so it looks like it is
part of the row.

Fixes #590
2019-07-16 22:34:26 +00:00
Felipe Borges
4f099e33c5 shell: Add global CSS stylesheet 2019-07-16 22:34: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