Commit graph

114 commits

Author SHA1 Message Date
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
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
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
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
Adrien Plazas
638dc94a8d window: Use a HdyLeaflet
This allows the window to be folded to show either the sidebar or the
panel when not enough space is available.

This reverts commit 2854669f5c8280a32d0b5fa6c5399cc391ef06f3.
2019-03-29 18:33:36 +00:00
Adrien Plazas
5cc5a85bf9 window: Stop using HdyLeaflet
It is safer to not make the shell adaptive until all panels are, so this
drops usage of HdyLeaflet to make the shell adaptive.

This mostly reverts commit 0ca61a5bde.

Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/issues/375.
2019-02-21 11:35:35 +00:00
Iain Lane
82191ca285
window: Update the headerbar when the panel list changes
Currently you can get stuck in the applications panel if you do this:

  1) Click "Applications" in the sidebar. The top left icon is a back
     icon.
  2) Click the back icon to return to the panel list. The top left icon
     changes to a search icon.
  3) Click "Applications" again. The top left icon remains a search icon
     and you're stuck in the panel.

The basic problem is that the headebar icon is update when the panel
changes, but not when the sidebar view changes. To fix this, we connect
to the signal that is emitted when the sidebar view changes, and update
the headerbar.
2019-02-18 13:19:51 +00:00
Christopher Davis
89245bbeda cc-window: Remove custom development CSS
GTK now includes it's own development style class, .devel.
We can use that instead of creating our own.
2019-01-21 20:44:44 -05:00
Adrien Plazas
0ca61a5bde window: Use a HdyLeaflet
This allows the window to be folded to show either the sidebar or the
panel when not enough space is available.
2019-01-21 21:53:21 +00:00
Adrien Plazas
9d9c547649 shell: Use a HdyHeaderGroup
Handle the header bars' decoration layouts with a HdyHeaderGroup to
simplify the code.
2019-01-21 21:53:21 +00:00
Georges Basile Stavracas Neto
8d2265c6b9
window: Properly update headebar buttons and title
With the new sidebar view in place, a new problem arose: we
need the current panel to be configured to update the title,
but cc_panel_list_add_sidebar_widget() changes the view while
activating the panel. That makes Settings crash.

Fix that by explicitly updating the headerbar widget, instead
of using notify::view of the panel list.
2018-11-16 19:25:13 -02:00
Georges Basile Stavracas Neto
8c144b6261
window: Instrument some functions 2018-11-16 19:24:49 -02:00
Georges Basile Stavracas Neto
2c18053ddd
window: Set the panel name as title for the widget
Instead of the wrong name of the previous panel list view.
2018-11-16 19:24:49 -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
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
62743ab47e
window: Factor out function to find panel iter
It will be used by the next commits to look for the panel
name. That is because the panel name is what will be used
as the first headerbar title of panels with a sidebar widget.
2018-11-16 15:18:59 -02:00
Robert Ancell
c0f41daff0 shell: Remove the lock button from the shell
Only the date time panel used it, all other panels add their own shell using
cc_shell_embed_widget_in_header which was added after the date time panel was
written. Update the date time panel to use this method.
2018-10-18 00:25:40 +00: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
Florian Müllner
d5de9d86c9 model: Convert panel icons to symbolic variants if possible
Panel icons should be consistent between the app and corresponding
search results in GNOME Shell, but currently the former uses the
symbolic variant while the latter uses the colored version.

Address this by converting icons to their symbolic variants when
building the model rather than later when consuming them.

https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/151
2018-07-29 21:45:38 +00: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
72924c6aba project: Remove unused files
The CcShellCategoryView and CcShellItemView were
residuals from the old shell there managed to stay
around unoticed.

Remove them from the project.
2018-07-15 10:59:27 -03:00
Georges Basile Stavracas Neto
c89a919536 window: Remove unused panel box
Whenever a panel is activated, there is a GtkBox that
is added between the window and the panel itself.

Investigating the history of this field, it originally
appeared at ec7f8c9b when the window started using
widgets rather than page numbers. Apparently, it was a
GtkBox to help dealing with the GtkNotebook (which was
later changed to the current GtkStack).

The field was renamed from 'current_panel' to 'current_panel_box'
at ab435aa9. But since the transition to GtkStack, there
is no real need to use the GtkBox anymore.

This patch removes this GtkBox, and as a consequence, the
code is slightly simplified.
2018-06-18 11:33:02 -03:00
Georges Basile Stavracas Neto
6d3ed43e74 window: Remove custom widgets at the correct time
The correct time to remove custom widgets is precisely
after we checked if the panel can be activated, and before
creating the panel. We were not following that, and it was
causing the panels with header widgets to never actually
show their custom widgets.

Fix that by calling remove_all_custom_widgets() at the
correct point in panel creation.
2018-05-29 20:46:03 -03:00
Georges Basile Stavracas Neto
1d8faa2a73 window: Instrument some functions
This will help in debugging.
2018-05-29 20:44:21 -03:00
Georges Basile Stavracas Neto
a461045f37 window: Don't remove header widgets before changing panels
When changing panels, CcWindow can only remove the previous
panel's header widgets after making sure the new panel was
successfully set.

However, this is not the case, and when the current panel
fails to be set, the previous panel's header widget is
removed.

