diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-03-08 08:38:32 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-03-08 08:38:32 +0100 |
commit | ccf8095516c7cfae68f2ad612bcdb1e2d6420786 (patch) | |
tree | abf779caae515d328984d903000406d7590f9b9f /src/main/kotlin/pl/treksoft/kvision/panel | |
parent | 457c34a66170b1b5d395bff24297958902a81de7 (diff) | |
download | kvision-ccf8095516c7cfae68f2ad612bcdb1e2d6420786.tar.gz kvision-ccf8095516c7cfae68f2ad612bcdb1e2d6420786.tar.bz2 kvision-ccf8095516c7cfae68f2ad612bcdb1e2d6420786.zip |
Adds a property to activate child component directly.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt index da41db9f..3b045fa6 100644 --- a/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt +++ b/src/main/kotlin/pl/treksoft/kvision/panel/StackPanel.kt @@ -46,6 +46,15 @@ open class StackPanel( */ var activeIndex by refreshOnUpdate(-1) + /** + * The active (visible) child. + */ + var activeChild + get() = children[activeIndex] + set(value) { + activeIndex = children.indexOf(value) + } + init { @Suppress("LeakingThis") init?.invoke(this) |