105 lines
2.6 KiB
Kotlin
105 lines
2.6 KiB
Kotlin
package dev.fyloz.plannervio.ui.style
|
|
|
|
import javafx.scene.Cursor
|
|
import javafx.scene.paint.Color
|
|
import javafx.scene.paint.Paint
|
|
import kfoenix.JFXStylesheet.Companion.jfxButton
|
|
import kfoenix.JFXStylesheet.Companion.jfxRippler
|
|
import kfoenix.JFXStylesheet.Companion.jfxRipplerFill
|
|
import tornadofx.*
|
|
|
|
val primaryTheme = mapOf(
|
|
50 to c("#fcf2e7"),
|
|
100 to c("#f8dec3"),
|
|
200 to c("#f3c89c"),
|
|
300 to c("#eeb274"),
|
|
400 to c("#eaa256"),
|
|
500 to c("#e69138"),
|
|
600 to c("#e38932"),
|
|
700 to c("#df7e2b"),
|
|
800 to c("#db7424"),
|
|
900 to c("#d56217")
|
|
)
|
|
|
|
val accentTheme = mapOf(
|
|
50 to c("#e8f0f8"),
|
|
100 to c("#c5daee"),
|
|
200 to c("#9ec2e3"),
|
|
300 to c("#77aad7"),
|
|
400 to c("#5a97cf"),
|
|
500 to c("#3d85c6"),
|
|
600 to c("#377dc0"),
|
|
700 to c("#2f72b9"),
|
|
800 to c("#2768b1"),
|
|
900 to c("#1a55a4")
|
|
)
|
|
|
|
class Style : Stylesheet() {
|
|
|
|
companion object {
|
|
// Css properties
|
|
val jfxFocusColor by cssproperty<MultiValue<Paint>>("-jfx-focus-color")
|
|
val jfxUnFocusColor by cssproperty<MultiValue<Paint>>("-jfx-unfocus-color")
|
|
|
|
// Jfx classes
|
|
val jfxTextField by cssclass()
|
|
|
|
// Classes
|
|
val active by cssclass()
|
|
val appNameLabel by cssclass()
|
|
val navBar by cssclass()
|
|
val jfxSvgGlyphWrapper by cssclass()
|
|
}
|
|
|
|
init {
|
|
label {
|
|
fontFamily = "Biryani Regular"
|
|
}
|
|
|
|
navBar {
|
|
backgroundColor += primaryTheme.getValue(700)
|
|
prefWidth = 250.px
|
|
|
|
label {
|
|
fontFamily = "Biryani DemiBold"
|
|
fontSize = 2.em
|
|
textFill = Color.WHITE
|
|
|
|
and(appNameLabel) {
|
|
prefWidth = 250.px
|
|
}
|
|
}
|
|
|
|
jfxTextField {
|
|
jfxFocusColor.value += primaryTheme.getValue(100)
|
|
jfxUnFocusColor.value += primaryTheme.getValue(100)
|
|
textFill = Color.WHITE
|
|
fontSize = 1.2.em
|
|
borderInsets += box(10.px)
|
|
}
|
|
|
|
jfxButton {
|
|
cursor = Cursor.HAND
|
|
prefWidth = 250.px
|
|
backgroundRadius += box(0.px)
|
|
|
|
jfxRippler {
|
|
jfxRipplerFill.value = primaryTheme.getValue(100)
|
|
}
|
|
|
|
and(active) {
|
|
backgroundColor += primaryTheme.getValue(300)
|
|
}
|
|
|
|
jfxSvgGlyphWrapper {
|
|
padding = box(10.px, 15.px, 0.px, 0.px)
|
|
}
|
|
|
|
label {
|
|
fontSize = 1.2.em
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|