PROP_STRIKETHROUGH_SET,
PROP_POSITION,
PROP_POSITION_SET,
- PROP_PREVIEW_TEXT
+ PROP_PREVIEW_TEXT,
+ PROP_FONT_SCALING
};
typedef struct
* when we change the color setting*/
gboolean color_set;
+
+ /* font_scaling is the scaling factor applied to font
+ * scale in the preview dialog */
+
+ gdouble font_scaling;
gulong color_modified_signal_handler;
};
else
g_value_set_int(value, 0);
break;
-
+
+ case PROP_FONT_SCALING:
+ g_value_set_double(value, priv->font_scaling);
+ break;
+
case PROP_POSITION_SET:
i = gtk_combo_box_get_active(GTK_COMBO_BOX(priv->cbx_positioning));
if(i >= 0 && i < 3)
else
gtk_combo_box_set_active(GTK_COMBO_BOX(priv->cbx_positioning), 0);
break;
+
+ case PROP_FONT_SCALING:
+ priv->font_scaling = g_value_get_double(value);
+ break;
case PROP_POSITION_SET:
b = g_value_get_boolean(value);
"Font position super or subscript",
-1, 1, 0,
G_PARAM_READWRITE));
+
+ g_object_class_install_property(gobject_class, PROP_FONT_SCALING,
+ g_param_spec_double ("font-scaling",
+ "Font scaling",
+ "Font scaling for the preview dialog",
+ 0, 10, 1,
+ G_PARAM_READWRITE));
g_object_class_install_property(gobject_class, PROP_POSITION_SET,
g_param_spec_boolean ("position-set",
font_color_box = gtk_hbox_new(FALSE, 0);
priv->font_color_button = hildon_color_button_new();
priv->color_set = FALSE;
+ priv->font_scaling = 1.0;
priv->color_modified_signal_handler =
g_signal_connect(G_OBJECT(priv->font_color_button), "notify::color",
G_CALLBACK(color_modified_cb), (gpointer) priv);
strikethrough, strikethrough_set, position_set;
GdkColor *color = NULL;
gchar *family = NULL;
+ gdouble font_scaling = 1.0;
list = pango_attr_list_new();
"underline", &underline, "underline-set", &underline_set,
"strikethrough", &strikethrough, "strikethrough-set",
&strikethrough_set, "position", &position,
- "position-set", &position_set, NULL);
+ "position-set", &position_set,
+ "font-scaling", &font_scaling,
+ NULL);
/*family*/
if(family_set)
add_preview_text_attr(list, attr, start_index, len);
}
-
+
+ /*font scaling for preview*/
+ if(font_scaling)
+ {
+ attr = pango_attr_scale_new(font_scaling);
+ add_preview_text_attr(list, attr, 0, len + start_index);
+ }
+
return list;
}