[Editor] Replace brush range buttons with slider
This commit is contained in:
@@ -20,7 +20,6 @@ class MapToolbarView : View() {
|
|||||||
|
|
||||||
private val tool = ToggleGroup()
|
private val tool = ToggleGroup()
|
||||||
|
|
||||||
|
|
||||||
override val root = toolbar {
|
override val root = toolbar {
|
||||||
button(graphic = FontIcon("fa-undo")) {
|
button(graphic = FontIcon("fa-undo")) {
|
||||||
shortcut("Ctrl+Z")
|
shortcut("Ctrl+Z")
|
||||||
@@ -78,20 +77,22 @@ class MapToolbarView : View() {
|
|||||||
graphic = FontIcon("fa-eraser")
|
graphic = FontIcon("fa-eraser")
|
||||||
}
|
}
|
||||||
|
|
||||||
this += FontIcon("fa-paint-brush")
|
this += FontIcon("fa-paint-brush").apply { iconSize = 10 }
|
||||||
|
|
||||||
button(graphic = FontIcon("fa-plus")) {
|
slider(1..5) {
|
||||||
enableWhen(brushVM.brushRangeProperty.lessThan(5))
|
majorTickUnit = 1.0
|
||||||
action {
|
isSnapToTicks = true
|
||||||
brushVM.item = brushVM.withBrushRange(brushVM.brushRange + 1)
|
minorTickCount = 0
|
||||||
|
|
||||||
|
valueProperty().addListener { _, _, newValue ->
|
||||||
|
brushVM.item = brushVM.withBrushRange(newValue.toInt())
|
||||||
|
}
|
||||||
|
|
||||||
|
brushVM.brushRangeProperty.addListener { _, _, newValue ->
|
||||||
|
value = newValue.toDouble()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button(graphic = FontIcon("fa-minus")) {
|
this += FontIcon("fa-paint-brush").apply { iconSize = 15 }
|
||||||
enableWhen(brushVM.brushRangeProperty.greaterThan(1))
|
|
||||||
action {
|
|
||||||
brushVM.item = brushVM.withBrushRange(brushVM.brushRange - 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user