Add arm_touchui define
This commit is contained in:
@@ -20,7 +20,7 @@ class Config {
|
||||
public static var raw: TConfig = null;
|
||||
public static var keymap: TKeymap;
|
||||
public static var configLoaded = false;
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
public static inline var buttonAlign = zui.Zui.Align.Center;
|
||||
public static inline var buttonSpacing = "";
|
||||
#else
|
||||
@@ -301,7 +301,7 @@ class Config {
|
||||
UIView2D.inst.ui.t = App.theme;
|
||||
UISidebar.inst.tagUIRedraw();
|
||||
}
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
App.theme.FULL_TABS = true;
|
||||
#end
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ class UIMenu {
|
||||
|
||||
static function menuSeparator(ui: Zui) {
|
||||
ui._y++;
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
ui.fill(0, 0, ui._w / ui.SCALE(), 1, ui.t.ACCENT_SELECT_COL);
|
||||
#else
|
||||
ui.fill(22, 0, ui._w / ui.SCALE() - 22, 1, ui.t.ACCENT_SELECT_COL);
|
||||
@@ -470,14 +470,14 @@ class UIMenu {
|
||||
|
||||
static function menuButton(ui: Zui, text: String, label = ""): Bool {
|
||||
menuFill(ui);
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
label = "";
|
||||
#end
|
||||
return ui.button(Config.buttonSpacing + text, Config.buttonAlign, label);
|
||||
}
|
||||
|
||||
static function menuAlign(ui: Zui) {
|
||||
#if !(krom_android || krom_ios)
|
||||
#if !arm_touchui
|
||||
ui.row([1 / 8, 7 / 8]);
|
||||
ui.endElement();
|
||||
#end
|
||||
|
||||
@@ -31,7 +31,7 @@ class UIMenubar {
|
||||
|
||||
Ext.beginMenu(ui);
|
||||
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
ui._w = Std.int(UIToolbar.defaultToolbarW * ui.SCALE());
|
||||
if (iconButton(ui, 0)) BoxPreferences.show();
|
||||
if (iconButton(ui, 1)) Project.projectNewBox();
|
||||
@@ -110,14 +110,14 @@ class UIMenubar {
|
||||
UIMenu.menuCategory = category;
|
||||
UIMenu.menuX = Std.int(ui._x - ui._w);
|
||||
UIMenu.menuY = Std.int(Ext.MENUBAR_H(ui));
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
var menuW = Std.int(App.defaultElementW * App.uiMenu.SCALE() * 2.0);
|
||||
UIMenu.menuX -= Std.int((menuW - ui._w) / 2);
|
||||
UIMenu.menuY += 4;
|
||||
#end
|
||||
}
|
||||
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
function iconButton(ui: Zui, i: Int): Bool {
|
||||
var col = ui.t.WINDOW_BG_COL;
|
||||
if (col < 0) col += untyped 4294967296;
|
||||
|
||||
@@ -953,7 +953,7 @@ class UINodes {
|
||||
}
|
||||
|
||||
static function menuButton(ui: Zui, text: String, label = ""): Bool {
|
||||
#if (krom_android || krom_ios)
|
||||
#if arm_touchui
|
||||
label = "";
|
||||
#end
|
||||
return ui.button(Config.buttonSpacing + text, Config.buttonAlign, label);
|
||||
|
||||
@@ -69,6 +69,11 @@ else if (process.platform === "darwin") {
|
||||
project.addDefine("kha_darwin");
|
||||
}
|
||||
|
||||
if (android || ios) {
|
||||
project.addDefine("arm_touchui"); // Use touch friendly UI
|
||||
project.addDefine("zui_touchui");
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
project.addDefine("arm_debug");
|
||||
project.addParameter("--times");
|
||||
|
||||
Reference in New Issue
Block a user