|
|
@@ -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
|
|
|
@@ -65,6 +80,26 @@ class PrimaryView : View() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ center = vbox {
|
|
|
+
|
|
|
+ jfxTabPane {
|
|
|
+
|
|
|
+ fitToParentHeight()
|
|
|
+
|
|
|
+ tabClosingPolicy = TabPane.TabClosingPolicy.ALL_TABS
|
|
|
+
|
|
|
+ logTab("Main", controller.mainLog, closeable = false)
|
|
|
+
|
|
|
+ fixedTab("Plugins").content = find<PluginsView>().root
|
|
|
+
|
|
|
+ fixedTab("Settings").content = find<SettingsView>().root
|
|
|
+
|
|
|
+ fixedTab("Login").content = find<LoginView>().root
|
|
|
+
|
|
|
+ mainTabPane = this
|
|
|
+ }
|
|
|
|
|
|
// command input
|
|
|
textfield {
|
|
|
@@ -80,21 +115,6 @@ class PrimaryView : View() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- center = jfxTabPane {
|
|
|
-
|
|
|
- tabClosingPolicy = TabPane.TabClosingPolicy.ALL_TABS
|
|
|
-
|
|
|
- logTab("Main", controller.mainLog, closeable = false)
|
|
|
-
|
|
|
- fixedTab("Plugins").content = find<PluginsView>().root
|
|
|
-
|
|
|
- fixedTab("Settings").content = find<SettingsView>().root
|
|
|
-
|
|
|
- fixedTab("Login").content = find<LoginView>().root
|
|
|
-
|
|
|
- mainTabPane = this
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
fun Tab.select() = apply {
|