Implement view-selection-changed signal handler
This commit is contained in:
parent
f44c5b8c86
commit
4a42ae40b6
@ -1289,6 +1289,30 @@ ag_window_list_item_activated_cb(GdMainView *view,
|
|||||||
ag_window_change_tab(window, "chart");
|
ag_window_change_tab(window, "chart");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ag_window_list_selection_changed_cb(GdMainView *view, AgWindow *window)
|
||||||
|
{
|
||||||
|
GList *selection;
|
||||||
|
guint count;
|
||||||
|
AgWindowPrivate *priv = ag_window_get_instance_private(window);
|
||||||
|
|
||||||
|
selection = gd_main_view_get_selection(view);
|
||||||
|
|
||||||
|
if ((count = g_list_length(selection)) > 0) {
|
||||||
|
gtk_revealer_set_reveal_child(
|
||||||
|
GTK_REVEALER(priv->selection_toolbar),
|
||||||
|
TRUE
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
gtk_revealer_set_reveal_child(
|
||||||
|
GTK_REVEALER(priv->selection_toolbar),
|
||||||
|
FALSE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Here it is possible to set button sensitivity later
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ag_window_init(AgWindow *window)
|
ag_window_init(AgWindow *window)
|
||||||
{
|
{
|
||||||
@ -1357,6 +1381,12 @@ ag_window_init(AgWindow *window)
|
|||||||
G_CALLBACK(ag_window_list_item_activated_cb),
|
G_CALLBACK(ag_window_list_item_activated_cb),
|
||||||
window
|
window
|
||||||
);
|
);
|
||||||
|
g_signal_connect(
|
||||||
|
priv->tab_list,
|
||||||
|
"view-selection-changed",
|
||||||
|
G_CALLBACK(ag_window_list_selection_changed_cb),
|
||||||
|
window
|
||||||
|
);
|
||||||
|
|
||||||
gtk_stack_set_visible_child_name(GTK_STACK(priv->stack), "list");
|
gtk_stack_set_visible_child_name(GTK_STACK(priv->stack), "list");
|
||||||
priv->current_tab = priv->tab_list;
|
priv->current_tab = priv->tab_list;
|
||||||
|
Loading…
Reference in New Issue
Block a user