Commit graph

58 commits

Author SHA1 Message Date
Nelson Benítez León
ce42d320b5 shell: fix visibility check for rows and avoid empty searches
When pressing ENTER (i.e. activating) a search with no
results ("No results found") the first Wifi panel was
being activating, that's wrong because cc_panel_list_activate()
should activate the first visible panel, but there are
no visible panels at the moment (No results found page is shown)

The problem was the visibility check in cc_panel_list_activate()
was incomplete and so it wrongly thought panels were app visible.

Part of #2119 (comments 4th and 5th)
2023-05-23 14:30:49 +01:00
Nelson Benítez León
02302c9b08 CcPanelList: center sidebar row when activating a panel
When activating a panel from Search or from commandline
let's scroll the sidebar so the row for that panel is
revealed and vertically centered on the list.

Closes #2098
2023-05-16 08:24:52 +00:00
Nelson Benítez León
754536cc97 CcPanelList: don't activate first row panel unnecesarily
Don't activate first row panel (i.e. 'Wifi') when:
 - Canceling search view (pressing ESC or deleting all query text).
 - Activating a search result from search view.

Closes #2472
2023-05-11 14:45:10 +00:00
Maksym Hazevych
08c2e69851 Resolving suggestions 2023-03-29 14:26:55 +13:00
Maksym Hazevych
5b988a6943 Replace all occurrences of 'gtk_widget_hide'
Replace all occurrences of 'gtk_widget_hide(smth)' with
'gtk_widget_set_visible(smth, FALSE)'.
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
Mohammed Sadiq
2fb74f2a40 panel-list: Switch to main list if custom sidebar is not set
If the previously shown panel had a custom sidebar, we were not
switching back to the main list if the currently shown panel
doesn't have one.

This will result in the sidebar having empty content.

Fix it by always switching to main sidebar view if no custom
sidebar widget is set.

Closes #2261
Closes #2292
2023-03-03 10:38:31 -03:00
Georges Basile Stavracas Neto
20a010d0f6 Revert "panel-list: Switch to main list if custom sidebar is not set"
This reverts commit bc919b82c0.
2023-01-09 16:40:55 -03:00
Mohammed Sadiq
bc919b82c0 panel-list: Switch to main list if custom sidebar is not set
If the previously shown panel had a custom sidebar, we were not switching
back to the main list if the currently shown panel doesn't have one.

This will result in the sidebar having empty content.

Fix it by always switching to main sidebar view if no custom sidebar widget
is set.

Fixes #2261
2023-01-06 12:37:45 +00:00
Felipe Borges
294156c0f9 Drop most uses of deprecated gtk_style_context_add/remove_class
GtkStyleContext will be deprecated in gtk 4.10.
https://docs.gtk.org/gtk4/class.StyleContext.html

This preserves code blocks where additional GtkStyleContext operations
were used, such as gtk_style_context_save/restore.
2023-01-05 18:55:51 +00:00
Mohammed Sadiq
3b121805ed log: Improve logging
The 'tracing' build option is no longer needed.  And the verbosity
of logs can be set by providing '-v' multiple times.
2022-12-01 11:44:17 +00:00
Mohammed Sadiq
2dbc195d77 panel-list: Select panel iff non-folded when search is cancelled
If the window is folded, the previous panel shouldn’t be shown when search
is cancelled. The panel selection list should be shown instead.
2022-08-17 09:34:16 +00:00
Kate Hsuan
69598b9e08 Add Firmware Security panel
The Firmware Security panel exposes the host security levels
and details. The information is generated by fwupd. The panel
also exposes hardware configuration changes to pinpoint the
configuration changing time.

Currently this panel shows:

 - HSI and secure boot status
 - Details of HSI and secure boot
 - Configuration changelog
 - Digested security level
 - Extended protection
2022-06-27 13:53:30 -03:00
Georges Basile Stavracas Neto
acd59aec65 Rename app-id to org.gnome.Settings
Rename the app-id to org.gnome.Settings since this is what
we've been calling it for many years now. Adjust all files
that derive from the app-id, such as the desktop file, D-Bus
service file names, search providers, GSettings schemas, to
match that.

Closes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/344
2022-01-21 13:08:50 +00:00
Christopher Davis
58e3d7873a cc-panel-list: Adjust margins for sidebar rows
This matches the mockups and Patterns.
2021-12-17 21:36:54 +00:00
Christopher Davis
d72d23a1cd cc-panel-list: Remove use of sidebar-icon style
Generally sidebar icons aren't dimmed anymore.
2021-12-17 21:36:54 +00:00
Georges Basile Stavracas Neto
521ea3a635 panel-list: Port to GTK4
- Inherit AdwBin since GtkStack is a final class now
 - Replace GtkContainer APIs by their widget-specific ones
