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
This commit is contained in:
Robert Ancell 2019-11-13 16:33:29 +13:00
parent acc8aff5d0
commit 5dbbc20918
6 changed files with 26 additions and 7 deletions

View file

@ -219,7 +219,7 @@ static void
cc_shell_model_init (CcShellModel *self)
{
GType types[] = {G_TYPE_STRING, G_TYPE_STRING, G_TYPE_APP_INFO, G_TYPE_STRING, G_TYPE_UINT,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_ICON, G_TYPE_STRV, G_TYPE_UINT };
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_ICON, G_TYPE_STRV, G_TYPE_UINT, G_TYPE_BOOLEAN };
gtk_list_store_set_column_types (GTK_LIST_STORE (self),
N_COLS, types);
@ -286,11 +286,13 @@ cc_shell_model_add_item (CcShellModel *model,
g_auto(GStrv) keywords = NULL;
g_autofree gchar *casefolded_name = NULL;
g_autofree gchar *casefolded_description = NULL;
gboolean has_sidebar;
casefolded_name = cc_util_normalize_casefold_and_unaccent (name);
casefolded_description = cc_util_normalize_casefold_and_unaccent (comment);
keywords = get_casefolded_keywords (appinfo);
icon = symbolicize_g_icon (g_app_info_get_icon (appinfo));
has_sidebar = g_desktop_app_info_get_boolean (G_DESKTOP_APP_INFO (appinfo), "X-GNOME-ControlCenter-HasSidebar");
gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, 0,
COL_NAME, name,
@ -303,6 +305,7 @@ cc_shell_model_add_item (CcShellModel *model,
COL_GICON, icon,
COL_KEYWORDS, keywords,
COL_VISIBILITY, CC_PANEL_VISIBLE,
COL_HAS_SIDEBAR, has_sidebar,
-1);
}