[gnumeric] GnmSOLine: add editor for tail arrow.



commit 7f842bd392250ef4422c0e977f5d61d98fc7011b
Author: Morten Welinder <terra gnome org>
Date:   Wed Feb 11 11:46:22 2015 -0500

    GnmSOLine: add editor for tail arrow.

 src/dialogs/dialog-so-styled.c |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/src/dialogs/dialog-so-styled.c b/src/dialogs/dialog-so-styled.c
index 104ec93..8e5b13a 100644
--- a/src/dialogs/dialog-so-styled.c
+++ b/src/dialogs/dialog-so-styled.c
@@ -128,21 +128,24 @@ cb_arrow_changed (GOArrowSel *as,
                  G_GNUC_UNUSED GParamSpec *pspec,
                  DialogSOStyled *state)
 {
+       const char *prop = g_object_get_data (G_OBJECT (as), "prop");
        g_object_set (state->so,
-                     "end-arrow", go_arrow_sel_get_arrow (as),
+                     prop, go_arrow_sel_get_arrow (as),
                      NULL);
 }
 
 static GtkWidget *
-dialog_so_styled_line_widget (DialogSOStyled *state)
+dialog_so_styled_line_widget (DialogSOStyled *state, const char *prop)
 {
        GtkWidget *w = go_arrow_sel_new ();
        GOArrow *arrow;
 
-       g_object_get (state->so, "end-arrow", &arrow, NULL);
+       g_object_get (state->so, prop, &arrow, NULL);
        go_arrow_sel_set_arrow (GO_ARROW_SEL (w), arrow);
        g_free (arrow);
 
+       g_object_set_data_full (G_OBJECT (w), "prop", g_strdup (prop), g_free);
+
        g_signal_connect (G_OBJECT (w),
                          "notify::arrow",
                          G_CALLBACK (cb_arrow_changed),
@@ -210,7 +213,7 @@ dialog_so_styled (WBCGtk *wbcg,
        }
 
        if (extent & SO_STYLED_LINE) {
-               GtkWidget *w = dialog_so_styled_line_widget (state);
+               GtkWidget *w = dialog_so_styled_line_widget (state, "end-arrow");
                gtk_widget_show_all (w);
                if (GTK_IS_NOTEBOOK (editor))
                        gtk_notebook_append_page (GTK_NOTEBOOK (editor), w,
@@ -220,6 +223,17 @@ dialog_so_styled (WBCGtk *wbcg,
                                            w, TRUE, TRUE, TRUE);
        }
 
+       if (extent & SO_STYLED_LINE) {
+               GtkWidget *w = dialog_so_styled_line_widget (state, "start-arrow");
+               gtk_widget_show_all (w);
+               if (GTK_IS_NOTEBOOK (editor))
+                       gtk_notebook_append_page (GTK_NOTEBOOK (editor), w,
+                                                 gtk_label_new (_("Tail")));
+               else
+                       gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
+                                           w, TRUE, TRUE, TRUE);
+       }
+
        g_signal_connect (G_OBJECT (dialog), "response",
                G_CALLBACK (cb_dialog_so_styled_response), state);
        gnumeric_keyed_dialog (state->wbcg, GTK_WINDOW (dialog),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]