Commit graph

465 commits

Author SHA1 Message Date
Bastien Nocera
09263321d4 shell: Close overview on Ctrl+W as well
https://bugzilla.gnome.org/show_bug.cgi?id=776385
2017-01-03 12:04:03 +01:00
Carlos Garnacho
7933507213 shell/alt: Make CcWindow use custom title widget (if any)
If the current panel requests setting a custom widget, honor that
and place those in the headerbar.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
3fa5526d91 shell: Make CcWindow use custom title widget (if any)
If the current panel requests setting a custom widget, honor that
and place those in the headerbar.
2016-11-04 23:26:41 +01:00
Carlos Garnacho
b24ccb9415 shell: Add cc_panel_get_title_widget() vmethod
So the panel implementations will be able to set a custom widget
in the shell headerbar. It defaults to NULL, so by default panels
set the plain label with the panel title.
2016-11-04 23:26:23 +01:00
Piotr Drąg
680ec1446f shell: use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772199
2016-10-03 15:20:23 +02:00
Georges Basile Stavracas Neto
4aee781ab6 shell: ensure valid data when loading the panel
When loading a given panel, make sure we have a valid
panel before setting the sidelist.

This is a follow-up fix per request in bug [1].

[1] https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-26 11:59:07 -03:00
Georges Basile Stavracas Neto
61d7abe795 shell: add a autocleanup function to CcPanel
CcPanel uses the old boilerplate code from GLib,
which does not set an autocleanup function.

The lack of a cleanup function implies that panels
cannot use G_DECLARE_{FINAL,DERIVABLE}_TYPE, making
the code stick to the old boilerplate.

This patch adds a cleanup function to CcPanel. It doesn't
move CcPanel to G_DECLARE_DERIVABLE_TYPE() because it'd
break the CcPanel's subclasses.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-26 11:24:26 -03:00
Georges Basile Stavracas Neto
42a360eed6 shell: update sidebar when active panel is set externally
When the active panel is not changed through sidebar navigation,
e.g. by calling the Control Center through command line and asking
to open a specific panel, the panel is correctly opened but the
sidebar is not updated to reflect that.

Fix that by selecting the externally set panel row, and eventually
moving to the correct list.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-26 11:22:28 -03:00
Georges Basile Stavracas Neto
45d6073cd1 window: remove the placeholder view
Now that we always show a panel, this placeholder
view is not needed.

This patch removes the placesholder view.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03:00
Georges Basile Stavracas Neto
11ce397d2a window: adapt to use CcPanelList
After introducing the new sidelist class, the
next logical step is to make CcWindow use it.

This patch, then, adapts CcWindow to use CcPanelList
instead of a plain GtkListBox.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03:00
Georges Basile Stavracas Neto
cb1e0c4a01 panel-list: create a custom class to handle the sidelist
As the sidelist gets more complex, managing it in CcWindow
would make it very confusing.

This patch introduces the CcPanelList, a widget that manages
the sidelist.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03:00
Georges Basile Stavracas Neto
27ce5b388f shell-model: introduce new categories
Following the previous set of patches for implementing
the next generation Shell, a new set of categories must
be added.

These new categories will reflect on the ordering of the
panels and subpages in the sidelist.

This patch adds these new categories and conditionally
compiles them, to not break the current icon-based Shell.

https://bugzilla.gnome.org/show_bug.cgi?id=767301
2016-06-14 12:16:43 -03:00
Bastien Nocera
1ce4af4267 shell: Add PrettyHostname to SSID helper
For use in the network panel. Comes with tests!
2016-06-10 17:10:35 +02:00
Bastien Nocera
af5f2f3d73 shell: Port tests to GTest 2016-06-10 17:10:35 +02:00
Georges Basile Stavracas Neto
57ba49a137 window: reimplement search
We previously had a dedicate view for handling search,
based on model filtering and a custom panel to display
that differently.

After moving to GtkListBox, search can be trivially
done by using a filtering function, and widgets can
be fine-tuned to display extra information.

