-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #102: The top window under the mouse is considered active
- Loading branch information
1 parent
7193273
commit 615a167
Showing
6 changed files
with
74 additions
and
7 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
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
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,46 @@ | ||
package demo | ||
|
||
import indigo.* | ||
import roguelikestarterkit.* | ||
|
||
object MenuWindow: | ||
|
||
private val graphic = Graphic(0, 0, TerminalMaterial(AssetName(""), RGBA.White, RGBA.Black)) | ||
|
||
val windowId: WindowId = WindowId("MenuWindow") | ||
|
||
def window( | ||
charSheet: CharSheet | ||
): WindowModel[ComponentList[Int], Int] = | ||
WindowModel( | ||
windowId, | ||
charSheet, | ||
ComponentList(Dimensions(20, 3)) { (_: Int) => | ||
Batch( | ||
Button[Int]( | ||
"Window 1", | ||
Button.Theme( | ||
charSheet, | ||
RGBA.Silver -> RGBA.Black, | ||
RGBA.White -> RGBA.Black, | ||
RGBA.Black -> RGBA.White, | ||
hasBorder = false | ||
) | ||
).onClick(Log("Window 1"), WindowEvent.Open(ComponentsWindow.windowId)), | ||
Button[Int]( | ||
"Window 2", | ||
Button.Theme( | ||
charSheet, | ||
RGBA.Silver -> RGBA.Black, | ||
RGBA.Green -> RGBA.Black, | ||
RGBA.Black -> RGBA.Yellow, | ||
hasBorder = false | ||
) | ||
).onClick(Log("Window 2"), WindowEvent.Open(ComponentsWindow2.windowId)) | ||
) | ||
} | ||
.withLayout(ComponentLayout.Horizontal(Padding(0, 1, 0, 0))) | ||
) | ||
.moveTo(0, 0) | ||
.resizeTo(20, 3) | ||
.isStatic |
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
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
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