[chronojump] PersonSelectWindow shows 2 rows on LowHeight devices
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] PersonSelectWindow shows 2 rows on LowHeight devices
- Date: Thu, 4 Mar 2021 15:39:20 +0000 (UTC)
commit 59bef4288494c0aa4d769cf1f932759c0ec71d53
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Mar 4 16:38:44 2021 +0100
PersonSelectWindow shows 2 rows on LowHeight devices
src/gui/app1/chronojumpPersons.cs | 2 +-
src/gui/person/personSelect.cs | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/app1/chronojumpPersons.cs b/src/gui/app1/chronojumpPersons.cs
index 0e56281a..ac9ea08d 100644
--- a/src/gui/app1/chronojumpPersons.cs
+++ b/src/gui/app1/chronojumpPersons.cs
@@ -410,7 +410,7 @@ public partial class ChronoJumpWindow
currentSession.UniqueID,
false); //means: do not returnPersonAndPSlist
- personSelectWin = PersonSelectWindow.Show(app1, myPersons, currentPerson,
preferences.colorBackground, configChronojump.Raspberry);
+ personSelectWin = PersonSelectWindow.Show(app1, myPersons, currentPerson,
preferences.colorBackground, configChronojump.Raspberry, configChronojump.LowHeight);
personSelectWin.FakeButtonAddPerson.Clicked += new
EventHandler(on_button_top_person_add_person);
personSelectWin.FakeButtonAddPersonMultiple.Clicked += new
EventHandler(on_button_top_person_add_person_multiple);
personSelectWin.FakeButtonLoadPerson.Clicked += new
EventHandler(on_button_top_person_load_person);
diff --git a/src/gui/person/personSelect.cs b/src/gui/person/personSelect.cs
index 868fcbae..13271588 100644
--- a/src/gui/person/personSelect.cs
+++ b/src/gui/person/personSelect.cs
@@ -70,7 +70,7 @@ public class PersonSelectWindow
private List<PersonPhotoButton> list_ppb;
- PersonSelectWindow (Gtk.Window parent, bool raspberry)
+ PersonSelectWindow (Gtk.Window parent, bool raspberry, bool lowHeight)
{
Glade.XML gladeXML;
gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "person_select_window.glade",
"person_select_window", "chronojump");
@@ -82,8 +82,12 @@ public class PersonSelectWindow
scrolled1.WidthRequest = 150 * 4 + 8 * 2 + 12 * 2 + slidebarSize; //150 is button width, 8 is
padding left and right (4+4), 12 the left and right of scrolled1
+ int rowsShown = 3;
+ if(lowHeight)
+ rowsShown = 2;
+
//there's no side slidebar for going horizontal, but the last +10 is to have a bit of space
for the widget
- scrolled1.HeightRequest = 170 * 3 + 8 * 2 + 12 * 2; //170 is button height, 8 is padding top
botton (4+4), 12 the top and bottom of scrolled1
+ scrolled1.HeightRequest = 170 * rowsShown + 8 * 2 + 12 * 2; //170 is button height, 8 is
padding top botton (4+4), 12 the top and bottom of scrolled1
//put an icon to window
UtilGtk.IconWindow(person_select_window);
@@ -129,10 +133,10 @@ public class PersonSelectWindow
image_close.Pixbuf = pixbuf;
}
- static public PersonSelectWindow Show (Gtk.Window parent, ArrayList persons, Person currentPerson,
Gdk.Color colorBackground, bool raspberry)
+ static public PersonSelectWindow Show (Gtk.Window parent, ArrayList persons, Person currentPerson,
Gdk.Color colorBackground, bool raspberry, bool lowHeight)
{
if (PersonSelectWindowBox == null) {
- PersonSelectWindowBox = new PersonSelectWindow (parent, raspberry);
+ PersonSelectWindowBox = new PersonSelectWindow (parent, raspberry, lowHeight);
}
PersonSelectWindowBox.persons = persons;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]