Fix dialog palette
This commit is contained in:
1 parent
8f1d3778d8
commit
242298911c
6 files changed
+22
-4
No files matched your search
@@ -1,6 +1,7 @@
|
||||
function ShowErrorDialog(message as object, bulletText as object, bottomMessage as object)
|
||||
' Note: dialog can be null since StandardMessageDialog is only available on 10.0 and later
|
||||
dialog = CreateObject("roSGNode", "StandardMessageDialog")
|
||||
SetPalette(dialog)
|
||||
dialog.message = message
|
||||
dialog.bulletText = bulletText
|
||||
dialog.bottomMessage = bottomMessage
|
||||
@@ -15,6 +16,19 @@ function ShowErrorDialog(message as object, bulletText as object, bottomMessage
|
||||
m.top.getScene().dialog = dialog
|
||||
end function
|
||||
|
||||
function SetPalette(dialog as object)
|
||||
palette = createObject("roSGNode", "RSGPalette")
|
||||
palette.colors = {
|
||||
DialogBackgroundColor: "#242424FF",
|
||||
DialogFocusColor: "#CECECEFF",
|
||||
DialogFocusItemColor: "#202020FF",
|
||||
DialogSecondaryTextColor: "#F8F8F8FF",
|
||||
DialogSecondaryItemColor: "0xFF1C30FF",
|
||||
DialogTextColor: "#EEEEEEFF"
|
||||
}
|
||||
dialog.palette = palette
|
||||
end function
|
||||
|
||||
function OnButtonSelected()
|
||||
m.top.getScene().dialog.close = true
|
||||
end function
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function SetPalette()
|
||||
function SetPalette(dialog as object)
|
||||
palette = createObject("roSGNode", "RSGPalette")
|
||||
palette.colors = {
|
||||
DialogBackgroundColor: "#242424FF",
|
||||
@@ -8,5 +8,5 @@ function SetPalette()
|
||||
DialogSecondaryItemColor: "0xFF1C30FF",
|
||||
DialogTextColor: "#EEEEEEFF"
|
||||
}
|
||||
m.top.palette = palette
|
||||
dialog.palette = palette
|
||||
end function
|
||||
@@ -5,7 +5,7 @@ import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
SetPalette()
|
||||
SetPalette(m.top)
|
||||
m.urlLabel = m.top.findNode("urlLabel")
|
||||
m.qrCode = m.top.findNode("QrCodePoster")
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import "DialogPalette.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
SetPalette()
|
||||
SetPalette(m.top)
|
||||
m.top.observeField("buttonSelected", FuncName(CloseDialog))
|
||||
end function
|
||||
|
||||
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
import "pkg:/components/Navigation/Navigation.bs"
|
||||
import "pkg:/components/Services/Invidious/InvidiousService.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/components/Dialog/DialogPalette.bs"
|
||||
|
||||
function Init()
|
||||
m.textEditBox = m.top.findNode("textEditBox")
|
||||
@@ -77,6 +78,7 @@ end function
|
||||
|
||||
function OnEditButtonSelected()
|
||||
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
||||
SetPalette(keyboardDialog)
|
||||
keyboardDialog.title = "Edit Instance"
|
||||
keyboardDialog.message = [`Enter the instance url (e.g. ${Invidious.DEFAULT_INSTANCE})`]
|
||||
keyboardDialog.text = m.top.text
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
import "pkg:/components/Dialog/DialogPalette.bs"
|
||||
|
||||
function Init()
|
||||
m.top.focusable = true
|
||||
@@ -65,6 +66,7 @@ end function
|
||||
|
||||
function ShowEditKeyboard()
|
||||
keyboardDialog = createObject("roSGNode", "StandardKeyboardDialog")
|
||||
SetPalette(keyboardDialog)
|
||||
keyboardDialog.title = m.top.displayText
|
||||
keyboardDialog.message = [m.top.description]
|
||||
keyboardDialog.text = m.top.value
|
||||
|
||||
Reference in new issue
Block a user