aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-04-16 00:27:34 +0200
committerThomas White <taw@bitwiz.me.uk>2019-04-16 00:27:34 +0200
commit5ffe58d92a54ac4286b2e3aeae139e2f88a3b702 (patch)
tree3db8f68f6b7bb443e7cc38276c6e052e3b465d1d
parentde1c1c49f6f84afe5f0b0c1d8d445fbd8e89997a (diff)
Tree store testing
-rw-r--r--data/stylesheeteditor.ui7
-rw-r--r--src/stylesheet_editor.c19
-rw-r--r--src/stylesheet_editor.h1
3 files changed, 26 insertions, 1 deletions
diff --git a/data/stylesheeteditor.ui b/data/stylesheeteditor.ui
index 1e0c0b8..eac46b9 100644
--- a/data/stylesheeteditor.ui
+++ b/data/stylesheeteditor.ui
@@ -62,7 +62,12 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
- <object class="GtkListStore" id="element_tree"/>
+ <object class="GtkTreeStore" id="element_tree">
+ <columns>
+ <!-- column-name element -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
<template class="StylesheetEditor" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Stylesheet editor</property>
diff --git a/src/stylesheet_editor.c b/src/stylesheet_editor.c
index efff646..5cdd012 100644
--- a/src/stylesheet_editor.c
+++ b/src/stylesheet_editor.c
@@ -200,6 +200,21 @@ static void set_bg_from_ss(Stylesheet *ss, enum style_element el,
static void set_values_from_presentation(StylesheetEditor *se)
{
+ GtkTreeIter iter;
+ GtkTreeIter iter2;
+ GValue val = G_VALUE_INIT;
+ GValue val2 = G_VALUE_INIT;
+
+ gtk_tree_store_append(GTK_TREE_STORE(se->element_tree), &iter, NULL);
+ g_value_init(&val, G_TYPE_STRING);
+ g_value_set_static_string(&val, "Slide");
+ gtk_tree_store_set_value(GTK_TREE_STORE(se->element_tree), &iter, 0, &val);
+
+ gtk_tree_store_append(GTK_TREE_STORE(se->element_tree), &iter2, &iter);
+ g_value_init(&val2, G_TYPE_STRING);
+ g_value_set_static_string(&val2, "Slide title");
+ gtk_tree_store_set_value(GTK_TREE_STORE(se->element_tree), &iter2, 0, &val2);
+
set_geom_from_ss(se->priv->stylesheet, se->priv->el,
se->w, se->h, se->x, se->y, se->w_units, se->h_units);
@@ -387,6 +402,7 @@ static void dims_sig(GtkSpinButton *widget, StylesheetEditor *se)
#endif
}
+
static void font_sig(GtkFontButton *widget, StylesheetEditor *se)
{
}
@@ -396,10 +412,12 @@ static void fgcol_sig(GtkColorButton *widget, StylesheetEditor *se)
{
}
+
static void bg_sig(GtkColorButton *widget, StylesheetEditor *se)
{
}
+
static void selector_change_sig(GtkComboBoxText *widget, StylesheetEditor *se)
{
//se->priv->el = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widget));
@@ -458,6 +476,7 @@ void stylesheet_editor_class_init(StylesheetEditorClass *klass)
SE_BIND_CHILD(y, dims_sig);
SE_BIND_CHILD(w_units, dims_sig);
SE_BIND_CHILD(h_units, dims_sig);
+ gtk_widget_class_bind_template_child(widget_class, StylesheetEditor, element_tree);
gtk_widget_class_bind_template_callback(widget_class, revert_sig);
diff --git a/src/stylesheet_editor.h b/src/stylesheet_editor.h
index 338981d..259fddb 100644
--- a/src/stylesheet_editor.h
+++ b/src/stylesheet_editor.h
@@ -58,6 +58,7 @@ struct _stylesheeteditor
{
GtkDialog parent_instance;
GtkWidget *selector;
+ GtkTreeStore *element_tree;
GtkWidget *paraspace_l;
GtkWidget *paraspace_r;
GtkWidget *paraspace_t;