@@ -284,12 +284,13 @@ void GUIFormSpecMenu::parseSize(parserData* data, const std::string &element)
284
284
data->invsize .Y = MYMAX (0 , stof (parts[1 ]));
285
285
286
286
lockSize (false );
287
+ #ifndef __ANDROID__
287
288
if (parts.size () == 3 ) {
288
289
if (parts[2 ] == " true" ) {
289
290
lockSize (true ,v2u32 (800 ,600 ));
290
291
}
291
292
}
292
-
293
+ # endif
293
294
data->explicit_size = true ;
294
295
return ;
295
296
}
@@ -437,11 +438,12 @@ void GUIFormSpecMenu::parseCheckbox(parserData* data, const std::string &element
437
438
fselected = true ;
438
439
439
440
std::wstring wlabel = translate_string (utf8_to_wide (unescape_string (label)));
441
+ s32 spacing = Environment->getSkin ()->getSize (gui::EGDS_CHECK_BOX_WIDTH) + 7 ;
440
442
441
443
core::rect<s32> rect = core::rect<s32>(
442
- pos.X , pos.Y + ((imgsize.Y / 2 ) - m_btn_height),
443
- pos.X + m_font->getDimension (wlabel.c_str ()).Width + 25 , // text size + size of checkbox
444
- pos.Y + ((imgsize.Y / 2 ) + m_btn_height));
444
+ pos.X , pos.Y + ((imgsize.Y / 2 ) - m_btn_height),
445
+ pos.X + m_font->getDimension (wlabel.c_str ()).Width + spacing,
446
+ pos.Y + ((imgsize.Y / 2 ) + m_btn_height));
445
447
446
448
FieldSpec spec (
447
449
name,
@@ -2145,16 +2147,28 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
2145
2147
// the image size can't be less than 0.3 inch
2146
2148
// multiplied by gui_scaling, even if this means
2147
2149
// the form doesn't fit the screen.
2148
- double prefer_imgsize = mydata.screensize .Y / 15 *
2149
- gui_scaling;
2150
+ #ifdef __ANDROID__
2151
+ // For mobile devices these magic numbers are
2152
+ // different and forms should always use the
2153
+ // maximum screen space available.
2154
+ double prefer_imgsize = mydata.screensize .Y / 10 * gui_scaling;
2150
2155
double fitx_imgsize = mydata.screensize .X /
2151
- ((5.0 / 4 .0 ) * (0.5 + mydata.invsize .X ));
2156
+ ((12.0 / 8 .0 ) * (0.5 + mydata.invsize .X ));
2152
2157
double fity_imgsize = mydata.screensize .Y /
2153
- ((15.0 /13.0 ) * (0.85 * mydata.invsize .Y ));
2158
+ ((15.0 / 11.0 ) * (0.85 + mydata.invsize .Y ));
2159
+ use_imgsize = MYMIN (prefer_imgsize,
2160
+ MYMIN (fitx_imgsize, fity_imgsize));
2161
+ #else
2162
+ double prefer_imgsize = mydata.screensize .Y / 15 * gui_scaling;
2163
+ double fitx_imgsize = mydata.screensize .X /
2164
+ ((5.0 / 4.0 ) * (0.5 + mydata.invsize .X ));
2165
+ double fity_imgsize = mydata.screensize .Y /
2166
+ ((15.0 / 13.0 ) * (0.85 * mydata.invsize .Y ));
2154
2167
double screen_dpi = RenderingEngine::getDisplayDensity () * 96 ;
2155
2168
double min_imgsize = 0.3 * screen_dpi * gui_scaling;
2156
2169
use_imgsize = MYMAX (min_imgsize, MYMIN (prefer_imgsize,
2157
2170
MYMIN (fitx_imgsize, fity_imgsize)));
2171
+ #endif
2158
2172
}
2159
2173
2160
2174
// Everything else is scaled in proportion to the
0 commit comments