diff options
author | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2005-06-04 13:05:31 (GMT) |
---|---|---|
committer | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2005-06-04 13:05:31 (GMT) |
commit | 3a5debb394dd45d4b802ab83e1249d9749fc4d84 (patch) | |
tree | 8d3a1589d48323abab6aa8fd9eb8d77e47c5861a | |
parent | 0e3d97f97936012684b84e085fa5b1ed33cb9da5 (diff) |
Labels don't expand when the dialogue is resized
strftime result needs to be converted to UTF-8. Thanks to chpe.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | data/evince-properties.glade | 129 | ||||
-rw-r--r-- | shell/ev-properties.c | 26 |
3 files changed, 73 insertions, 92 deletions
@@ -1,3 +1,13 @@ +2005-06-04 Nickolay V. Shmyrev <nshmyrev@yandex.ru> + + * data/evince-properties.glade: + * shell/ev-properties.c: (ev_properties_format_date), + (set_property): + + Labels don't expand when the dialogue is resized. + strftime result needs to be converted to UTF-8. Thanks + to Christian Persch <chpe@gnome.org>. + 2005-06-04 Marco Pesenti Gritti <mpg@redhat.com> * data/evince-properties.glade: diff --git a/data/evince-properties.glade b/data/evince-properties.glade index c856b0e..d900f37 100644 --- a/data/evince-properties.glade +++ b/data/evince-properties.glade @@ -410,7 +410,7 @@ </child> <child> - <widget class="GtkLabel" id="title"> + <widget class="GtkLabel" id="created"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -423,7 +423,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -431,15 +431,15 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="subject"> + <widget class="GtkLabel" id="modified"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -452,7 +452,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -460,15 +460,15 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="author"> + <widget class="GtkLabel" id="security"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -481,7 +481,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -489,15 +489,15 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="keywords"> + <widget class="GtkLabel" id="version"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -510,7 +510,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -518,15 +518,15 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">9</property> + <property name="bottom_attach">10</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="creator"> + <widget class="GtkLabel" id="pages"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -539,7 +539,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -547,15 +547,15 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> + <property name="top_attach">10</property> + <property name="bottom_attach">11</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="producer"> + <widget class="GtkLabel" id="optimized"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -568,7 +568,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -576,15 +576,15 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">11</property> + <property name="bottom_attach">12</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="created"> + <widget class="GtkLabel" id="producer"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -597,7 +597,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -605,15 +605,14 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">6</property> - <property name="bottom_attach">7</property> - <property name="x_options">fill</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="modified"> + <widget class="GtkLabel" id="creator"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -626,7 +625,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -634,15 +633,14 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">7</property> - <property name="bottom_attach">8</property> - <property name="x_options">fill</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="security"> + <widget class="GtkLabel" id="keywords"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -655,7 +653,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -663,15 +661,14 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">8</property> - <property name="bottom_attach">9</property> - <property name="x_options">fill</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="version"> + <widget class="GtkLabel" id="author"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -684,7 +681,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -692,15 +689,14 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">9</property> - <property name="bottom_attach">10</property> - <property name="x_options">fill</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="pages"> + <widget class="GtkLabel" id="subject"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -713,7 +709,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -721,15 +717,14 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">10</property> - <property name="bottom_attach">11</property> - <property name="x_options">fill</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="y_options"></property> </packing> </child> <child> - <widget class="GtkLabel" id="optimized"> + <widget class="GtkLabel" id="title"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="label" translatable="yes"></property> @@ -742,7 +737,7 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> <property name="angle">0</property> @@ -750,9 +745,8 @@ <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">11</property> - <property name="bottom_attach">12</property> - <property name="x_options">fill</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> <property name="y_options"></property> </packing> </child> @@ -785,33 +779,6 @@ <property name="type">tab</property> </packing> </child> - - <child> - <placeholder/> - </child> - - <child> - <widget class="GtkLabel" id="font_properties_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">Font Properties</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> </widget> <packing> <property name="padding">0</property> diff --git a/shell/ev-properties.c b/shell/ev-properties.c index 4d90465..78c2f14 100644 --- a/shell/ev-properties.c +++ b/shell/ev-properties.c @@ -68,18 +68,21 @@ static const PropertyInfo properties_info[] = { }; /* Returns a locale specific date and time representation */ -static gchar * +static char * ev_properties_format_date (GTime utime) { - struct tm *time; - gchar *date_string; - - date_string = g_new0 (char, 101); - - time = localtime ((const time_t *) &utime); - strftime (date_string, 100, "%c", time); - - return date_string; + time_t time = (time_t) utime; + struct tm t; + char s[256]; + const char *fmt_hack = "%c"; + size_t len; + + if (!localtime_r (&time, &t)) return NULL; + + len = strftime (s, sizeof (s), fmt_hack, &t); + if (len == 0 || s[0] == '\0') return NULL; + + return g_locale_to_utf8 (s, -1, NULL, NULL, NULL); } static void @@ -89,7 +92,8 @@ set_property (GladeXML *xml, Property property, const char *text) widget = glade_xml_get_widget (xml, properties_info[property].label_id); g_return_if_fail (GTK_IS_LABEL (widget)); - gtk_label_set_text (GTK_LABEL (widget), text); + + gtk_label_set_text (GTK_LABEL (widget), text ? text : ""); } GtkDialog * |