Hook up furniture selector signal
authorThomas White <taw@bitwiz.me.uk>
Mon, 5 Nov 2018 12:00:50 +0000 (13:00 +0100)
committerThomas White <taw@bitwiz.me.uk>
Mon, 5 Nov 2018 12:00:50 +0000 (13:00 +0100)
data/stylesheeteditor.ui
src/stylesheet_editor.c
src/stylesheet_editor.h

index 60f1ca5..05aa5ae 100644 (file)
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="active">0</property>
+                    <property name="active_id">slidetitle</property>
                     <items>
-                      <item translatable="yes">Presentation title</item>
-                      <item translatable="yes">Presentation author</item>
-                      <item translatable="yes">Slide title</item>
-                      <item translatable="yes">Slide footer</item>
-                      <item translatable="yes">Slide credit</item>
+                      <item id="prestitle" translatable="yes">Presentation title</item>
+                      <item id="presauthor" translatable="yes">Presentation author</item>
+                      <item id="slidetitle" translatable="yes">Slide title</item>
+                      <item id="slidefooter" translatable="yes">Slide footer</item>
+                      <item id="slidecredit" translatable="yes">Slide credit</item>
                     </items>
+                    <signal name="changed" handler="furniture_selector_change_sig" swapped="no"/>
                   </object>
                   <packing>
                     <property name="expand">False</property>
index 0f5b908..1d899c7 100644 (file)
@@ -495,6 +495,13 @@ static void narrative_paraspace_sig(GtkSpinButton *widget, StylesheetEditor *se)
 }
 
 
+static void furniture_selector_change_sig(GtkComboBoxText *widget, StylesheetEditor *se)
+{
+       const gchar *id = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widget));
+       printf("furniture %s\n", id);
+}
+
+
 static void stylesheet_editor_finalize(GObject *obj)
 {
        StylesheetEditor *se = COLLOQUIUM_STYLESHEET_EDITOR(obj);
@@ -565,6 +572,9 @@ void stylesheet_editor_class_init(StylesheetEditorClass *klass)
        SE_BIND_CHILD(frame_style_padding_b, frame_padding_sig);
        SE_BIND_CHILD(frame_style_alignment, frame_alignment_sig);
 
+       /* Furniture */
+       SE_BIND_CHILD(furniture_selector, furniture_selector_change_sig);
+
        gtk_widget_class_bind_template_callback(widget_class, revert_sig);
 
        g_signal_new("changed", COLLOQUIUM_TYPE_STYLESHEET_EDITOR,
index 0dea6d5..f9e5f65 100644 (file)
@@ -91,6 +91,7 @@ struct _stylesheeteditor
        GtkWidget *frame_style_padding_t;
        GtkWidget *frame_style_padding_b;
        GtkWidget *frame_style_alignment;
+       GtkWidget *furniture_selector;
        StylesheetEditorPrivate *priv;
 };