-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1446 from cewert/import-npm-bgv
Copy ButtonGroupVert code into app instead of using NPM package
- Loading branch information
Showing
5 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
sub init() | ||
m.top.layoutDirection = "vert" | ||
m.top.observeField("focusedChild", "onFocusChanged") | ||
m.top.observeField("focusButton", "onFocusButtonChanged") | ||
end sub | ||
|
||
sub onFocusChanged() | ||
if m.top.hasFocus() | ||
m.top.getChild(0).setFocus(true) | ||
m.top.focusButton = 0 | ||
end if | ||
end sub | ||
|
||
sub onFocusButtonChanged() | ||
m.top.getChild(m.top.focusButton).setFocus(true) | ||
end sub | ||
|
||
function onKeyEvent(key as string, press as boolean) as boolean | ||
if key = "OK" | ||
m.top.selected = m.top.focusButton | ||
return true | ||
end if | ||
|
||
if not press then return false | ||
|
||
if key = "down" | ||
i = m.top.focusButton | ||
target = i + 1 | ||
if target >= m.top.getChildCount() then return false | ||
m.top.focusButton = target | ||
return true | ||
else if key = "up" | ||
i = m.top.focusButton | ||
target = i - 1 | ||
if target < 0 then return false | ||
m.top.focusButton = target | ||
return true | ||
else if key = "left" or key = "right" | ||
m.top.escape = key | ||
return true | ||
end if | ||
|
||
return false | ||
end function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<component name="ButtonGroupVert" extends="ButtonGroup"> | ||
<interface> | ||
<field id="escape" type="string" alwaysNotify="true" /> | ||
<field id="selected" type="integer" alwaysNotify="true" /> | ||
</interface> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
"description": "Roku app for Jellyfin media server", | ||
"dependencies": { | ||
"@rokucommunity/bslib": "0.1.1", | ||
"bgv": "npm:[email protected]", | ||
"brighterscript-formatter": "1.6.34", | ||
"intKeyboard": "npm:[email protected]", | ||
"log": "npm:[email protected]", | ||
|