Adapt interface to display notch of mac laptops (#8666)
* Adapt interface to display notch of mac laptops * `macNotchHeight` as a separate variable, and description for mac notch setting
This commit is contained in:
@@ -113,6 +113,8 @@ public class Vars implements Loadable{
|
||||
public static final float tilePayload = tilesize * tilesize;
|
||||
/** icon sizes for UI */
|
||||
public static final float iconXLarge = 8*6f, iconLarge = 8*5f, iconMed = 8*4f, iconSmall = 8*3f;
|
||||
/** macbook screen notch height */
|
||||
public static float macNotchHeight = 32f;
|
||||
/** for map generator dialog */
|
||||
public static boolean updateEditorOnChange = false;
|
||||
/** all choosable player colors in join/host dialog */
|
||||
|
||||
@@ -490,6 +490,10 @@ public class SettingsMenuDialog extends BaseDialog{
|
||||
graphics.checkPref("skipcoreanimation", false);
|
||||
graphics.checkPref("hidedisplays", false);
|
||||
|
||||
if(OS.isMac){
|
||||
graphics.checkPref("macnotch", false);
|
||||
}
|
||||
|
||||
if(!mobile){
|
||||
Core.settings.put("swapdiagonal", false);
|
||||
}
|
||||
|
||||
@@ -293,6 +293,11 @@ public class HudFragment{
|
||||
//core info
|
||||
parent.fill(t -> {
|
||||
t.top();
|
||||
|
||||
if(Core.settings.getBool("macnotch") ){
|
||||
t.margin(macNotchHeight);
|
||||
}
|
||||
|
||||
t.visible(() -> shown);
|
||||
|
||||
t.name = "coreinfo";
|
||||
|
||||
@@ -100,6 +100,9 @@ public class MenuFragment{
|
||||
|
||||
float fx = (int)(width / 2f);
|
||||
float fy = (int)(height - 6 - logoh) + logoh / 2 - (Core.graphics.isPortrait() ? Scl.scl(30f) : 0f);
|
||||
if(Core.settings.getBool("macnotch") ){
|
||||
fy -= Scl.scl(macNotchHeight);
|
||||
}
|
||||
|
||||
Draw.color();
|
||||
Draw.rect(logo, fx, fy, logow, logoh);
|
||||
@@ -277,7 +280,7 @@ public class MenuFragment{
|
||||
addButton(text, Styles.none, callback);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Adds a custom button to the menu.
|
||||
* If {@link MenuButton#submenu} is null or the player is on mobile, {@link MenuButton#runnable} is invoked on click.
|
||||
* Otherwise, {@link MenuButton#submenu} is shown.
|
||||
|
||||
Reference in New Issue
Block a user