This patch, then, reimplements the search using a filtering
function over the panels' list.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:37 -03:00
Georges Basile Stavracas Neto
b6ab2a4922 window: use a listbox
The latest mockups use a list instead of icon grid. This
commit, after all the work porting the current UI to use
a side list, replacing the temporary icon grid.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:37 -03:00
Georges Basile Stavracas Neto
9d06a0f858 window: add a placeholder view
https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:37 -03:00
Georges Basile Stavracas Neto
2590e38905 window: set the default width and height
Since the window can shrink down too much, it makes
sense for us to have a sane default width and height.

720x480 was chosen because that's the default resolution
for CRT TVs.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
a267ebd9a2 window: make the sidelist and first headerbar horizontally equal
The first headerbar and the sidelist should stay synchronized,
and this commit does so by setting the width request of the
headerbar to the allocated width of the sidelist.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
c0bdc06d1e window: introduce the second headerbar
This commit introduces the second headerbar, where the
panel title and the panel widgets are displayed. It also
adapts the code to use the second headerbar when needed.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
fa1a6b3457 window: pack the headerbar inside a box
In the future commits, we'll use two headerbars to visually
separate the panel area and the sidelist.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
df086d4db9 window: put the search button in the start of the headerbar
Since the search bar has been moved to above the sidelist, it
makes sense to have the search button on the start of the
headerbar, strengthening the relation between both widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
55cc4c3a91 window: make it a template class
In order to prepare ourselves for the future changes,
having the window as a template class is hugely advantageous
for we'll be able to modify the interface much more
quickly and cleanly.

This commit makes the window a template class, and only
that. No behavioral changes, nor new features were
introduced here.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
6f38ca83c8 window: remove the small screen code
Because the old layout was never meant to scale well on low
resolution displays, we had to introduce code that adapts the
window to be usable on low res screens.

The problem with this code is that it still doesn't scale down
very well for really low resolution screens. Partially because
of the layout itself (which, again, was never meant to), partially
because the panels request a size bigger than e.g. 720x480. Now,
this is an important feature and we need to support that low
resolution by default.

To push this constraint forward, remove the code that managed a
custom mode for low resolution screens. From now on, the Control
Center shall be adapted to scale well on any screen sizes.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
77ef6c4bbd window: remove the fixed width request code
Having a fixed width is bad for various reasons. First, it's
harder to deal with low resolution screens, which was fixed
by adding an entire new mode just to deal with it. Second,
because it may not scale well for big resolutions.

Fix that by removing the code that handles the fixed width.
The next commit will completely remove the code that manages
small screens, in the hope that the new layout will handle
both cases well by design.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
2f844e2a6a window: make the panels' stack expand
This way, panels can fill the most of the screen, which
is the desired behavior proposed by the mockups.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
c47bc08b06 window: separate the panel selector
To progressively achieve the sidelist, let's start by moving
the current iconview selector to the side and then turning
it into a GtkListBox.

This commit, then, moves the iconviews' list to the start of
the horizontal box added in the previous commit.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
c006198434 window: add a horizontal box before the stack
The horizontal box will be used in the future commits
to separate the sidelist from the stack.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
2bb6d441a7 build: create another executable for the new layout
This way, we can test both layouts in parallel and, in
case something goes wrong, we always have to old layout
as a fallback.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
fe3a23702f build: copy CcWindow in alt/ directory
The copied files are exact copies of shell/cc-window.c and
shell/cc-window.h, and they'll be used to implement the restyled
shell as an alternative binary.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Georges Basile Stavracas Neto
71d39a4836 window: turn into a final class
This commit updates the code to use the recently
introduced API. The new functions improve the
legibility and maintainability of the code, and
makes it easier to work on new features.

https://bugzilla.gnome.org/show_bug.cgi?id=766922
2016-06-03 12:32:36 -03:00
Cosimo Cecchi
af6b9b6402 editable-entry: use floats to avoid warning
Or the code in g_object_set_valist() may treat the zero as a NULL, and
trigger a warning.

