Browse Source

Minor improvements

master
Rohan Sircar 3 years ago
parent
commit
f721768098
  1. 4
      src/main/scala/nova/monadic_sfx/MainApp.scala
  2. 2
      src/main/scala/nova/monadic_sfx/implicits/JavaFxMonixObservables.scala
  3. 19
      src/main/scala/nova/monadic_sfx/ui/screens/HomeScreen.scala

4
src/main/scala/nova/monadic_sfx/MainApp.scala

@ -42,7 +42,7 @@ class MainApp(
startTime: Long
)(implicit logger: Logger[Task]) {
lazy val _scene = new Scene {
private lazy val _scene = new Scene {
root = new HBox {
padding = Insets(20)
}
@ -78,7 +78,7 @@ class MainAppDelegate(schedulers: Schedulers)(implicit logger: Logger[Task]) {
| -fx-pref-width: 200;
| -fx-text-fill: WHITE; """.stripMargin
def init =
val init =
for {
router <- Task.pure(new FXRouter[Page])
routerStore <- router.store(Page.Home, logger)

2
src/main/scala/nova/monadic_sfx/implicits/JavaFxMonixObservables.scala

@ -135,7 +135,7 @@ object JavaFXMonixObservables {
def -->(sub: Observer[A]) =
prop.onChange((a, b, c) => if (c != null) sub.onNext(c))
def -->(op: Property[A, A]) = {
def ==>(op: Property[A, A]) = {
prop.onChange((a, b, c) => if (c != null) op() = c)
}

19
src/main/scala/nova/monadic_sfx/ui/screens/HomeScreen.scala

@ -21,16 +21,15 @@ class HomeScreen(
val myObs = myButton.observableAction
// myObs.foreachL(_ => ())
private lazy val root = Task.deferAction { implicit s =>
Task {
new HBox {
children = List(
new Text {
text = "hello"
},
myButton
)
}
private lazy val root = Task {
new HBox {
children = List(
new Text {
text = "hello"
},
myButton
)
}
}

Loading…
Cancel
Save