Commit graph

486 commits

Author SHA1 Message Date
Felipe Borges
357e944336 window: Split the window decorations between the header bars
When application menus are not supported by the desktop environment
or are disabled, Gtk+ makes the menu available with a fallback. For
client-side decorations the fallback consists of adding a menu
button at the begining of the titlebar. Since g-c-c has a split
headerbar, we need to explicitly handle the decoration layout.

This commit forces the "menu" to belong to the left headerbar, and
leaves the other buttons to ble placed at the right headerbar.

The "show-close-button" property has to be set in order to present
any type of decoration buttons in the header bar.

https://bugzilla.gnome.org/show_bug.cgi?id=786692
2017-09-12 11:10:33 +02:00
Jonathan Kang
82a7277499 shell: make Devices and Details rows selectable
Currently, while navigating using keyboard, the "Devices" and
"Details" rows of the GtkListBox in the sidebar don't seem to be
selected visually. Fix that by setting "selectable" property of those
two widgets as TRUE.

https://bugzilla.gnome.org/show_bug.cgi?id=786849
2017-08-29 18:55:42 +02:00
Allan Day
baa69f3ab1 panel-list: use tailored icons for devices and details sections
The devices and details rows should have distinct icons which
provide meaning. applications-system-symbolic is generic and
therefore unhelpful in both cases.

Instead use tailored icons from the icon theme, in order to
ensure that icon theme changes don't result in inappropriate
images being used.

https://bugzilla.gnome.org/show_bug.cgi?id=786605
2017-08-23 18:32:28 +02:00
Exalm
ded1b10eb1 panel-list: Further tweak sidebar classes
Removes sidebar-label class, adds sidebar-icon class to
Devices and Details arrows

https://bugzilla.gnome.org/show_bug.cgi?id=786612
2017-08-23 15:14:44 +02:00
Exalm
b8d1e8a814 panel-list: Update icon and label classes
Set icon class to sidebar-icon, and label class to
sidebar-label. This makes it more consistent with
places sidebar in Nautilus and GtkFileChooser.

https://bugzilla.gnome.org/show_bug.cgi?id=786612
2017-08-23 14:30:29 +02:00
Georges Basile Stavracas Neto
10c9722283 window: Synchronize sidebar and header with a size group
Instead of using a callback on size-allocate, and setting
a custom size request. Using a sizegroup is much cleaner
and avoid some potential issues we could have in the future.
2017-08-16 16:47:14 -03:00
Georges Basile Stavracas Neto
b8fbf5032e window: Don't accidentally destroy panels when showing overview
When passing --overview, Settings' new shell window accidentally
removes the newly selected panel.

We're considering the possibility of adding an overview page but,
since that won't happen for the next release, let's just make sure
something happens for now.

Fix that by simply changing the panel list view, which selects the
Wi-Fi panel if the user was in another view.

https://bugzilla.gnome.org/show_bug.cgi?id=786117
2017-08-16 16:35:07 -03:00
Allan Day
47a39f5c36 shell: increase initial window size
With the new settings shell, a larger window makes it easier to
navigate the different panels and shows more content from each
panel, reducing the need to scroll.

https://bugzilla.gnome.org/show_bug.cgi?id=786328
2017-08-16 15:38:35 -03:00
Georges Basile Stavracas Neto
5c4f2ff8a6 shell: Hardcode panel list order
Per the latest mockups [1], the panel list must be sorted
by the category, and then follow a manual predefined order.

This commit adds the hardcoded order to the the panel list.

[1] https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/system-settings/shell/settings-organization.png
2017-08-12 11:03:17 -03:00
Georges Basile Stavracas Neto
d5c4436869 project: Switch to the new shell
This is the bomb dropping commit. It does so simply by
changing the compiled files, and adjusting the build
projects proper.
2017-08-09 19:31:41 +02:00
Rui Matos
ddd2d5ce8b shell: Add GtkListBox/Row derived types that do single row activations
We often use rows representing different things in the same list
box. In these cases it's often desirable to have rows emitting their
own activation signals instead of having a single handler for the
whole list box that dispatches according to the activated row.

