From b00eae87dd356414bc5b9d123db05909f5a572fb Mon Sep 17 00:00:00 2001 From: shallowmallow Date: Sun, 4 May 2025 11:22:50 +0200 Subject: [PATCH] Make it compile with openfl html5 --- application.xml | 2 ++ src/Main.hx | 2 +- src/custom/IFrame.hx | 6 +++++- src/module.xml | 1 + src/views/CustomComponentView.hx | 6 +++++- src/views/MainView.hx | 2 ++ src/views/ViewManager.hx | 2 +- 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/application.xml b/application.xml index 1d7ec80..f72b51c 100644 --- a/application.xml +++ b/application.xml @@ -15,4 +15,6 @@ + + diff --git a/src/Main.hx b/src/Main.hx index dd2adb8..552052c 100644 --- a/src/Main.hx +++ b/src/Main.hx @@ -6,7 +6,7 @@ import custom.Preloader; class Main { public static function main() { - #if js + #if haxeui_html5 new haxe.ui.editors.code.monaco.MonacoLoader().register(null); #end //var dark = Browser.window.matchMedia('(prefers-color-scheme: dark)').matches; diff --git a/src/custom/IFrame.hx b/src/custom/IFrame.hx index 1a8c333..972ab7f 100644 --- a/src/custom/IFrame.hx +++ b/src/custom/IFrame.hx @@ -1,5 +1,7 @@ package custom; +#if haxeui_html5 + import haxe.ui.backend.html5.HtmlUtils; import haxe.ui.containers.Box; import js.Browser; @@ -46,4 +48,6 @@ class IFrame extends Box { return b; } -} \ No newline at end of file +} + +#end \ No newline at end of file diff --git a/src/module.xml b/src/module.xml index ff62433..6b92659 100644 --- a/src/module.xml +++ b/src/module.xml @@ -18,6 +18,7 @@ + diff --git a/src/views/CustomComponentView.hx b/src/views/CustomComponentView.hx index 354c001..a978621 100644 --- a/src/views/CustomComponentView.hx +++ b/src/views/CustomComponentView.hx @@ -8,6 +8,8 @@ class CustomComponentView extends View { } } +#if haxeui_html5 + @:xml('