WIP desktop client for Chatto reimplemented in ScalaFX and Sapphire Framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. package wow.doge.chatto.controller
  2. import javafx.fxml.FXML
  3. import javafx.scene.control.MenuBar
  4. import com.sfxcode.sapphire.core.controller.ViewController
  5. import com.sfxcode.sapphire.core.scene.ContentManager
  6. import com.typesafe.scalalogging.LazyLogging
  7. import scalafx.Includes._
  8. import javafx.scene.layout.HBox
  9. import javafx.scene.layout.Priority
  10. class MainViewController extends ViewController with LazyLogging {
  11. @FXML private var menuBar: MenuBar = _
  12. // @FXML
  13. // var workspacePane: Pane = _
  14. // @FXML
  15. // var statusPane: Pane = _
  16. // @FXML
  17. // var navigationPane: Pane = _
  18. @FXML private var mainPane: HBox = _
  19. lazy val workspaceController = getController[WorkspaceController]()
  20. lazy val navigationController = getController[NavigationController]()
  21. lazy val statusBarController = getBean[StatusBarController]()
  22. lazy val loginController = getController[LoginController]()
  23. lazy val chatController = getController[ChatController]()
  24. var workspaceManager: ContentManager = _
  25. var navigationManager: ContentManager = _
  26. var statusBarManager: ContentManager = _
  27. var mainManager: ContentManager = _
  28. override def didGainVisibilityFirstTime() = {
  29. menuBar.setUseSystemMenuBar(true)
  30. // menuBar.setVisible(false)
  31. // navigationManager =
  32. // ContentManager(navigationPane, this, navigationController)
  33. // statusBarManager = ContentManager(statusPane, this, statusBarController)
  34. // workspaceManager = ContentManager(workspacePane, this, workspaceController)
  35. mainManager = ContentManager(mainPane, this)
  36. chatController.chatMainPane.hgrow = Priority.ALWAYS
  37. }
  38. def showChatController(): Unit = {
  39. mainManager.updatePaneContent(chatController)
  40. }
  41. }