mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 07:30:14 +08:00
Empty bot list view
This commit is contained in:
parent
27cb975c62
commit
92d9e27b04
@ -1,6 +1,7 @@
|
||||
package net.mamoe.mirai.console.graphical.stylesheet
|
||||
|
||||
import javafx.scene.Cursor
|
||||
import javafx.scene.paint.Color
|
||||
import javafx.scene.text.FontWeight
|
||||
import tornadofx.*
|
||||
|
||||
@ -46,6 +47,24 @@ class PrimaryStyleSheet : BaseStyleSheet() {
|
||||
|
||||
jfxListView {
|
||||
|
||||
// placeholder
|
||||
vBox {
|
||||
spacing = 15.px
|
||||
|
||||
label {
|
||||
textFill = c(fontColor)
|
||||
fontWeight = FontWeight.BOLD
|
||||
}
|
||||
|
||||
button {
|
||||
textFill = c(fontColor)
|
||||
fontWeight = FontWeight.BOLD
|
||||
backgroundColor += c(secondaryColor, 0.8)
|
||||
padding = box(2.px, 10.px)
|
||||
cursor = Cursor.HAND
|
||||
}
|
||||
}
|
||||
|
||||
jfxListCell {
|
||||
backgroundColor += c(100, 100, 100, 0.4)
|
||||
backgroundRadius += box(5.px)
|
||||
|
@ -14,7 +14,7 @@ import tornadofx.bind
|
||||
|
||||
internal fun EventTarget.jfxTabPane(op: JFXTabPane.() -> Unit = {}) = JFXTabPane().attachTo(this, op)
|
||||
|
||||
internal fun EventTarget.jfxButton(text: String = "", graphic: Node? = null, op: Button.() -> Unit = {}) =
|
||||
internal fun EventTarget.jfxButton(text: String = "", graphic: Node? = null, op: JFXButton.() -> Unit = {}) =
|
||||
JFXButton(text).attachTo(this, op) {
|
||||
if (graphic != null) it.graphic = graphic
|
||||
it.buttonType = JFXButton.ButtonType.RAISED
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.mamoe.mirai.console.graphical.view
|
||||
|
||||
import com.jfoenix.controls.JFXButton
|
||||
import com.jfoenix.controls.JFXListCell
|
||||
import javafx.collections.ObservableList
|
||||
import javafx.geometry.Insets
|
||||
@ -39,6 +40,20 @@ class PrimaryView : View() {
|
||||
jfxListView(controller.botList) {
|
||||
fitToParentHeight()
|
||||
|
||||
placeholder = vbox {
|
||||
|
||||
alignment = Pos.CENTER
|
||||
|
||||
label("Bot列表为空,请登录一个Bot")
|
||||
|
||||
jfxButton("登录") {
|
||||
buttonType = JFXButton.ButtonType.FLAT
|
||||
}.action {
|
||||
// select login pane
|
||||
mainTabPane.selectionModel.select(3)
|
||||
}
|
||||
}
|
||||
|
||||
setCellFactory {
|
||||
object : JFXListCell<BotModel>() {
|
||||
var tab: Tab? = null
|
||||
|
Loading…
Reference in New Issue
Block a user