Better gui scaling on android
This commit is contained in:
parent
98a7b5a03e
commit
26419e5ee0
@ -10,10 +10,13 @@
|
||||
<box id="filter_box" width="97%" height="75" layout="vertical-row" align="center">
|
||||
<div x="0" y="0" width="98%" height="100%" layout="horizontal-row" align="center">
|
||||
<textbox id="filter_name" proportion="7" align="center" />
|
||||
<spacer width="10" />
|
||||
<spacer width="20" />
|
||||
<label text="Updated" align="center" I18N="In addons screen, in the filtering bar, to enable a filter that will show only recently updated items"/>
|
||||
<spacer width="10" />
|
||||
<spinner id="filter_date" proportion="8" align="center" min_value="0" wrap_around="true"/>
|
||||
<spacer width="10" />
|
||||
<label text="Rating >=" align="center" I18N="In addons screen, in the filtering bar, to enable a filter that will show only items with good rating"/>
|
||||
<spacer width="10" />
|
||||
<spinner id="filter_rating" proportion="5" align="center" min_value="0" wrap_around="true"/>
|
||||
<icon-button id="filter_search" height="100%" icon="gui/search.png"/>
|
||||
</div>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<spacer width="20" height="13" />
|
||||
</box>
|
||||
|
||||
<tabs width="100%" height="25" id="trackgroups">
|
||||
<tabs width="100%" height="5%" id="trackgroups">
|
||||
<button id="standard" I18N="track group" text="Standard"/>
|
||||
<button id="addons" I18N="track group" text="Add-Ons"/>
|
||||
<button id="all" I18N="track group" text="All"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<spacer width="20" height="13" />
|
||||
</box>
|
||||
|
||||
<tabs width="100%" height="25" id="trackgroups">
|
||||
<tabs width="100%" height="5%" id="trackgroups">
|
||||
<button id="standard" I18N="track group" text="Standard"/>
|
||||
<button id="addons" I18N="track group" text="Add-Ons"/>
|
||||
<button id="all" I18N="track group" text="All"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
</box>
|
||||
|
||||
<!-- Populated dynamically at runtime -->
|
||||
<tabs width="100%" height="30" id="trackgroups"> </tabs>
|
||||
<tabs width="100%" height="5%" id="trackgroups"> </tabs>
|
||||
|
||||
<spacer height="50" />
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
</box>
|
||||
|
||||
<!-- Populated dynamically at runtime -->
|
||||
<tabs width="100%" height="30" id="gpgroups"> </tabs>
|
||||
<tabs width="100%" height="5%" id="gpgroups"> </tabs>
|
||||
|
||||
<spacer height="20" />
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
</box>
|
||||
|
||||
<!-- Groups will be added dynamically at runtime -->
|
||||
<tabs width="98%" x="1%" height="25" id="kartgroups">
|
||||
<tabs width="98%" x="1%" height="5%" id="kartgroups">
|
||||
</tabs>
|
||||
<spacer width="100%" height="2%"/>
|
||||
</div>
|
||||
|
@ -19,7 +19,7 @@
|
||||
</box>
|
||||
|
||||
<!-- Groups will be added dynamically at runtime -->
|
||||
<tabs width="98%" x="1%" height="25" id="kartgroups">
|
||||
<tabs width="98%" x="1%" height="5%" id="kartgroups">
|
||||
</tabs>
|
||||
<spacer width="100%" height="2%"/>
|
||||
</div>
|
||||
|
@ -26,7 +26,7 @@
|
||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
||||
<spacer width="40" height="100%" />
|
||||
<!-- FIXME: don't hardcode height -->
|
||||
<checkbox id="music_enabled" width="40" height="40"/>
|
||||
<checkbox id="music_enabled"/>
|
||||
</div>
|
||||
</div>
|
||||
<div width="75%" height="fit" layout="horizontal-row" >
|
||||
@ -47,7 +47,7 @@
|
||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
||||
<spacer width="40" height="100%" />
|
||||
<!-- FIXME: don't hardcode height -->
|
||||
<checkbox id="sfx_enabled" width="40" height="40"/>
|
||||
<checkbox id="sfx_enabled"/>
|
||||
</div>
|
||||
</div>
|
||||
<div width="75%" height="fit" layout="horizontal-row" >
|
||||
|
@ -8,13 +8,13 @@
|
||||
|
||||
<box proportion="1" width="100%" layout="vertical-row" padding="1">
|
||||
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
||||
label_location="bottom" align="center" max_rows="4"
|
||||
label_location="bottom" align="center" max_rows="3"
|
||||
child_width="160" child_height="120" />
|
||||
<spacer width="20" height="13" />
|
||||
</box>
|
||||
|
||||
<!-- Populated dynamically at runtime -->
|
||||
<tabs width="100%" height="25" id="trackgroups"> </tabs>
|
||||
<tabs width="100%" height="5%" id="trackgroups"> </tabs>
|
||||
|
||||
<spacer width="100%" height="2%" />
|
||||
</div>
|
||||
|
@ -17,13 +17,13 @@
|
||||
|
||||
<box proportion="1" width="100%" layout="vertical-row" padding="1">
|
||||
<ribbon_grid id="tracks" proportion="1" width="100%" square_items="true"
|
||||
label_location="bottom" align="center" max_rows="4"
|
||||
label_location="bottom" align="center" max_rows="3"
|
||||
child_width="160" child_height="120" />
|
||||
<spacer width="20" height="13" />
|
||||
</box>
|
||||
|
||||
<!-- Populated dynamically at runtime -->
|
||||
<tabs width="100%" height="25" id="trackgroups"> </tabs>
|
||||
<tabs width="100%" height="5%" id="trackgroups"> </tabs>
|
||||
|
||||
<spacer width="100%" height="2%" />
|
||||
</div>
|
||||
|
@ -68,7 +68,7 @@
|
||||
I18N="In the user screen" text="Cancel" label_location="bottom"/>
|
||||
</buttonbar>
|
||||
</div>
|
||||
<spacer width="20" height="25"/>
|
||||
<spacer width="20" height="40"/>
|
||||
</box>
|
||||
<spacer width="20" height="15"/>
|
||||
</div>
|
||||
|
@ -330,6 +330,12 @@ void FontWithFace::setDPI()
|
||||
{
|
||||
const int screen_width = irr_driver->getFrameSize().Width;
|
||||
const int screen_height = irr_driver->getFrameSize().Height;
|
||||
|
||||
#ifdef ANDROID
|
||||
float scale = screen_height / 480.0f;
|
||||
m_face_dpi = getScalingFactorTwo() * getScalingFactorOne() * scale;
|
||||
|
||||
#else
|
||||
float scale = std::max(0, screen_width - 640) / 564.0f;
|
||||
|
||||
// attempt to compensate for small screens
|
||||
@ -340,6 +346,7 @@ void FontWithFace::setDPI()
|
||||
|
||||
m_face_dpi = unsigned((getScalingFactorOne() + 0.2f * scale) *
|
||||
getScalingFactorTwo());
|
||||
#endif
|
||||
|
||||
} // setDPI
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user