https://bugzilla.gnome.org/show_bug.cgi?id=785949
2017-08-09 19:27:08 +02:00
Georges Basile Stavracas Neto
b4194048de panel-loader: Cosmetic changes
This commit only fixes some very minor cosmetic changes
like int → gint, simplifies the code by using g_autofoo,
et cetera.

https://bugzilla.gnome.org/show_bug.cgi?id=779216
2017-07-24 23:33:41 -03:00
Mohammed Sadiq
6cf52ada03 info: Add desktop files for the split panels
This commit shall show the panels separate.

Some panels are hidden in current design, while some other panels
are hidden in new shell design.

https://bugzilla.gnome.org/show_bug.cgi?id=779216
2017-07-24 22:55:27 -03:00
Mohammed Sadiq
1485b50a7a shell-model: Add hidden settings
Some panels shall be shown only in current design, And some other panels
shall be shown only in new Shell design. So let's have a code that
would help us do that

https://bugzilla.gnome.org/show_bug.cgi?id=779216
2017-07-24 22:54:58 -03:00
Florian Müllner
8b09079f34 shell/alt: Always activate panel list after view change
The displayed panel should always match the selection in the panel
list. That implies that after swapping out the list (for instance
by browsing Devices or Details), we need to update the panel rather
than keeping the old one around until the user manually selects a
row. The easiest way to achieve that is to activate the panel list
after a view change when appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=783429
2017-07-24 22:23:23 -03:00
Georges Basile Stavracas Neto
016efdfac8 wifi: Introduce Wi-Fi panel
The glory moment has come. The new Wi-Fi panel is finally
introduced using a different code style from the rest of
the Network panel, since Control Center itself is written
using the GTK+ C code style.

The Wi-Fi panel uses modern GTK+ features like template
classes and new widgets. The files are stored together
with the Network panel so that we can reuse the abstraction
layer that the Network panel has to manage devices.

https://bugzilla.gnome.org/show_bug.cgi?id=784818
2017-07-18 13:30:46 -03:00
Mohammed Sadiq
f8db8b67e3 shell/alt: Fix memory leak
'id' component was forgotten to be freed before the
struct itself is freed.

https://bugzilla.gnome.org/show_bug.cgi?id=782200
2017-05-27 12:03:58 -03:00
Mohammed Sadiq
d153b9b4ee hostname-helper: don't read past '\0'
g_utf8_find_next_char() doesn't do checks whether the char
is '\0' or not. We have to take care of that ourself.

This commit fixes heap-buffer-overflow found by test-hostname

ERROR: AddressSanitizer: heap-buffer-overflow on address
READ of size 1 at 0x60200000cd76 thread T0
 #0 0x7f8b26920d08 in g_utf8_find_next_char glib/glib/gutf8.c:179
 #1 0x55c2b8eacaee in pretty_hostname_to_ssid gnome-control-center/shell/hostname-helper.c:199

https://bugzilla.gnome.org/show_bug.cgi?id=782216
2017-05-05 15:01:28 +02:00
Bastien Nocera
8074a31d5e printers: Make panel required on all platforms
All the free Unix-compatible platforms we support have CUPS support, so
require it from the get-go.
2017-02-08 20:08:20 +01:00
Lubomir Rintel
da4a591b4d hostname-helper: use SSID_MAX_LEN
It looks a bit weird to define it and still use the numeric literal.
2017-01-19 10:46:46 +01:00
Lubomir Rintel
239403c742 hostname-helper: fall back to kernel hostname when the pretty one is an empty string
The empty string is not too useful as an SSID, an attempt to create a
hotspot fails:

  (gnome-control-center:19371): network-cc-panel-WARNING **:
    Failed to add new connection: (2)
    A 'wireless' setting with a valid SSID is required if no AP path was given.
2017-01-19 10:45:36 +01:00
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