[chronojump] person select window show correctly long names



commit 2abb0337a6cce1c8a262c3e6772b5c1cf3017c6b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Nov 6 15:03:59 2020 +0100

    person select window show correctly long names

 glade/person_select_window.glade | 13 +++++++++++++
 src/gui/person/personSelect.cs   |  8 ++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/glade/person_select_window.glade b/glade/person_select_window.glade
index e2a7bfae..8e2ce444 100644
--- a/glade/person_select_window.glade
+++ b/glade/person_select_window.glade
@@ -2565,6 +2565,18 @@
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -3042,6 +3054,7 @@
                         </child>
                         <child>
                           <widget class="GtkLabel" id="label_selected_person_name">
+                            <property name="width_request">140</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="wrap">True</property>
diff --git a/src/gui/person/personSelect.cs b/src/gui/person/personSelect.cs
index d73eadfe..396cc316 100644
--- a/src/gui/person/personSelect.cs
+++ b/src/gui/person/personSelect.cs
@@ -502,6 +502,10 @@ public class PersonPhotoButton
                Gtk.Viewport viewport = new Gtk.Viewport();
                UtilGtk.ViewportColorDefault(viewport);
                Gtk.Label label_name = new Gtk.Label(personName);
+               label_name.LineWrap = true;
+               label_name.WidthRequest = 140; //same width as label_selected_person_name, to ensure contents 
are correctly shown on both
+               label_name.HeightRequest = -1;
+               label_name.LineWrapMode = Pango.WrapMode.Word;
                label_name.Visible = true;
                label_name.Show();
                viewport.Add(label_name);
@@ -514,8 +518,8 @@ public class PersonPhotoButton
                vbox.Show();
 
                button = new Button(vbox);
-               button.WidthRequest = 150;
-               button.HeightRequest = 170;
+               button.WidthRequest = 150; //commentin this will make columns longer with enough space for 
labels
+               button.HeightRequest = 170; //commenting this will make the rows be of different height 
depending on image and lines of text
        }
 
        private Array getButtonBoxElements (Gtk.Button button)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]