Skip to content

Commit 28f9677

Browse files
updated selection logic in WhatsNewDialog and UpdateNotificationDialog
1 parent d27f613 commit 28f9677

4 files changed

Lines changed: 24 additions & 1 deletion

File tree

components/UpdateNotificationDialog.bs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,9 @@ function onKeyEvent(key as string, press as boolean) as boolean
7070
return true
7171
end if
7272

73+
if key = "left" or key = "right" or key = "up" or key = "down"
74+
return true
75+
end if
76+
7377
return false
7478
end function

components/WhatsNewDialog.bs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sub init()
1010
m.top.height = 900
1111
m.top.title = `What's New In ${m.global.app.name}`
1212
m.top.buttons = [tr("OK")]
13+
m.top.observeField("buttonSelected", "onButtonActivated")
1314

1415
dialogStyles = {
1516
"default": {
@@ -38,6 +39,21 @@ sub init()
3839
end for
3940
end sub
4041

42+
sub onButtonActivated()
43+
m.top.wasClosed = true
44+
end sub
45+
46+
function onKeyEvent(key as string, press as boolean) as boolean
47+
if not press then return false
48+
49+
if key = "back"
50+
m.top.wasClosed = true
51+
return false
52+
end if
53+
54+
return false
55+
end function
56+
4157
sub setPalette()
4258
dlgPalette = createObject("roSGNode", "RSGPalette")
4359
dlgPalette.colors = {

components/WhatsNewDialog.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<component name="WhatsNewDialog" extends="StandardMessageDialog">
3+
<interface>
4+
<field id="wasClosed" type="boolean" alwaysNotify="true" />
5+
</interface>
36
<children>
47
<StdDlgContentArea id="content" />
58
</children>

components/data/SceneManager.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ end sub
359359
' Display What's New dialog to user with an OK button
360360
sub whatsNewDialog()
361361
dialog = createObject("roSGNode", "WhatsNewDialog")
362-
dialog.observeField("buttonSelected", "onWhatsNewDialogClosed")
362+
dialog.observeField("wasClosed", "onWhatsNewDialogClosed")
363363
m.scene.dialog = dialog
364364
end sub
365365

0 commit comments

Comments
 (0)