aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-04-28 16:39:56 +0200
committerThomas White <taw@bitwiz.me.uk>2019-04-28 16:39:56 +0200
commitdafee6d7bb9e1a172999b247647ad5d3392c37cc (patch)
tree94d213281b6d91216378b11a8b0bad3fb9597e31
parenta4b414405e398f6c033736a1e46a54f7f24c2c99 (diff)
Set padding and paraspace
-rw-r--r--src/stylesheet_editor.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/stylesheet_editor.c b/src/stylesheet_editor.c
index f8f1dab..dd59692 100644
--- a/src/stylesheet_editor.c
+++ b/src/stylesheet_editor.c
@@ -311,29 +311,41 @@ static void revert_sig(GtkButton *button, StylesheetEditor *se)
static void paraspace_sig(GtkSpinButton *widget, StylesheetEditor *se)
{
-#if 0
- update_spacing(se->priv->p, se->priv->furniture, "pad",
- se->furniture_padding_l,
- se->furniture_padding_r,
- se->furniture_padding_t,
- se->furniture_padding_b);
+ struct length paraspace[4];
+
+ paraspace[0].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->paraspace_l));
+ paraspace[0].unit = LENGTH_UNIT;
+ paraspace[1].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->paraspace_r));
+ paraspace[1].unit = LENGTH_UNIT;
+ paraspace[2].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->paraspace_t));
+ paraspace[2].unit = LENGTH_UNIT;
+ paraspace[3].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->paraspace_b));
+ paraspace[3].unit = LENGTH_UNIT;
+
+ stylesheet_set_paraspace(se->priv->stylesheet, se->priv->style_name, paraspace);
+
set_values_from_presentation(se);
g_signal_emit_by_name(se, "changed");
-#endif
}
static void padding_sig(GtkSpinButton *widget, StylesheetEditor *se)
{
-#if 0
- update_spacing(se->priv->p, se->priv->furniture, "pad",
- se->furniture_padding_l,
- se->furniture_padding_r,
- se->furniture_padding_t,
- se->furniture_padding_b);
+ struct length padding[4];
+
+ padding[0].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->padding_l));
+ padding[0].unit = LENGTH_UNIT;
+ padding[1].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->padding_r));
+ padding[1].unit = LENGTH_UNIT;
+ padding[2].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->padding_t));
+ padding[2].unit = LENGTH_UNIT;
+ padding[3].len = gtk_spin_button_get_value(GTK_SPIN_BUTTON(se->padding_b));
+ padding[3].unit = LENGTH_UNIT;
+
+ stylesheet_set_padding(se->priv->stylesheet, se->priv->style_name, padding);
+
set_values_from_presentation(se);
g_signal_emit_by_name(se, "changed");
-#endif
}