changeset 381:bcb1fac5776e

Spinbuttons on iOS are unusually wide compared to other platforms. So don't put the size width/height and position X/Y on the same line. Also autosize the spinbuttons so they aren't unnecessarilly wide.
author Brian Smith <brian@dbsoft.org>
date Tue, 26 Jul 2022 17:54:43 -0500
parents cb9a86122792
children adc711920a78
files dwib.c
diffstat 1 files changed, 33 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/dwib.c	Tue Jul 26 17:23:56 2022 -0500
+++ b/dwib.c	Tue Jul 26 17:54:43 2022 -0500
@@ -1541,7 +1541,7 @@
         /* Required size */
         hbox = dw_box_new(DW_HORZ, 0);
         dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
-        item = dw_text_new("Size", 0);
+        item = dw_text_new("Size - Width", 0);
         dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
         dw_window_set_style(item, DW_DT_VCENTER, DW_DT_VCENTER);
         val = defvalint;
@@ -1554,10 +1554,14 @@
             }
         }
         item = dw_spinbutton_new(val, 0);
-        dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+        dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
         dw_spinbutton_set_limits(item, 2000, -1);
         dw_window_set_tooltip(item, "Width: Set to -1 to calculate the size.");
         dw_window_set_data(vbox, "width", DW_POINTER(item));
+        hbox = dw_box_new(DW_HORZ, 0);
+        dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
+        item = dw_text_new("x Height", 0);
+        dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
         val = defvalint;
         if((this = _dwib_find_child(node, "height")))
         {
@@ -1568,7 +1572,7 @@
             }
         }
         item = dw_spinbutton_new(val, 0);
-        dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+        dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
         dw_spinbutton_set_limits(item, 2000, -1);
         dw_window_set_tooltip(item, "Height: Set to -1 to calculate the size.");
         dw_window_set_data(vbox, "height", DW_POINTER(item));
@@ -4494,7 +4498,7 @@
     /* Required size */
     hbox = dw_box_new(DW_HORZ, 0);
     dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
-    item = dw_text_new("Size", 0);
+    item = dw_text_new("Size - Width", 0);
     dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_window_set_style(item, DW_DT_VCENTER, DW_DT_VCENTER);
     val = defvaltrue;
@@ -4507,10 +4511,15 @@
         }
     }
     item = dw_spinbutton_new(val, 0);
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_spinbutton_set_limits(item, 2000, 0);
     dw_window_set_tooltip(item, "Padding width in pixels.");
     dw_window_set_data(vbox, "width", DW_POINTER(item));
+    hbox = dw_box_new(DW_HORZ, 0);
+    dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
+    item = dw_text_new("x Height", 0);
+    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
+    dw_window_set_style(item, DW_DT_VCENTER, DW_DT_VCENTER);
     val = defvaltrue;
     if((this = _dwib_find_child(node, "height")))
     {
@@ -4521,7 +4530,7 @@
         }
     }
     item = dw_spinbutton_new(val, 0);
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_spinbutton_set_limits(item, 2000, 0);
     dw_window_set_tooltip(item, "Padding height in pixels.");
     dw_window_set_data(vbox, "height", DW_POINTER(item));
@@ -4709,7 +4718,7 @@
     item = dw_spinbutton_new(val, 0);
     dw_spinbutton_set_limits(item, 29999, 0);
     dw_spinbutton_set_pos(item, atoi(val));
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_window_set_tooltip(item, "Menu identifier or 0 to auto-generate one.");
     dw_window_set_data(vbox, "menuid", DW_POINTER(item));
     /* Style */
@@ -4864,7 +4873,7 @@
     /* Size */ 
     hbox = dw_box_new(DW_HORZ, 0);
     dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
-    item = dw_text_new("Size", 0);
+    item = dw_text_new("Size - Width", 0);
     dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_window_set_style(item, DW_DT_VCENTER, DW_DT_VCENTER);
     val = "100";
@@ -4877,10 +4886,15 @@
         }
     }
     item = dw_spinbutton_new(val, 0);
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_spinbutton_set_limits(item, 2000, -1);
     dw_window_set_tooltip(item, "Width: Set to 0 to let the system decide.");
     dw_window_set_data(vbox, "width", DW_POINTER(item));
+    hbox = dw_box_new(DW_HORZ, 0);
+    dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
+    item = dw_text_new("x Height", 0);
+    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
+    dw_window_set_style(item, DW_DT_VCENTER, DW_DT_VCENTER);
     val = "100";
     if((this = _dwib_find_child(node, "height")))
     {
@@ -4891,14 +4905,14 @@
         }
     }
     item = dw_spinbutton_new(val, 0);
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_spinbutton_set_limits(item, 2000, -1);
     dw_window_set_tooltip(item, "Height: Set to 0 to let the system decide.");
     dw_window_set_data(vbox, "height", DW_POINTER(item));
     /* Positon */
     hbox = dw_box_new(DW_HORZ, 0);
     dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
-    item = dw_text_new("Position", 0);
+    item = dw_text_new("Position - X", 0);
     dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_window_set_style(item, DW_DT_VCENTER, DW_DT_VCENTER);
     val = defvalint;
@@ -4911,10 +4925,15 @@
         }
     }
     item = dw_spinbutton_new(val, 0);
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_spinbutton_set_limits(item, 2000, -1000);
     dw_window_set_tooltip(item, "X: Set to -1 to let the system decide when gravity is not CENTER.");
     dw_window_set_data(vbox, "x", DW_POINTER(item));
+    hbox = dw_box_new(DW_HORZ, 0);
+    dw_box_pack_start(scrollbox, hbox, 0, 0, TRUE, FALSE, 0);
+    item = dw_text_new("x Y", 0);
+    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
+    dw_window_set_style(item, DW_DT_VCENTER, DW_DT_VCENTER);
     val = defvalint;
     if((this = _dwib_find_child(node, "y")))
     {
@@ -4925,7 +4944,7 @@
         }
     }
     item = dw_spinbutton_new(val, 0);
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_spinbutton_set_limits(item, 2000, -1000);
     dw_window_set_tooltip(item, "Y: Set to -1 to let the system decide when gravity is not CENTER.");
     dw_window_set_data(vbox, "y", DW_POINTER(item));
@@ -5032,7 +5051,7 @@
         }
     }
     item = dw_spinbutton_new(val, 0);
-    dw_box_pack_start(hbox, item, PROPERTIES_WIDTH/2, PROPERTIES_HEIGHT, TRUE, TRUE, 0);
+    dw_box_pack_start(hbox, item, DW_SIZE_AUTO, PROPERTIES_HEIGHT, FALSE, TRUE, 0);
     dw_spinbutton_set_limits(item, 10, -1);
     dw_window_set_tooltip(item, "Override the default border size if possible, -1 for system default.");
     dw_window_set_data(vbox, "bordersize", DW_POINTER(item));