2005-08-17 Tommi Komulainen <tommi.komulainen@nokia.com>
+ * hildon-widgets/hildon-calendar-popup.c (MAX_YEAR, MIN_YEAR):
+ * hildon-widgets/hildon-note.c (ELLIPSATION_STRING, BOX_SPAXING):
+ * hildon-widgets/hildon-volumebar-range.c (CHANGE_THRESHOLD):
+ Use defines rather than magic numbers in the code.
+
+2005-08-17 Tommi Komulainen <tommi.komulainen@nokia.com>
+
Update to new l10n packaging style. po-files (inside this package)
are not used for now, the message catalogs come from separate packages
and including them here would conflict.
#define HILDON_NOTE_CONFIRMATION_ICON "qgn_note_confirm"
#define HILDON_NOTE_INFORMATION_ICON "qgn_note_info"
+#define ELLIPSATION_STRING "\342\200\246"
+#define BOX_SPACING 10
+
/* Not exactly sure what this actually _should_ be, because there is
practically no documentation for the ESD... */
line = pango_layout_get_line(layout, 0);
templine = g_strndup(lines[last_line], line->length);
g_free(lines[last_line]);
- lines[last_line] = g_strconcat(templine, "\342\200\246", NULL);
+ lines[last_line] = g_strconcat(templine, ELLIPSATION_STRING, NULL);
g_free(templine);
}
gchar *tempresult;
PangoLayout *ellipsis = pango_layout_new(context);
- pango_layout_set_text(ellipsis, "\342\200\246", -1);
+ pango_layout_set_text(ellipsis, ELLIPSATION_STRING, -1);
pango_layout_get_size(ellipsis, &ellipsiswidth, NULL);
pango_layout_xy_to_index(layout,
max_width * PANGO_SCALE -
g_object_unref(G_OBJECT(ellipsis));
tempresult = g_strndup(lines[last_line], index);
lines[last_line] = g_strconcat(tempresult,
- "\342\200\246",
+ ELLIPSATION_STRING,
NULL);
g_free(tempresult);
}
line = pango_layout_get_line(layout, 0);
templine = g_strndup(str, line->length);
g_free(str);
- str = g_strconcat(templine, "\342\200\246", NULL);
+ str = g_strconcat(templine, ELLIPSATION_STRING, NULL);
g_free(templine);
}
gchar *tempresult;
PangoLayout *ellipsis = pango_layout_new(context);
- pango_layout_set_text(ellipsis, "\342\200\246", -1);
+ pango_layout_set_text(ellipsis, ELLIPSATION_STRING, -1);
pango_layout_get_size(ellipsis, &ellipsiswidth, NULL);
pango_layout_xy_to_index(layout,
max_width * PANGO_SCALE -
g_object_unref(G_OBJECT(ellipsis));
tempresult = g_strndup(str, index);
str = g_strconcat(tempresult,
- "\342\200\246",
+ ELLIPSATION_STRING,
NULL);
g_free(tempresult);
}
}
if (IsHorizontal) {
- priv->box = gtk_hbox_new(FALSE, 10);
+ priv->box = gtk_hbox_new(FALSE, BOX_SPACING);
gtk_container_add(GTK_CONTAINER(dialog->vbox), priv->box);
if (item) {
gtk_box_pack_start(GTK_BOX(priv->box), priv->label, FALSE, FALSE, 0);
} else {
- priv->box = gtk_vbox_new(FALSE, 10);
+ priv->box = gtk_vbox_new(FALSE, BOX_SPACING);
gtk_container_add(GTK_CONTAINER(dialog->vbox), priv->box);
gtk_box_pack_start(GTK_BOX(priv->box), priv->label, FALSE, FALSE, 0);
#define VOLUMEBAR_RANGE_PAGE_INCREMENT_VALUE 5.0
#define VOLUMEBAR_RANGE_PAGE_SIZE_VALUE 0.0
+#define CHANGE_THRESHOLD 0.001
+
static GtkScaleClass *parent_class;
static void hildon_volumebar_range_class_init(HildonVolumebarRangeClass *
/* Check that value is actually changed. Note that it's not safe to
* just compare if floats are equivalent or not */
- if (ABS(GTK_RANGE (self)->adjustment->value - newlevel) > 0.001) {
+ if (ABS(GTK_RANGE (self)->adjustment->value - newlevel) > CHANGE_THRESHOLD) {
/* This might be a bit faster because this skips
* gtkadjustment's own clamping and check if value has
* indeed changed. */