# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1617636248 0 # Node ID e08968d21d45cd8b0efdbea92ae63ce101eebb39 # Parent 89f4aba2e3874677426dbecdca9e7cf37449903b iOS: Additional code to calculate spinbutton size. Spinbuttons on iOS are unusually large, don't use a specific value in dwtest... let the system decide so the spinbutton isn't clipped on iOS. diff -r 89f4aba2e387 -r e08968d21d45 dwtest.c --- a/dwtest.c Mon Apr 05 14:36:23 2021 +0000 +++ b/dwtest.c Mon Apr 05 15:24:08 2021 +0000 @@ -1407,7 +1407,7 @@ dw_window_set_style(text, DW_DT_VCENTER, DW_DT_VCENTER); dw_box_pack_start(hbox, text, -1, -1, FALSE, TRUE, 1); fontsize = dw_spinbutton_new("9", 0); - dw_box_pack_start(hbox, fontsize, 50, -1, FALSE, FALSE, 1); + dw_box_pack_start(hbox, fontsize, -1, -1, FALSE, FALSE, 1); dw_spinbutton_set_limits(fontsize, 100, 5); dw_spinbutton_set_pos(fontsize, 9); fontname = dw_combobox_new("Default", 0); diff -r 89f4aba2e387 -r e08968d21d45 ios/dw.m --- a/ios/dw.m Mon Apr 05 14:36:23 2021 +0000 +++ b/ios/dw.m Mon Apr 05 15:24:08 2021 +0000 @@ -3264,9 +3264,9 @@ if([object isEditable]) { - /* Spinbuttons don't need to be as wide */ + /* Spinbutton text doesn't need to be as wide */ if([handle isMemberOfClass:[DWSpinButton class]]) - thiswidth = 100; + thiswidth = 50; else thiswidth = 150; } @@ -3274,6 +3274,19 @@ if(font) thisheight = (int)[font lineHeight]; + + /* Spinbuttons need some extra */ + if([handle isMemberOfClass:[DWSpinButton class]]) + { + DWSpinButton *spinbutton = handle; + CGSize size = [[spinbutton stepper] intrinsicContentSize]; + + /* Add the stepper width as extra... */ + extrawidth = size.width; + /* The height should be the bigger of the two */ + if(size.height > thisheight) + thisheight = size.height; + } } /* Handle the ranged widgets */ else if([object isMemberOfClass:[DWPercent class]] ||