https://bugzilla.gnome.org/show_bug.cgi?id=764296
2016-04-14 12:31:49 -07:00
Bastien Nocera
22e463a4ce shell: Avoid whitespace at the bottom in small mode
When using the small mode, and the scroll window's content
height is smaller than the screen, we'd end up with whitespace at the
bottom of the panel, as the panel's height is smaller than the window.
2016-03-01 16:15:41 +01:00
Piotr Drąg
e9d65002a9 Add context to strings in the shortcut window 2016-02-01 19:07:16 +01:00
Richard Hughes
3badc6945a Add a missing tag to the AppData file 2016-01-25 16:05:00 +00:00
Matthias Clasen
fde96cc691 shell: Add a help overlay
This explains the various keyboard shortcuts that are available
in the control-center.

See https://wiki.gnome.org/Initiatives/GnomeGoals/ShortcutWindows

https://bugzilla.gnome.org/show_bug.cgi?id=759320
2015-12-10 20:51:28 -05:00
Richard Hughes
d620a71422 shell: Manually add kudos to the AppData file 2015-11-27 14:34:28 +00:00
Christophe Fergeau
3b5e7e1805 shell: Fix leak in cc_shell_item_view_update_cells
==11430== 48 (24 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 10,663 of 18,7
==11430==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==11430==    by 0x7F260AC: g_malloc (gmem.c:97)
==11430==    by 0x7F3F0F7: g_slice_alloc (gslice.c:1007)
==11430==    by 0x7F19BE5: g_list_prepend (glist.c:311)
==11430==    by 0x684843B: accum_cells (gtkcellarea.c:1563)
==11430==    by 0x6850989: gtk_cell_area_box_foreach (gtkcellareabox.c:1145)
==11430==    by 0x6848AAA: gtk_cell_area_foreach (gtkcellarea.c:1730)
==11430==    by 0x6848490: gtk_cell_area_get_cells (gtkcellarea.c:1573)
==11430==    by 0x6857339: gtk_cell_layout_get_cells (gtkcelllayout.c:592)
==11430==    by 0x685668F: gtk_cell_layout_default_get_cells (gtkcelllayout.c:342)
==11430==    by 0x6857339: gtk_cell_layout_get_cells (gtkcelllayout.c:592)
==11430==    by 0x45242B: cc_shell_item_view_update_cells (cc-shell-item-view.c:116)
==11430==    by 0x451DDD: cc_shell_category_view_constructed (cc-shell-category-view.c:141)
==11430==    by 0x7C8DC10: g_object_new_internal (gobject.c:1814)
==11430==    by 0x7C8E71A: g_object_new_valist (gobject.c:2033)
==11430==    by 0x7C8D6C5: g_object_new (gobject.c:1617)
==11430==    by 0x4520AB: cc_shell_category_view_new (cc-shell-category-view.c:213)
==11430==    by 0x44F5D2: add_category_view (cc-window.c:852)
==11430==    by 0x44F78B: setup_model (cc-window.c:880)
==11430==    by 0x450EBC: create_main_page (cc-window.c:1460)
==11430==    by 0x4514F1: create_window (cc-window.c:1553)
==11430==    by 0x45170A: cc_window_init (cc-window.c:1587)
==11430==    by 0x7CA6E7D: g_type_create_instance (gtype.c:1870)
==11430==    by 0x7C8DAC5: g_object_new_internal (gobject.c:1774)
==11430==    by 0x7C8E71A: g_object_new_valist (gobject.c:2033)
==11430==    by 0x7C8D6C5: g_object_new (gobject.c:1617)
==11430==    by 0x451847: cc_window_new (cc-window.c:1602)
==11430==    by 0x44D409: cc_application_startup (cc-application.c:262)
==11430==    by 0x7C8827D: g_cclosure_marshal_VOID__VOIDv (gmarshal.c:905)
==11430==    by 0x7C8590F: g_type_class_meta_marshalv (gclosure.c:1021)
==11430==    by 0x7C854D1: _g_closure_invoke_va (gclosure.c:864)
==11430==    by 0x7CA0771: g_signal_emit_valist (gsignal.c:3246)
==11430==    by 0x7CA18E9: g_signal_emit (gsignal.c:3393)
==11430==    by 0x7982671: g_application_register (gapplication.c:2015)
==11430==    by 0x79808D2: g_application_real_local_command_line (gapplication.c:983)
==11430==    by 0x68143D6: gtk_application_local_command_line (gtkapplication.c:638)
==11430==    by 0x7982D4D: g_application_run (gapplication.c:2280)
==11430==    by 0x44C96B: main (main.c:57)

https://bugzilla.gnome.org/show_bug.cgi?id=756762
2015-10-19 11:19:17 +02:00
Christophe Fergeau
3717e985eb shell: Don't call gtk_clutter_init() when using cheese
cheese_gtk_init() is called as well and will be taking care of that for
us.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:07 +02:00
Christophe Fergeau
a70172cfea shell: Move cheese_gtk_init() call earlier
Now that we handle local command line arguments, the 'command_line'
vfunc can no longer get the initial argc/argv passed to the process.
Now, cheese_gtk_init() is called unconditionally from main()
where argc/argv are available.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:07 +02:00
Christophe Fergeau
3f586c4a95 shell: Handle --version as a regular argument
It was handled through a callback calling exit(). Now that we have a
handle-local-options callback, we can handle it as a regular argument
from there.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:07 +02:00
Christophe Fergeau
b484470e56 shell: Handle --list from the local instance
This is an help-like parameter, so we want its output to show up in the
terminal from which gnome-control-center was just started, not from the
terminal from which the main gnome-control-center instance was started.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:51:06 +02:00
Christophe Fergeau
b3138a4c0f shell: Connect to "handle-local-options" signal
https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:50:48 +02:00
Christophe Fergeau
e8485dea69 shell: Parse command line args into a GVariantDict
Since we are using g_application_add_main_option, we can remove the
global variable used to parse the arguments into, and get the parsed
arguments from the GVariantDict returned by
g_application_command_line_get_options_dict().
This is in preparation for handling some command line options in the
local gnome-control-center instance, and others in the remote instance.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02:00
Christophe Fergeau
750bb5158d shell: Use g_application_add_main_option_entries
Since GApplication provides this API, we can as well use it, this will
be useful in order to correctly split option handling between the local
instance and the main instance.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02:00
Christophe Fergeau
0db5500232 shell: Don't handle --help ourselves
GOption can handle --help for us, so we don't need to reimplement this
ourselves. This causes a small regression as starting a main
gnome-control-center instance and then running gnome-control-center
--help will cause the main instance-control-center to exit. This will be
fixed in the following patches, and this fixes the opposite bug:
if gnome-control-center is not running, gnome-control-center --help
would not exit after displaying the help before this commit.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02:00
Christophe Fergeau
c33ac8bca9 shell: Fix GVariantBuilder leak
When a GVariantBuilder is created with g_variant_builder_new(), it must
be unref'ed with g_variant_builder_unref() when no longer needed. In
this case, we can just use a local stack-allocated GVariantBuilder to
avoid the leak.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:40 +02:00
Christophe Fergeau
c84722248e shell: Revert "Let panels have their own commandline flags"
This reverts commit 31a8a99440.

This was meant for bgo#695885 which has stalled for a while, so this
feature has no in-tree user. This commit removes it for now, this can be
readded when users for it materialize.

https://bugzilla.gnome.org/show_bug.cgi?id=751597
2015-07-16 11:49:34 +02:00
Bastien Nocera
3ff7c61db1 shell: Fix gtk_tree_model_get_iter_first() retval
https://bugzilla.gnome.org/show_bug.cgi?id=749892
2015-05-27 11:06:02 +02:00
Richard Hughes
daed241f9a Add a simple AppData file
This is needed for three reasons:

 * To be able to arrange the icon into a folder in GNOME Software
 * So that we do not allow the application to be removed
 * To show the update description not in the 'OS Updates' package section
2015-04-01 10:47:55 +01:00