Fix that by waiting to remove the header widgets until the
panel is successfully set.
2018-05-29 16:09:51 -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
Georges Basile Stavracas Neto
489a7ae5dd window: Delegate model creation to CcApplication
In order be able to modify panel information statically,
we need to have access to the CcShellModel from static
functions. CcApplication, thus, is a better place for the
model to live, since we can access it outside any scope
using g_application_get_default().

It also makes sense from the modeling point of view, since
the model is not tied to the shell anymore.
2018-05-29 16:09:49 -03:00
Georges Basile Stavracas Neto
6b334a8a00 window: Fix going back to previous panels
This never really worked on the new Setting layout
because it was historically implemented as "Back to
Overview", and we don't have an overview anymore.

This is fixed by morphing the implementation to be
"Back to previous panel", which forces us to actually
store the previous panel.
2018-05-28 22:23:35 -03:00
Georges Basile Stavracas Neto
52469cec7c window: Remove remaining overview mentions
There is no overview anymore -- Settings is always
visualizing a panel at any given time.

I just noticed that the Alt+Left shortcut was always
broken too. This will be fixed in a following commit.
2018-05-28 22:07:49 -03:00
Georges Basile Stavracas Neto
50094b45a6 window: Warn about development builds
With this commit, a message dialog pops up whenever a
development build runs. This is meant to actually annoy,
so that we're always reminded that things may not work
as expected.

Since the dialog can be dismissed with a single button
press, it is not the end of the world. But people still
should be aware that Settings is ~not~ meant to run with
Flatpak, and that this is a development tool only.
2018-05-14 18:24:03 -03:00
Georges Basile Stavracas Neto
16f06665dd window, shell-model: Silence warnings
A fallback from the previous commit.
2018-05-02 22:34:23 -03:00
Benjamin Berg
f547d9129d shell: Only try to select an existing panel on startup
When selecting the panel on startup based on the "last-panel" settings,
we need to make sure that the panel exists.

Note that this is a special case which does not use the internal
set_active_panel_from_id API. Using it is currently not possible because
the API does not report back the error and we would end up not selecting
any panel.
2018-04-30 14:02:25 +00:00
Christian Kellner
2889ab03b2 shell: Icon name helper returns symbolic name
The helper function to get the icon name from a GIcon directly
returns the symbolic icon now. This makes it in turn possible
to also directly check if the theme has the icon with the symbolic
name instead of checking of for the full colored one and then
deriving the symbolic name from that. The latter (old) practice
will fail if there is a symbolic icon in the theme that has no
full color icon (like e.g. thunderbolt).
2018-04-10 09:47:48 +02:00
Christian Kellner
51a1229111 shell: Don't set per-panel icon
The control center app is considered one single application with
a single icon to represent it. Therefore get rid of per-panel
icons.
2018-04-10 09:43:22 +02:00
Georges Basile Stavracas Neto
85296f1eba trivial: Code style improvements 2018-04-06 22:23:39 -03:00
Georges Basile Stavracas Neto
1367a8c083 window: Profile panel creation times 2018-04-06 22:23:38 -03:00
Georges Basile Stavracas Neto
a1bace4683 build: Drop libgd
Settings does not use libgd.
2018-03-16 15:55:10 -03:00
Georges Basile Stavracas Neto
e59fdcdf1c window: Replace deprecated function
gdk_keymap_get_default() is deprecated in favor of
gdk_keymap_get_for_display(), so let's just use that.
2018-03-06 22:55:01 -03:00
Bastien Nocera
10738d68c6 shell: Remember the last used panel
And restore it if the application is launched without any panels
requested.

https://bugzilla.gnome.org/show_bug.cgi?id=786607
2018-02-06 10:40:02 +01:00
Georges Basile Stavracas Neto
3632bc7dad window: Remove unnecessary wrapper functions
These were only used by CcApplication, and at this level
of the program we don't need to use any wrapper functions,
since we're certain that the CcWindow is a GtkWindow subclass.
2018-01-21 10:24:53 -02:00
Georges Basile Stavracas Neto
4f40a2fa33 window: Move remaining UI declarations to GtkBuilder file
There were leftover UI declarations in the source code, breaking
the nice split that it having the UI declared in the GtkBuilder
file while the logic is programmed.

This commit moves the remaining widgets declared in the source
code, the connected signals using and the binded properties to
the GtkBuilder file. This led to a nice cleanup in the source
code.
2018-01-21 10:24:53 -02:00
Georges Basile Stavracas Neto
a5d3af3a25 window: Reorganize functions
In an attempt to make the CcWindow code more organized and
structured, this commit reorganizes the source code to match
a recent pattern:

 * Structure declarations, G_DEFINE_TYPE
 * Function prototypes
 * Auxiliary methods
 * Callbacks
 * Vfunc overrides
 * class_init() + init()
 * Public API
2018-01-21 09:46:12 -02:00
Georges Basile Stavracas Neto
8e76f88b7b trivial: Fix style issues
Fixes a few code style inconsistencies found.
2018-01-21 09:22:08 -02:00
Georges Basile Stavracas Neto
693df19026 shell: Initialize variable
In practice, this is never uninitialized, but the
compiler is complaining anyway, so let's play the
conservative and make sure it's always initialized
to NULL.
2018-01-17 23:14:09 -02:00
Felipe Borges
aaabf05ae6 shell: Include panel "keywords" in the row data
This way GtkListBox filter functions can use the "keywords" in
order to provide accurate search results.

https://bugzilla.gnome.org/show_bug.cgi?id=790755
2017-11-28 11:04:38 +01:00