]> www.fi.muni.cz Git - evince.git/commitdiff
Labels don't expand when the dialogue is resized
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 4 Jun 2005 13:05:31 +0000 (13:05 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 4 Jun 2005 13:05:31 +0000 (13:05 +0000)
strftime result needs to be converted to UTF-8. Thanks to chpe.

ChangeLog
data/evince-properties.glade
shell/ev-properties.c

index c7561ce2d88b4ed8663737bfaf9f8efa4ebeded1..665f6829d75916f49e6b9cd324cdce0dc39011a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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:
index c856b0ea92e9f61041932cece1b9bb15839930a4..d900f37ae700f059938cabc5ccf3f5715a81495e 100644 (file)
              </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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
                  <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>
                <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>
              <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>
index 4d904653052488dc9fabf76969474e2a4a303d95..78c2f1474aa07ffc219a6d01da4306cf1f52ddbd 100644 (file)
@@ -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 *