2021-12-14 22:34:21 -03:00
Mohammed Sadiq
dc840f0aec wwan: Add new panel for modem management
The panel supports 2G/3G/4G GSM/LTE modems. CDMA2000 Modems are not supported.
If a supported modem is present, the panel will be shown and the modem will be
handled, else, network-panel shall manage the modem as it did in the past.

If more than one modem with data enabled is present, the user is allowed to set
priority of one SIM over the other (the priority is for SIM, not modem).

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/132
2021-08-13 19:25:41 +00:00
Georges Basile Stavracas Neto
0f0845172f Introduce the Multitasking panel
The Multitasking panel brings some additional settings
from Tweaks that are relevant to the general platform.

Related: https://gitlab.gnome.org/GNOME/gnome-control-center/issues/558
2021-08-13 18:17:36 +00: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
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
Yuri Chornoivan
e7050ab6f4 Fix minor typos 2020-07-20 10:38:09 +03: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
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
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
Robert Ancell
c6965d9e30 shell: Use g_autofree for strings 2019-10-02 17:04:15 +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
Georges Basile Stavracas Neto
476ea8f550 panel-list: Simplify placeholder widget setup
I just learned that we can use <child type="placeholder"> and
avoid C code to do that. Simplify CcPanelList as well.
2019-04-01 22:27:51 +00:00
Georges Basile Stavracas Neto
1245fd787b
Introduce Applications panel
This is an initial implementation of most of the
intended functionality for this panel. Flatpak
integration itself is implemented by spawning
"flatpak info -m $appid", which gives us the
metadata in key file format, and allows flatpak
to be a runtime dependency.

Even after removing the .desktop suffix, there can
still be a difference between the app ID generated
in this way and the flatpak ID, since flatpaks are
allowed to export files whose prefix is the flatpak
ID. Fix this by pulling the X-Flatpak key out of
the desktop file. This would cause trouble for
org.libreoffice.LibreOffice-math.
2019-01-07 10:59:30 -02:00
Georges Basile Stavracas Neto
24a5bad48d
panel-list: Fix back button after search
This is a fallout from commit b02bc2a935. It was missing
the check for search.
2018-11-19 00:07:12 -02:00
Georges Basile Stavracas Neto
aeb060c8ad
panel-list: Instrument more functions
These were useful tracing messages to figure out some bugs
with the sidebar widget implementation.
2018-11-16 19:25:13 -02:00
Georges Basile Stavracas Neto
6295831fff
window: Add panel's sidebar widget to sidebar
When opening a panel, add its sidebar widget to the sidebar.
2018-11-16 19:24:49 -02:00
Georges Basile Stavracas Neto
de15083e7a
panel-list: Rename internal function
It was referring to listbox, where in the future
it is going to refer to any kind of widget.
2018-11-16 15:19:09 -02:00
Georges Basile Stavracas Neto
b02bc2a935
panel-list: Replace set_view() by go_previous()
Instead of directly selecting the view that the panel
list will have, let it decide which is the previous
view instead.

This does not change anything functionality wise, but
in the future where we have sidebar widget (and thus
the main window does not control which view the sidebar
is display) this will be important.
2018-11-16 15:19:09 -02:00
Georges Basile Stavracas Neto
c4c901f95d
panel-list: Dynamically show Details/Devices row
This is just a nicety for the test mode; when there are no
panels added under those categories, do not show the rows.
2018-11-11 23:46:07 -02:00
Corentin Noël
a6acc98371 common: fix some wrong autofree uses
g_autofree an array only g_free the first element, GStrv is the string array type.
2018-10-11 14:50:38 +13:00
Georges Basile Stavracas Neto
a8673b06c7 shell: Rename .ui files to match .c files
To keep it clean and well organized, rename the .ui files
(window.ui and panel-list.ui) to have the 'cc-' prefix and
match their .c counterparts.
2018-07-18 21:34:09 +00:00
Georges Basile Stavracas Neto
f4b630030c panel-list: Properly select panels when changing views
When moving from and to different views, the first row
might be activated due to focus going to the listbox. This
wasn't a problem before because we couldn't hit that code
path, but now we can.

Fix that by always selecting the first visible row.
2018-05-29 19:20:44 -03:00
Georges Basile Stavracas Neto
62cfe91689 panel-list: Improve search behavior
There are a couple of small problems with the search
behavior here. First, if we select a panel from search
and leave it, it will continue to stay there forever.
Second, if panels change their visibility status during
runtime, the panel list wouldn't respond accordingly.
2018-05-29 18:03:05 -03:00
Georges Basile Stavracas Neto
a78cbe3963 model: Add visibility field
This field can be used to communicate the visibility of the
panel from a static context (i.e. without any instances of
a CcPanel nor any access to CcShell).
2018-05-29 16:09:51 -03:00