• R/O
  • SSH

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Haxe bindings for koreader


Commit MetaInfo

修訂2071b32bf97a480fa43b0ae07d6dcbefba252c50 (tree)
時間2021-03-28 23:41:54
作者Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fast...>
CommiterJaime Marquínez Ferrándiz

Log Message

Add UIManager:close

Change Summary

差異

diff -r f13f3582218a -r 2071b32bf97a demo/haxeplug/HaxePlugin.hx
--- a/demo/haxeplug/HaxePlugin.hx Sun Mar 28 16:33:31 2021 +0200
+++ b/demo/haxeplug/HaxePlugin.hx Sun Mar 28 16:41:54 2021 +0200
@@ -27,7 +27,7 @@
2727 });
2828 }
2929
30- private static function showFrameWithWidget(widget : Widget) : Void {
30+ private static function showFrameWithWidget(widget : Widget) : Widget {
3131 var container = CenterContainer.create({
3232 dimen: Device.screen.getSize(),
3333 widgets: [
@@ -42,9 +42,11 @@
4242 ],
4343 });
4444 UIManager.show(container);
45+ return container;
4546 }
4647
4748 public static function displayMainWindow() {
49+ var mainWindow : Widget = null;
4850 var grp = HorizontalGroup.create({
4951 widgets: [
5052 Button.create({
@@ -67,13 +69,19 @@
6769 Button.create({
6870 text: "Html window",
6971 callback: displayHtmlWindow,
72+ }),
73+ Button.create({
74+ text: "Close",
75+ callback: function close() {
76+ UIManager.close(mainWindow, Partial);
77+ }
7078 })
7179 ],
7280 }),
7381 ],
7482 });
7583
76- showFrameWithWidget(grp);
84+ mainWindow = showFrameWithWidget(grp);
7785 }
7886
7987 public static function displayHtmlBoxWidget() {
diff -r f13f3582218a -r 2071b32bf97a src/koreader/ui/UIManager.lua.hx
--- a/src/koreader/ui/UIManager.lua.hx Sun Mar 28 16:33:31 2021 +0200
+++ b/src/koreader/ui/UIManager.lua.hx Sun Mar 28 16:41:54 2021 +0200
@@ -12,4 +12,16 @@
1212
1313 @:koreaderAddStatic
1414 function show(widget: Widget) : Void;
15+
16+ @:koreaderAddStatic
17+ function close(widget : Widget, ?refreshtype : RefreshType, ?refreshregion : Geom, ?refreshdither : Bool) : Void;
18+}
19+
20+enum abstract RefreshType(String) {
21+ var Full = "full";
22+ var Flashpartial = "flashpartial";
23+ var Flashui = "flashui";
24+ var Partial = "partial";
25+ var UI = "ui";
26+ var Fast = "fast";
1527 }
\ No newline at end of file