...
 
Commits (12)
===============
Version 3.31.4
===============
- Introduce the new Applications panel
- Panels can now expose a custom sidebar widget
- Improve CI image building scripts
- Translation updates
Applications:
- Introduce the new Applications panel
Bluetooth:
- Cleanup and reorganize code
Display:
- Add Night Light slider to set temperature
Network:
- Allow Wi-Fi panel to reach narrower sizes
- Cleanups and smaller performance improvement preparations
Notifications:
- Use libhandy's HdyColumn
Online Accounts:
- Use libhandy's HdyColumn
Power:
- Label PENDING_CHARGE state as "Not Charging"
Printers:
- Cleanups and memory leaks plugs
Privacy:
- Use libhandy's HdyColumn
Thunderbolt:
- Fix double-free
User Accounts:
- Rename classes
Wacom:
- Map Wacom-driver-specific generic IDs to 0
===============
Version 3.31.2
===============
......
project(
'gnome-control-center', 'c',
version : '3.31.2',
version : '3.31.4',
license : 'GPL2+',
meson_version : '>= 0.43.0'
meson_version : '>= 0.48.0'
)
control_center_prefix = get_option('prefix')
......
......@@ -1421,11 +1421,12 @@ apps_changed (GAppInfoMonitor *monitor,
}
static void
row_selected_cb (GtkListBox *list,
GtkListBoxRow *row,
CcApplicationsPanel *self)
row_activated_cb (GtkListBox *list,
GtkListBoxRow *row,
CcApplicationsPanel *self)
{
update_panel (self, row);
g_signal_emit_by_name (self, "sidebar-activated");
}
static void
......@@ -1653,8 +1654,8 @@ cc_applications_panel_init (CcApplicationsPanel *self)
provider,
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_signal_connect (self->sidebar_listbox, "row-selected",
G_CALLBACK (row_selected_cb), self);
g_signal_connect (self->sidebar_listbox, "row-activated",
G_CALLBACK (row_activated_cb), self);
g_signal_connect (self->header_button, "clicked", G_CALLBACK (open_software_cb), self);
......
This diff is collapsed.
......@@ -53,6 +53,12 @@ typedef struct
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (CcPanel, cc_panel, GTK_TYPE_BIN)
enum
{
SIGNAL_SIDEBAR_ACTIVATED,
SIGNAL_LAST
};
enum
{
PROP_0,
......@@ -61,6 +67,8 @@ enum
N_PROPS
};
static guint signals [SIGNAL_LAST] = { 0 };
static GParamSpec *properties [N_PROPS];
static void
......@@ -152,6 +160,14 @@ cc_panel_class_init (CcPanelClass *klass)
object_class->set_property = cc_panel_set_property;
object_class->finalize = cc_panel_finalize;
signals [SIGNAL_SIDEBAR_ACTIVATED] =
g_signal_new ("sidebar-activated",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
properties[PROP_SHELL] = g_param_spec_object ("shell",
"Shell",
"Shell the Panel resides in",
......
......@@ -33,6 +33,8 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#define HANDY_USE_UNSTABLE_API
#include <handy.h>
#include <string.h>
#include <time.h>
......@@ -55,11 +57,13 @@ struct _CcWindow
GtkWidget *stack;
GtkWidget *header;
GtkWidget *header_box;
GtkWidget *main_leaflet;
GtkWidget *list_scrolled;
GtkWidget *panel_headerbar;
GtkWidget *search_scrolled;
GtkWidget *panel_list;
GtkWidget *previous_button;
GtkWidget *back_revealer;
GtkWidget *top_right_box;
GtkWidget *search_button;
GtkWidget *search_bar;
......@@ -69,6 +73,7 @@ struct _CcWindow
char *current_panel_id;
GQueue *previous_panels;
HdyHeaderGroup *header_group;
GtkSizeGroup *header_sizegroup;
GPtrArray *custom_widgets;
......@@ -77,6 +82,8 @@ struct _CcWindow
CcPanel *active_panel;
GSettings *settings;
CcPanelListView previous_list_view;
};
static void cc_shell_iface_init (CcShellInterface *iface);
......@@ -152,6 +159,13 @@ remove_all_custom_widgets (CcWindow *self)
CC_EXIT;
}
static void
on_sidebar_activated_cb (CcPanel *panel,
CcWindow *self)
{
hdy_leaflet_set_visible_child_name (HDY_LEAFLET (self->main_leaflet), "panel");
}
static gboolean
activate_panel (CcWindow *self,
const gchar *id,
......@@ -202,6 +216,7 @@ activate_panel (CcWindow *self,
sidebar_widget = cc_panel_get_sidebar_widget (CC_PANEL (self->current_panel));
cc_panel_list_add_sidebar_widget (CC_PANEL_LIST (self->panel_list), sidebar_widget);
g_signal_connect_object (self->current_panel, "sidebar-activated", G_CALLBACK (on_sidebar_activated_cb), self, 0);
/* Finish profiling */
g_timer_stop (timer);
......@@ -402,6 +417,7 @@ set_active_panel_from_id (CcShell *shell,
const gchar *start_id,
GVariant *parameters,
gboolean add_to_history,
gboolean force_moving_to_the_panel,
GError **error)
{
g_autoptr(GIcon) gicon = NULL;
......@@ -410,17 +426,22 @@ set_active_panel_from_id (CcShell *shell,
GtkTreeIter iter;
GtkWidget *old_panel;
CcWindow *self;
CcPanelListView view;
gboolean activated;
gboolean found;
CC_ENTRY;
self = CC_WINDOW (shell);
view = cc_panel_list_get_view (CC_PANEL_LIST (self->panel_list));
/* When loading the same panel again, just set its parameters */
if (g_strcmp0 (self->current_panel_id, start_id) == 0)
{
g_object_set (G_OBJECT (self->current_panel), "parameters", parameters, NULL);
if (force_moving_to_the_panel || self->previous_list_view == view)
hdy_leaflet_set_visible_child_name (HDY_LEAFLET (self->main_leaflet), "panel");
self->previous_list_view = view;
CC_RETURN (TRUE);
}
......@@ -454,6 +475,9 @@ set_active_panel_from_id (CcShell *shell,
if (add_to_history)
add_current_panel_to_history (shell, start_id);
if (force_moving_to_the_panel)
hdy_leaflet_set_visible_child_name (HDY_LEAFLET (self->main_leaflet), "panel");
g_free (self->current_panel_id);
self->current_panel_id = g_strdup (start_id);
......@@ -503,12 +527,39 @@ switch_to_previous_panel (CcWindow *self)
g_debug ("Going to previous panel (%s)", previous_panel_id);
set_active_panel_from_id (CC_SHELL (self), previous_panel_id, NULL, FALSE, NULL);
set_active_panel_from_id (CC_SHELL (self), previous_panel_id, NULL, FALSE, FALSE, NULL);
CC_EXIT;
}
/* Callbacks */
static void
update_fold_state (CcWindow *shell)
{
GtkWidget *header_child = hdy_leaflet_get_visible_child (HDY_LEAFLET (shell->header_box));
HdyFold fold = hdy_leaflet_get_fold (HDY_LEAFLET (shell->header_box));
hdy_header_group_set_focus (shell->header_group, fold == HDY_FOLD_FOLDED ? GTK_HEADER_BAR (header_child) : NULL);
gtk_revealer_set_reveal_child (GTK_REVEALER (shell->back_revealer), fold == HDY_FOLD_FOLDED);
}
static void
notify_header_visible_child_cb (HdyLeaflet *leaflet,
GParamSpec *pspec,
CcWindow *shell)
{
update_fold_state (shell);
}
static void
notify_fold_cb (HdyLeaflet *leaflet,
GParamSpec *pspec,
CcWindow *shell)
{
update_fold_state (shell);
}
static void
show_panel_cb (CcPanelList *panel_list,
const gchar *panel_id,
......@@ -517,7 +568,7 @@ show_panel_cb (CcPanelList *panel_list,
if (!panel_id)
return;
set_active_panel_from_id (CC_SHELL (self), panel_id, NULL, TRUE, NULL);
set_active_panel_from_id (CC_SHELL (self), panel_id, NULL, TRUE, FALSE, NULL);
}
static void
......@@ -531,6 +582,13 @@ search_entry_activate_cb (GtkEntry *entry,
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (self->search_bar), !changed);
}
static void
back_button_clicked_cb (GtkButton *button,
CcWindow *shell)
{
hdy_leaflet_set_visible_child_name (HDY_LEAFLET (shell->main_leaflet), "sidebar");
}
static void
previous_button_clicked_cb (GtkButton *button,
CcWindow *shell)
......@@ -647,30 +705,6 @@ window_key_press_event_cb (GtkWidget *win,
return retval;
}
static void
split_decorations_cb (GtkSettings *settings,
GParamSpec *pspec,
CcWindow *self)
{
g_autofree gchar *layout = NULL;
g_autofree gchar *layout_start = NULL;
g_autofree gchar *layout_end = NULL;
g_auto(GStrv) buttons = NULL;
g_object_get (settings, "gtk-decoration-layout", &layout, NULL);
buttons = g_strsplit (layout, ":", -1);
layout_start = g_strconcat ("", buttons[0], ":", NULL);
if (g_strv_length (buttons) > 1)
layout_end = g_strconcat (":", buttons[1], NULL);
else
layout_end = g_strdup ("");
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (self->header), layout_start);
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (self->panel_headerbar), layout_end);
}
static void
on_development_warning_dialog_responded_cb (GtkWidget *dialog,
gint response,
......@@ -689,7 +723,7 @@ cc_window_set_active_panel_from_id (CcShell *shell,
GVariant *parameters,
GError **error)
{
return set_active_panel_from_id (shell, start_id, parameters, TRUE, error);
return set_active_panel_from_id (shell, start_id, parameters, TRUE, TRUE, error);
}
static void
......@@ -788,20 +822,10 @@ static void
cc_window_constructed (GObject *object)
{
g_autofree char *id = NULL;
GtkSettings *settings;
CcWindow *self;
self = CC_WINDOW (object);
/* Handle decorations for the split headers. */
settings = gtk_settings_get_default ();
g_signal_connect (settings,
"notify::gtk-decoration-layout",
G_CALLBACK (split_decorations_cb),
self);
split_decorations_cb (settings, NULL, self);
/* Add the panels */
setup_model (self);
......@@ -873,11 +897,14 @@ cc_window_class_init (CcWindowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/ControlCenter/gtk/cc-window.ui");
gtk_widget_class_bind_template_child (widget_class, CcWindow, back_revealer);
gtk_widget_class_bind_template_child (widget_class, CcWindow, development_warning_dialog);
gtk_widget_class_bind_template_child (widget_class, CcWindow, header);
gtk_widget_class_bind_template_child (widget_class, CcWindow, header_box);
gtk_widget_class_bind_template_child (widget_class, CcWindow, header_group);
gtk_widget_class_bind_template_child (widget_class, CcWindow, header_sizegroup);
gtk_widget_class_bind_template_child (widget_class, CcWindow, list_scrolled);
gtk_widget_class_bind_template_child (widget_class, CcWindow, main_leaflet);
gtk_widget_class_bind_template_child (widget_class, CcWindow, panel_headerbar);
gtk_widget_class_bind_template_child (widget_class, CcWindow, panel_list);
gtk_widget_class_bind_template_child (widget_class, CcWindow, previous_button);
......@@ -887,7 +914,10 @@ cc_window_class_init (CcWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, CcWindow, stack);
gtk_widget_class_bind_template_child (widget_class, CcWindow, top_right_box);
gtk_widget_class_bind_template_callback (widget_class, back_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, gdk_window_set_cb);
gtk_widget_class_bind_template_callback (widget_class, notify_header_visible_child_cb);
gtk_widget_class_bind_template_callback (widget_class, notify_fold_cb);
gtk_widget_class_bind_template_callback (widget_class, on_development_warning_dialog_responded_cb);
gtk_widget_class_bind_template_callback (widget_class, previous_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, search_entry_activate_cb);
......@@ -909,10 +939,13 @@ cc_window_init (CcWindow *self)
self->settings = g_settings_new ("org.gnome.ControlCenter");
self->custom_widgets = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
self->previous_panels = g_queue_new ();
self->previous_list_view = cc_panel_list_get_view (CC_PANEL_LIST (self->panel_list));
/* Add a custom CSS class on development builds */
if (in_flatpak_sandbox ())
add_development_build_css (self);
update_fold_state (self);
}
CcWindow *
......
......@@ -10,9 +10,11 @@
<signal name="map-event" handler="window_map_event_cb" object="CcWindow" swapped="no" />
<signal name="key-press-event" handler="window_key_press_event_cb" object="CcWindow" swapped="no" after="yes" />
<child>
<object class="GtkBox" id="main_hbox">
<object class="HdyLeaflet" id="main_leaflet">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="mode-transition-type">slide</property>
<property name="child-transition-type">slide</property>
<child>
<object class="GtkBox" id="sidebar_box">
<property name="visible">True</property>
......@@ -74,22 +76,18 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="name">sidebar</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<object class="GtkSeparator" id="panel_separator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<style>
<class name="sidebar"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
......@@ -98,121 +96,176 @@
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="transition_type">crossfade</property>
<property name="width_request">300</property>
<style>
<class name="background"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="name">panel</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkBox" id="header_box">
<object class="HdyTitleBar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkHeaderBar" id="header">
<object class="HdyLeaflet" id="header_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show-close-button">True</property>
<property name="title" translatable="yes">Settings</property>
<property name="orientation">horizontal</property>
<property name="mode-transition-type" bind-source="main_leaflet" bind-property="mode-transition-type" bind-flags="bidirectional|sync-create"/>
<property name="mode-transition-duration" bind-source="main_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
<property name="child-transition-type" bind-source="main_leaflet" bind-property="child-transition-type" bind-flags="bidirectional|sync-create"/>
<property name="child-transition-duration" bind-source="main_leaflet" bind-property="child-transition-duration" bind-flags="bidirectional|sync-create"/>
<property name="visible-child-name" bind-source="main_leaflet" bind-property="visible-child-name" bind-flags="bidirectional|sync-create"/>
<signal name="notify::visible-child" handler="notify_header_visible_child_cb" swapped="no"/>
<signal name="notify::fold" handler="notify_fold_cb" object="CcWindow" after="yes" swapped="no"/>
<child>
<object class="GtkButton" id="previous_button">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="previous_button_clicked_cb" object="CcWindow" swapped="no" />
<object class="GtkHeaderBar" id="header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show-close-button">True</property>
<property name="title" translatable="yes">Settings</property>
<child>
<object class="GtkButton" id="previous_button">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="previous_button_clicked_cb" object="CcWindow" swapped="no" />
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
</object>
</child>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-button1">
<property name="accessible-name" translatable="yes">All Settings</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
</child>
<child>
<object class="GtkImage">
<object class="GtkToggleButton" id="search_button">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Search</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-find-symbolic</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
</child>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-button1">
<property name="accessible-name" translatable="yes">All Settings</property>
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="menu_model">primary_menu</property>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Primary Menu</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="name">sidebar</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="search_button">
<object class="GtkSeparator" id="header_separator">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Search</property>
</object>
</child>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">edit-find-symbolic</property>
</object>
</child>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<style>
<class name="image-button"/>
<class name="sidebar"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuButton">
<object class="GtkHeaderBar" id="panel_headerbar">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="menu_model">primary_menu</property>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Primary Menu</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkRevealer" id="back_revealer">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition-type">crossfade</property>
<property name="transition-duration" bind-source="main_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
<child>
<object class="GtkButton" id="back">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="valign">center</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="back_button_clicked_cb" object="CcWindow" swapped="no" />
<style>
<class name="image-button"/>
</style>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-back">
<property name="accessible-name" translatable="yes">Back</property>
</object>
</child>
<child>
<object class="GtkImage" id="back_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkImage">
<object class="GtkBox" id="top_right_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
</child>
<child>
<object class="GtkHeaderBar" id="panel_headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkBox" id="top_right_box">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="pack_type">end</property>
<property name="name">panel</property>
</packing>
</child>
</object>
......@@ -220,6 +273,14 @@
</object>
</child>
</template>
<object class="HdyHeaderGroup" id="header_group">
<headerbars>
<headerbar name="header"/>
<headerbar name="panel_headerbar"/>
</headerbars>
</object>
<object class="GtkSizeGroup" id="header_sizegroup">
<property name="mode">vertical</property>
<widgets>
......@@ -237,6 +298,24 @@
</widgets>
</object>
<!-- Synchronize separators -->
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="header_separator"/>
<widget name="panel_separator"/>
</widgets>
</object>
<!-- Synchronize right header and panel -->
<object class="GtkSizeGroup">
<property name="mode">horizontal</property>
<widgets>
<widget name="panel_headerbar"/>
<widget name="stack"/>
</widgets>
</object>
<!-- Warning dialog for development builds -->
<object class="GtkMessageDialog" id="development_warning_dialog">
<property name="message-type">warning</property>
......