* hildon-widgets/hildon-font-selection-dialog.c: Adding a
"font-scaling" property that allows to customize the output of the
Preview dialog during font selection. By default font-scaling equals
1.0 = no change. Applications/clients should apply here the
font-scaling they use for user-output/visualization. Fixes #NB19001.
+2006-09-05 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ * hildon-widgets/hildon-font-selection-dialog.c: Adding a
+ "font-scaling" property that allows to customize the output of the
+ Preview dialog during font selection. By default font-scaling equals
+ 1.0 = no change. Applications/clients should apply here the
+ font-scaling they use for user-output/visualization. Fixes #NB19001.
+
2006-09-05 Tomas Junnonen <tomas.junnonen@nokia.com>
* src/hildon-widgets/hildon-find-toolbar.c: Start search on "activate"
2006-09-05 Tomas Junnonen <tomas.junnonen@nokia.com>
* src/hildon-widgets/hildon-find-toolbar.c: Start search on "activate"
PROP_STRIKETHROUGH_SET,
PROP_POSITION,
PROP_POSITION_SET,
PROP_STRIKETHROUGH_SET,
PROP_POSITION,
PROP_POSITION_SET,
+ PROP_PREVIEW_TEXT,
+ PROP_FONT_SCALING
* when we change the color setting*/
gboolean color_set;
* 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;
};
gulong color_modified_signal_handler;
};
else
g_value_set_int(value, 0);
break;
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)
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;
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);
case PROP_POSITION_SET:
b = g_value_get_boolean(value);
"Font position super or subscript",
-1, 1, 0,
G_PARAM_READWRITE));
"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",
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;
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);
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;
strikethrough, strikethrough_set, position_set;
GdkColor *color = NULL;
gchar *family = NULL;
+ gdouble font_scaling = 1.0;
list = pango_attr_list_new();
list = pango_attr_list_new();
"underline", &underline, "underline-set", &underline_set,
"strikethrough", &strikethrough, "strikethrough-set",
&strikethrough_set, "position", &position,
"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)
/*family*/
if(family_set)
add_preview_text_attr(list, attr, start_index, len);
}
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);
+ }
+