keyboard: remove the shortcuts treeview
After porting the shortcuts management entirely to GtkListBox, the current treeview is not necessary anymore. This patch removes the shortcuts treeview and all the related functions, and separates the treeviews from the underlying models. https://bugzilla.gnome.org/show_bug.cgi?id=769063
This commit is contained in:
parent
fd3044272e
commit
847fe447da
2 changed files with 66 additions and 289 deletions
|
@ -47,19 +47,14 @@ struct _CcKeyboardPanel
|
||||||
{
|
{
|
||||||
CcPanel parent;
|
CcPanel parent;
|
||||||
|
|
||||||
/* Treeviews */
|
/* Shortcut models */
|
||||||
|
GtkListStore *shortcuts_model;
|
||||||
GtkListStore *sections_store;
|
GtkListStore *sections_store;
|
||||||
GtkTreeModel *sections_model;
|
GtkTreeModel *sections_model;
|
||||||
GtkWidget *shortcut_treeview;
|
|
||||||
GtkWidget *listbox;
|
GtkWidget *listbox;
|
||||||
GtkListBoxRow *add_shortcut_row;
|
GtkListBoxRow *add_shortcut_row;
|
||||||
GtkSizeGroup *accelerator_sizegroup;
|
GtkSizeGroup *accelerator_sizegroup;
|
||||||
|
|
||||||
/* Toolbar widgets */
|
|
||||||
GtkWidget *add_toolbutton;
|
|
||||||
GtkWidget *remove_toolbutton;
|
|
||||||
GtkWidget *shortcut_toolbar;
|
|
||||||
|
|
||||||
/* Custom shortcut dialog */
|
/* Custom shortcut dialog */
|
||||||
GtkWidget *custom_shortcut_command_entry;
|
GtkWidget *custom_shortcut_command_entry;
|
||||||
GtkWidget *custom_shortcut_dialog;
|
GtkWidget *custom_shortcut_dialog;
|
||||||
|
@ -458,7 +453,7 @@ append_section (CcKeyboardPanel *self,
|
||||||
if (!hash)
|
if (!hash)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
shortcut_model = gtk_tree_view_get_model (GTK_TREE_VIEW (self->shortcut_treeview));
|
shortcut_model = GTK_TREE_MODEL (self->shortcuts_model);
|
||||||
|
|
||||||
/* Add all CcKeyboardItems for this section */
|
/* Add all CcKeyboardItems for this section */
|
||||||
is_new = FALSE;
|
is_new = FALSE;
|
||||||
|
@ -691,7 +686,7 @@ reload_sections (CcKeyboardPanel *self)
|
||||||
const gchar * const * data_dirs;
|
const gchar * const * data_dirs;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
shortcut_model = gtk_tree_view_get_model (GTK_TREE_VIEW (self->shortcut_treeview));
|
shortcut_model = GTK_TREE_MODEL (self->shortcuts_model);
|
||||||
/* FIXME: get current selection and keep it after refreshing */
|
/* FIXME: get current selection and keep it after refreshing */
|
||||||
|
|
||||||
/* Clear previous models and hash tables */
|
/* Clear previous models and hash tables */
|
||||||
|
@ -805,11 +800,9 @@ section_sort_item (GtkTreeModel *model,
|
||||||
static void
|
static void
|
||||||
add_shortcuts (CcKeyboardPanel *self)
|
add_shortcuts (CcKeyboardPanel *self)
|
||||||
{
|
{
|
||||||
GtkTreeModel *shortcuts;
|
|
||||||
GtkTreeIter sections_iter;
|
GtkTreeIter sections_iter;
|
||||||
gboolean can_continue;
|
gboolean can_continue;
|
||||||
|
|
||||||
shortcuts = gtk_tree_view_get_model (GTK_TREE_VIEW (self->shortcut_treeview));
|
|
||||||
can_continue = gtk_tree_model_get_iter_first (self->sections_model, §ions_iter);
|
can_continue = gtk_tree_model_get_iter_first (self->sections_model, §ions_iter);
|
||||||
|
|
||||||
while (can_continue)
|
while (can_continue)
|
||||||
|
@ -843,8 +836,8 @@ add_shortcuts (CcKeyboardPanel *self)
|
||||||
{
|
{
|
||||||
GtkTreeIter new_row;
|
GtkTreeIter new_row;
|
||||||
|
|
||||||
gtk_list_store_append (GTK_LIST_STORE (shortcuts), &new_row);
|
gtk_list_store_append (self->shortcuts_model, &new_row);
|
||||||
gtk_list_store_set (GTK_LIST_STORE (shortcuts),
|
gtk_list_store_set (self->shortcuts_model,
|
||||||
&new_row,
|
&new_row,
|
||||||
DETAIL_DESCRIPTION_COLUMN, item->description,
|
DETAIL_DESCRIPTION_COLUMN, item->description,
|
||||||
DETAIL_KEYENTRY_COLUMN, item,
|
DETAIL_KEYENTRY_COLUMN, item,
|
||||||
|
@ -1087,9 +1080,7 @@ remove_custom_shortcut (CcKeyboardPanel *self,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_custom_shortcut (CcKeyboardPanel *self,
|
add_custom_shortcut (CcKeyboardPanel *self)
|
||||||
GtkTreeView *tree_view,
|
|
||||||
GtkTreeModel *model)
|
|
||||||
{
|
{
|
||||||
CcKeyboardItem *item;
|
CcKeyboardItem *item;
|
||||||
GtkTreePath *path;
|
GtkTreePath *path;
|
||||||
|
@ -1101,7 +1092,7 @@ add_custom_shortcut (CcKeyboardPanel *self,
|
||||||
cc_keyboard_item_load_from_gsettings_path (item, settings_path, TRUE);
|
cc_keyboard_item_load_from_gsettings_path (item, settings_path, TRUE);
|
||||||
g_free (settings_path);
|
g_free (settings_path);
|
||||||
|
|
||||||
item->model = model;
|
item->model = GTK_TREE_MODEL (self->shortcuts_model);
|
||||||
item->group = BINDING_GROUP_USER;
|
item->group = BINDING_GROUP_USER;
|
||||||
|
|
||||||
if (edit_custom_shortcut (self, item) && item->command && item->command[0])
|
if (edit_custom_shortcut (self, item) && item->command && item->command[0])
|
||||||
|
@ -1123,8 +1114,8 @@ add_custom_shortcut (CcKeyboardPanel *self,
|
||||||
|
|
||||||
g_ptr_array_add (keys_array, item);
|
g_ptr_array_add (keys_array, item);
|
||||||
|
|
||||||
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
|
gtk_list_store_append (self->shortcuts_model, &iter);
|
||||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter, DETAIL_KEYENTRY_COLUMN, item, -1);
|
gtk_list_store_set (self->shortcuts_model, &iter, DETAIL_KEYENTRY_COLUMN, item, -1);
|
||||||
|
|
||||||
settings_paths = g_settings_get_strv (self->binding_settings, "custom-keybindings");
|
settings_paths = g_settings_get_strv (self->binding_settings, "custom-keybindings");
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
||||||
|
@ -1135,9 +1126,7 @@ add_custom_shortcut (CcKeyboardPanel *self,
|
||||||
g_variant_builder_end (&builder));
|
g_variant_builder_end (&builder));
|
||||||
|
|
||||||
/* make the new shortcut visible */
|
/* make the new shortcut visible */
|
||||||
path = gtk_tree_model_get_path (model, &iter);
|
path = gtk_tree_model_get_path (GTK_TREE_MODEL (self->shortcuts_model), &iter);
|
||||||
gtk_tree_view_expand_to_path (tree_view, path);
|
|
||||||
gtk_tree_view_scroll_to_cell (tree_view, path, NULL, FALSE, 0, 0);
|
|
||||||
gtk_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
|
|
||||||
add_item (self, item, CUSTOM_SHORTCUTS_ID, _("Custom Shortcuts"));
|
add_item (self, item, CUSTOM_SHORTCUTS_ID, _("Custom Shortcuts"));
|
||||||
|
@ -1582,7 +1571,7 @@ accel_edited_callback (GtkCellRendererText *cell,
|
||||||
CcKeyboardItem *reverse_item;
|
CcKeyboardItem *reverse_item;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (self->shortcut_treeview));
|
model = GTK_TREE_MODEL (self->shortcuts_model);
|
||||||
gtk_tree_model_get_iter (model, &iter, path);
|
gtk_tree_model_get_iter (model, &iter, path);
|
||||||
gtk_tree_path_free (path);
|
gtk_tree_path_free (path);
|
||||||
gtk_tree_model_get (model, &iter,
|
gtk_tree_model_get (model, &iter,
|
||||||
|
@ -1699,36 +1688,12 @@ shortcut_entry_changed (GtkEntry *entry,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_button_clicked (GtkWidget *button,
|
shortcut_row_activated (GtkWidget *button,
|
||||||
CcKeyboardPanel *self)
|
GtkListBoxRow *row,
|
||||||
|
CcKeyboardPanel *self)
|
||||||
{
|
{
|
||||||
GtkTreeView *treeview;
|
if (row == self->add_shortcut_row)
|
||||||
GtkTreeModel *model;
|
add_custom_shortcut (self);
|
||||||
|
|
||||||
treeview = GTK_TREE_VIEW (self->shortcut_treeview);
|
|
||||||
model = gtk_tree_view_get_model (treeview);
|
|
||||||
|
|
||||||
/* And add the shortcut */
|
|
||||||
add_custom_shortcut (self, treeview, model);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
remove_button_clicked (GtkWidget *button,
|
|
||||||
CcKeyboardPanel *self)
|
|
||||||
{
|
|
||||||
GtkTreeView *treeview;
|
|
||||||
GtkTreeModel *model;
|
|
||||||
GtkTreeSelection *selection;
|
|
||||||
GtkTreeIter iter;
|
|
||||||
|
|
||||||
treeview = GTK_TREE_VIEW (self->shortcut_treeview);
|
|
||||||
model = gtk_tree_view_get_model (treeview);
|
|
||||||
selection = gtk_tree_view_get_selection (treeview);
|
|
||||||
|
|
||||||
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
|
|
||||||
{
|
|
||||||
remove_custom_shortcut (self, model, &iter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1737,19 +1702,11 @@ xkb_options_combo_changed (GtkCellRendererCombo *combo,
|
||||||
GtkTreeIter *model_iter,
|
GtkTreeIter *model_iter,
|
||||||
CcKeyboardPanel *self)
|
CcKeyboardPanel *self)
|
||||||
{
|
{
|
||||||
GtkTreeView *shortcut_treeview;
|
|
||||||
GtkTreeModel *shortcut_model;
|
GtkTreeModel *shortcut_model;
|
||||||
GtkTreeIter shortcut_iter;
|
GtkTreeIter shortcut_iter;
|
||||||
GtkTreeSelection *selection;
|
|
||||||
CcKeyboardOption *option;
|
CcKeyboardOption *option;
|
||||||
ShortcutType type;
|
ShortcutType type;
|
||||||
|
|
||||||
shortcut_treeview = GTK_TREE_VIEW (self->shortcut_treeview);
|
|
||||||
selection = gtk_tree_view_get_selection (shortcut_treeview);
|
|
||||||
|
|
||||||
if (!gtk_tree_selection_get_selected (selection, &shortcut_model, &shortcut_iter))
|
|
||||||
return;
|
|
||||||
|
|
||||||
gtk_tree_model_get (shortcut_model, &shortcut_iter,
|
gtk_tree_model_get (shortcut_model, &shortcut_iter,
|
||||||
DETAIL_KEYENTRY_COLUMN, &option,
|
DETAIL_KEYENTRY_COLUMN, &option,
|
||||||
DETAIL_TYPE_COLUMN, &type,
|
DETAIL_TYPE_COLUMN, &type,
|
||||||
|
@ -1764,12 +1721,8 @@ xkb_options_combo_changed (GtkCellRendererCombo *combo,
|
||||||
static void
|
static void
|
||||||
setup_tree_views (CcKeyboardPanel *self)
|
setup_tree_views (CcKeyboardPanel *self)
|
||||||
{
|
{
|
||||||
GtkTreeViewColumn *column;
|
|
||||||
GtkCellRenderer *renderer;
|
|
||||||
GtkListStore *model;
|
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
CcShell *shell;
|
CcShell *shell;
|
||||||
GList *focus_chain;
|
|
||||||
|
|
||||||
/* Setup the section treeview */
|
/* Setup the section treeview */
|
||||||
self->sections_store = gtk_list_store_new (SECTION_N_COLUMNS,
|
self->sections_store = gtk_list_store_new (SECTION_N_COLUMNS,
|
||||||
|
@ -1788,74 +1741,12 @@ setup_tree_views (CcKeyboardPanel *self)
|
||||||
SECTION_DESCRIPTION_COLUMN,
|
SECTION_DESCRIPTION_COLUMN,
|
||||||
GTK_SORT_ASCENDING);
|
GTK_SORT_ASCENDING);
|
||||||
|
|
||||||
/* Setup the shortcut treeview */
|
self->shortcuts_model = gtk_list_store_new (DETAIL_N_COLUMNS,
|
||||||
renderer = gtk_cell_renderer_text_new ();
|
G_TYPE_STRING,
|
||||||
g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
G_TYPE_POINTER,
|
||||||
|
G_TYPE_INT);
|
||||||
|
|
||||||
column = gtk_tree_view_column_new_with_attributes (NULL, renderer, NULL);
|
setup_keyboard_options (self->shortcuts_model);
|
||||||
gtk_tree_view_column_set_cell_data_func (column, renderer, description_set_func, NULL, NULL);
|
|
||||||
gtk_tree_view_column_set_resizable (column, FALSE);
|
|
||||||
gtk_tree_view_column_set_expand (column, TRUE);
|
|
||||||
|
|
||||||
gtk_tree_view_append_column (GTK_TREE_VIEW (self->shortcut_treeview), column);
|
|
||||||
|
|
||||||
renderer = (GtkCellRenderer *) g_object_new (GTK_TYPE_CELL_RENDERER_ACCEL,
|
|
||||||
"accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
g_signal_connect (self->shortcut_treeview,
|
|
||||||
"button_press_event",
|
|
||||||
G_CALLBACK (start_editing_cb),
|
|
||||||
renderer);
|
|
||||||
g_signal_connect (self->shortcut_treeview,
|
|
||||||
"row-activated",
|
|
||||||
G_CALLBACK (start_editing_kb_cb),
|
|
||||||
renderer);
|
|
||||||
|
|
||||||
g_signal_connect (renderer,
|
|
||||||
"accel_edited",
|
|
||||||
G_CALLBACK (accel_edited_callback),
|
|
||||||
self);
|
|
||||||
g_signal_connect (renderer,
|
|
||||||
"accel_cleared",
|
|
||||||
G_CALLBACK (accel_cleared_callback),
|
|
||||||
self->shortcut_treeview);
|
|
||||||
|
|
||||||
column = gtk_tree_view_column_new_with_attributes (NULL, renderer, NULL);
|
|
||||||
gtk_tree_view_column_set_cell_data_func (column, renderer, accel_set_func, NULL, NULL);
|
|
||||||
gtk_tree_view_column_set_resizable (column, FALSE);
|
|
||||||
gtk_tree_view_column_set_expand (column, FALSE);
|
|
||||||
|
|
||||||
renderer = (GtkCellRenderer *) g_object_new (GTK_TYPE_CELL_RENDERER_COMBO,
|
|
||||||
"has-entry", FALSE,
|
|
||||||
"text-column", XKB_OPTION_DESCRIPTION_COLUMN,
|
|
||||||
"editable", TRUE,
|
|
||||||
"ellipsize", PANGO_ELLIPSIZE_END,
|
|
||||||
"width-chars", 25,
|
|
||||||
NULL);
|
|
||||||
g_signal_connect (renderer,
|
|
||||||
"changed",
|
|
||||||
G_CALLBACK (xkb_options_combo_changed),
|
|
||||||
self);
|
|
||||||
|
|
||||||
gtk_tree_view_column_pack_end (column, renderer, FALSE);
|
|
||||||
|
|
||||||
gtk_tree_view_column_set_cell_data_func (column, renderer, accel_set_func, NULL, NULL);
|
|
||||||
|
|
||||||
gtk_tree_view_append_column (GTK_TREE_VIEW (self->shortcut_treeview), column);
|
|
||||||
|
|
||||||
model = gtk_list_store_new (DETAIL_N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_INT);
|
|
||||||
gtk_tree_view_set_model (GTK_TREE_VIEW (self->shortcut_treeview), GTK_TREE_MODEL (model));
|
|
||||||
g_object_unref (model);
|
|
||||||
|
|
||||||
setup_keyboard_options (model);
|
|
||||||
|
|
||||||
/* set up the focus chain */
|
|
||||||
focus_chain = g_list_append (NULL, self->shortcut_treeview);
|
|
||||||
focus_chain = g_list_append (focus_chain, self->shortcut_toolbar);
|
|
||||||
|
|
||||||
gtk_container_set_focus_chain (GTK_CONTAINER (self), focus_chain);
|
|
||||||
g_list_free (focus_chain);
|
|
||||||
|
|
||||||
/* set up the dialog */
|
/* set up the dialog */
|
||||||
shell = cc_panel_get_shell (CC_PANEL (self));
|
shell = cc_panel_get_shell (CC_PANEL (self));
|
||||||
|
@ -1901,6 +1792,7 @@ cc_keyboard_panel_finalize (GObject *object)
|
||||||
g_clear_object (&self->accelerator_sizegroup);
|
g_clear_object (&self->accelerator_sizegroup);
|
||||||
g_clear_object (&self->custom_shortcut_dialog);
|
g_clear_object (&self->custom_shortcut_dialog);
|
||||||
g_clear_object (&self->binding_settings);
|
g_clear_object (&self->binding_settings);
|
||||||
|
g_clear_object (&self->shortcuts_model);
|
||||||
g_clear_object (&self->sections_store);
|
g_clear_object (&self->sections_store);
|
||||||
g_clear_object (&self->sections_model);
|
g_clear_object (&self->sections_model);
|
||||||
|
|
||||||
|
@ -1953,19 +1845,14 @@ cc_keyboard_panel_class_init (CcKeyboardPanelClass *klass)
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/keyboard/gnome-keyboard-panel.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/keyboard/gnome-keyboard-panel.ui");
|
||||||
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, add_shortcut_row);
|
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, add_shortcut_row);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, add_toolbutton);
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_command_entry);
|
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_command_entry);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_dialog);
|
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_dialog);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_name_entry);
|
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_name_entry);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_ok_button);
|
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, custom_shortcut_ok_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, listbox);
|
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, listbox);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, remove_toolbutton);
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, shortcut_toolbar);
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, shortcut_treeview);
|
|
||||||
|
|
||||||
gtk_widget_class_bind_template_callback (widget_class, add_button_clicked);
|
|
||||||
gtk_widget_class_bind_template_callback (widget_class, remove_button_clicked);
|
|
||||||
gtk_widget_class_bind_template_callback (widget_class, shortcut_entry_changed);
|
gtk_widget_class_bind_template_callback (widget_class, shortcut_entry_changed);
|
||||||
|
gtk_widget_class_bind_template_callback (widget_class, shortcut_row_activated);
|
||||||
gtk_widget_class_bind_template_callback (widget_class, shortcut_selection_changed);
|
gtk_widget_class_bind_template_callback (widget_class, shortcut_selection_changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,182 +155,72 @@
|
||||||
<template class="CcKeyboardPanel" parent="CcPanel">
|
<template class="CcKeyboardPanel" parent="CcPanel">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="border_width">12</property>
|
<property name="expand">True</property>
|
||||||
|
<property name="border_width">18</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="shortcuts_page">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="border_width">5</property>
|
<property name="halign">center</property>
|
||||||
<property name="spacing">12</property>
|
<property name="spacing">12</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="shortcuts_vbox">
|
<object class="GtkScrolledWindow">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="spacing">6</property>
|
<property name="vexpand">True</property>
|
||||||
|
<property name="hscrollbar_policy">never</property>
|
||||||
|
<property name="shadow_type">in</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid" id="shortcuts_grid">
|
<object class="GtkListBox" id="listbox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="column_spacing">5</property>
|
<property name="selection-mode">none</property>
|
||||||
|
<property name="width-request">250</property>
|
||||||
|
<signal name="row-activated" handler="shortcut_row_activated" object="CcKeyboardPanel" swapped="no" />
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkScrolledWindow">
|
<object class="GtkListBoxRow" id="add_shortcut_row">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="vexpand">True</property>
|
|
||||||
<property name="hscrollbar_policy">never</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeView" id="shortcut_treeview">
|
<object class="GtkBox">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="headers_visible">False</property>
|
<property name="hexpand">True</property>
|
||||||
<property name="rules_hint">True</property>
|
<property name="border_width">6</property>
|
||||||
<child internal-child="selection">
|
<child type="center">
|
||||||
<object class="GtkTreeSelection" id="treeview-selection2">
|
<object class="GtkImage">
|
||||||
<signal name="changed" handler="shortcut_selection_changed" object="remove_toolbutton" swapped="no" />
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkScrolledWindow">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="vexpand">True</property>
|
|
||||||
<property name="hscrollbar_policy">never</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBox" id="listbox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="selection-mode">none</property>
|
|
||||||
<property name="width-request">100</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkListBoxRow" id="add_shortcut_row">
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<property name="icon_name">list-add-symbolic</property>
|
||||||
<object class="GtkBox">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="border_width">6</property>
|
|
||||||
<child type="center">
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="icon_name">list-add-symbolic</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkToolbar" id="shortcut_toolbar">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="icon_size">1</property>
|
|
||||||
<property name="toolbar-style">icons</property>
|
|
||||||
<style>
|
|
||||||
<class name="inline-toolbar"/>
|
|
||||||
</style>
|
|
||||||
<child>
|
|
||||||
<object class="GtkToolButton" id="add_toolbutton">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="icon_name">list-add-symbolic</property>
|
|
||||||
<property name="label" translatable="yes">Add Shortcut</property>
|
|
||||||
<signal name="clicked" handler="add_button_clicked" object="CcKeyboardPanel" swapped="no" />
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="homogeneous">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkToolButton" id="remove_toolbutton">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<property name="use_underline">True</property>
|
|
||||||
<property name="icon_name">list-remove-symbolic</property>
|
|
||||||
<property name="label" translatable="yes">Remove Shortcut</property>
|
|
||||||
<signal name="clicked" handler="remove_button_clicked" object="CcKeyboardPanel" swapped="no" />
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="homogeneous">True</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="hbox1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<property name="spacing">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label12">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="label" translatable="yes">To edit a shortcut, click the row and hold down the new keys or press Backspace to clear.</property>
|
|
||||||
<property name="justify">fill</property>
|
|
||||||
<property name="wrap">True</property>
|
|
||||||
<property name="max_width_chars">70</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
</child>
|
||||||
<property name="expand">True</property>
|
<child>
|
||||||
<property name="fill">True</property>
|
<object class="GtkBox">
|
||||||
<property name="position">0</property>
|
<property name="visible">True</property>
|
||||||
</packing>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="border_width">6</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="label" translatable="yes">To edit a shortcut, click the row and hold down the new keys or press Backspace to clear.</property>
|
||||||
|
<property name="justify">fill</property>
|
||||||
|
<property name="wrap">True</property>
|
||||||
|
<property name="max_width_chars">60</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue