diff --git a/app/src/assets/climber_timer.properties b/app/src/assets/climber_timer.properties index 4a58fa8..371c2ad 100644 --- a/app/src/assets/climber_timer.properties +++ b/app/src/assets/climber_timer.properties @@ -10,4 +10,6 @@ color_of_warning_time=FF0000 sound_start=sounds/start.wav sound_last_minute=sounds/minute.wav sound_last_seconds=sounds/ding.wav -sound_finish=sounds/finish.wav \ No newline at end of file +sound_finish=sounds/finish.wav + +logo=logo.png \ No newline at end of file diff --git a/app/src/assets/logo.png b/app/src/assets/logo.png new file mode 100644 index 0000000..e8b1529 Binary files /dev/null and b/app/src/assets/logo.png differ diff --git a/app/src/main/java/lt/neworld/climbtimer/AppProperties.kt b/app/src/main/java/lt/neworld/climbtimer/AppProperties.kt index 5bbbf38..091489e 100644 --- a/app/src/main/java/lt/neworld/climbtimer/AppProperties.kt +++ b/app/src/main/java/lt/neworld/climbtimer/AppProperties.kt @@ -26,6 +26,8 @@ object AppProperties { private const val PROP_SOUND_LAST_SECONDS = "sound_last_seconds" private const val PROP_SOUND_FINISH = "sound_finish" + private const val PROP_LOGO = "logo" + private val file = File("climber_timer.properties") private val properties by lazy { @@ -60,6 +62,8 @@ object AppProperties { var soundLastSeconds: File? by FileField(PROP_SOUND_LAST_SECONDS, null) var soundFinish: File? by FileField(PROP_SOUND_FINISH, null) + var logo: File? by FileField(PROP_LOGO, null) + class TimeField(key: String, default: Long) : Field(key, default) { override fun deserialize(raw: String): Long = raw.toLong() * 1000 diff --git a/app/src/main/java/lt/neworld/climbtimer/controllers/TimerController.kt b/app/src/main/java/lt/neworld/climbtimer/controllers/TimerController.kt index 6b33ec7..cee0ad5 100644 --- a/app/src/main/java/lt/neworld/climbtimer/controllers/TimerController.kt +++ b/app/src/main/java/lt/neworld/climbtimer/controllers/TimerController.kt @@ -7,6 +7,8 @@ import javafx.fxml.Initializable import javafx.scene.Parent import javafx.scene.Scene import javafx.scene.control.Label +import javafx.scene.image.Image +import javafx.scene.image.ImageView import javafx.scene.input.KeyCode import javafx.scene.paint.Color import javafx.stage.Stage @@ -30,6 +32,9 @@ class TimerController : Initializable { @FXML private lateinit var title: Label + @FXML + private lateinit var logo: ImageView + private val timer = Timer( runTime = AppProperties.runTime, waitTime = AppProperties.waitTime, @@ -39,6 +44,7 @@ class TimerController : Initializable { override fun initialize(location: URL, resources: ResourceBundle?) { title.text = AppProperties.title + logo.image = AppProperties.logo?.let { Image(it.toURI().toString()) } showTimer() } diff --git a/app/src/main/resources/lt/neworld/climbtimer/controllers/timer.fxml b/app/src/main/resources/lt/neworld/climbtimer/controllers/timer.fxml index 4113d94..f2d3360 100644 --- a/app/src/main/resources/lt/neworld/climbtimer/controllers/timer.fxml +++ b/app/src/main/resources/lt/neworld/climbtimer/controllers/timer.fxml @@ -2,6 +2,7 @@ + @@ -17,13 +18,23 @@ - + +
+ +
+ + + + + + +