Commit f23c77b1 authored by Matthias Clasen's avatar Matthias Clasen

inspector: Some more cleanup

The last commit left some unused functions behind.
parent e5a5f0a5
......@@ -135,87 +135,6 @@ row_activated (GtkTreeView *tv,
show_node_prop_editor (&npe);
}
static void
show_node_popover (GtkInspectorCssNodeTree *cnt,
gdouble x,
gdouble y)
{
GtkTreeSelection *selection;
GdkRectangle rect;
GtkWidget *popover;
GtkWidget *box;
GtkWidget *button;
GtkTreeIter iter;
GtkTreePath *path;
NodePropEditor *npe;
GtkCssNode *node;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (cnt->priv->node_tree));
if (!gtk_tree_selection_get_selected (selection, NULL, &iter))
return;
path = gtk_tree_model_get_path (cnt->priv->node_model, &iter);
gtk_tree_view_get_cell_area (GTK_TREE_VIEW (cnt->priv->node_tree), path, NULL, &rect);
gtk_tree_view_convert_bin_window_to_widget_coords (GTK_TREE_VIEW (cnt->priv->node_tree),
rect.x, rect.y, &rect.x, &rect.y);
rect.x = CLAMP (x - 20, 0, gtk_widget_get_allocated_width (cnt->priv->node_tree) - 40);
rect.width = 40;
node = gtk_tree_model_css_node_get_node_from_iter (GTK_TREE_MODEL_CSS_NODE (cnt->priv->node_model), &iter);
npe = g_new0 (NodePropEditor, 1);
npe->node = node;
npe->prop_name = "name";
npe->rect = rect;
npe->cnt = cnt;
popover = gtk_popover_new (GTK_WIDGET (cnt->priv->node_tree));
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &rect);
box = g_object_new (GTK_TYPE_BOX,
"orientation", GTK_ORIENTATION_VERTICAL,
"visible", TRUE,
"margin", 10,
NULL);
gtk_container_add (GTK_CONTAINER (popover), box);
button = g_object_new (GTK_TYPE_MODEL_BUTTON,
"visible", TRUE,
"text", _("Change name"),
NULL);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_node_prop_editor), npe);
g_object_set_data_full (G_OBJECT (popover), "prop-name", npe, g_free);
gtk_container_add (GTK_CONTAINER (box), button);
npe = g_new0 (NodePropEditor, 1);
npe->node = node;
npe->prop_name = "classes";
npe->rect = rect;
npe->cnt = cnt;
button = g_object_new (GTK_TYPE_MODEL_BUTTON,
"visible", TRUE,
"text", _("Change classes"),
NULL);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_node_prop_editor), npe);
g_object_set_data_full (G_OBJECT (popover), "prop-classes", npe, g_free);
gtk_container_add (GTK_CONTAINER (box), button);
button = g_object_new (GTK_TYPE_MODEL_BUTTON,
"visible", TRUE,
"text", _("CSS properties"),
NULL);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_tree_path_free (path);
gtk_widget_show (popover);
g_signal_connect (popover, "unmap", G_CALLBACK (gtk_widget_destroy), NULL);
}
static void
gtk_inspector_css_node_tree_set_node (GtkInspectorCssNodeTree *cnt,
GtkCssNode *node);
......
......@@ -28,7 +28,6 @@
<property name="enable-search">0</property>
<property name="enable-grid-lines">vertical</property>
<signal name="row-activated" handler="row_activated"/>
<signal name="button-press-event" handler="button_pressed"/>
<child internal-child="selection">
<object class="GtkTreeSelection">
<signal name="changed" handler="selection_changed"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment