Fix bug in WFixedPanel and use WScrollPanel + WBox for config

This commit is contained in:
nea
2023-05-26 23:23:03 +02:00
parent 484a4b1a61
commit 59ea00dabc
8 changed files with 61 additions and 13 deletions

View File

@@ -23,11 +23,18 @@ import kotlin.time.ExperimentalTime
import kotlin.time.TimeSource
@OptIn(ExperimentalTime::class)
class TimeMark private constructor(private val timeMark: TimeSource.Monotonic.ValueTimeMark?) {
class TimeMark private constructor(private val timeMark: TimeSource.Monotonic.ValueTimeMark?) : Comparable<TimeMark> {
fun passedTime() = timeMark?.elapsedNow() ?: Duration.INFINITE
companion object {
fun now() = TimeMark(TimeSource.Monotonic.markNow())
fun farPast() = TimeMark(null)
}
override fun compareTo(other: TimeMark): Int {
if (this.timeMark == other.timeMark) return 0
if (this.timeMark == null) return -1
if (other.timeMark == null) return -1
return this.timeMark.compareTo(other.timeMark)
}
}