update: wrap release notes in scroll panel, show if update unavailable for downloading

Fixes GH-31
This commit is contained in:
Moritz Zwerger 2024-10-29 21:58:27 +01:00
parent c9795c4451
commit 3c93f7cc45
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
4 changed files with 23 additions and 7 deletions

View File

@ -30,6 +30,7 @@ import de.bixilon.minosoft.util.logging.LogMessageType
import de.bixilon.minosoft.util.system.SystemUtil
import javafx.fxml.FXML
import javafx.scene.control.Button
import javafx.scene.control.Tooltip
import javafx.scene.input.KeyCode
import javafx.scene.input.KeyEvent
import javafx.scene.text.TextFlow
@ -62,6 +63,11 @@ class UpdateAvailableDialog(
openButtonFX.isDisable = update.page === null
updateButtonFX.isDisable = update.download === null
if (update.download == null) {
val tooltip = Tooltip().apply { ctext = UNAVAILABLE; styleClass += "tooltip-error" }
Tooltip.install(updateButtonFX.parent, tooltip) // can not add to the button, because java fx sucks. disabled nodes don't get click/hover events
}
}
override fun postInit() {
@ -107,5 +113,7 @@ class UpdateAvailableDialog(
private val LATER = i18n("updater.available.later")
private val OPEN = i18n("updater.available.open")
private val UPDATE = i18n("updater.available.update")
private val UNAVAILABLE = i18n("updater.available.unavailable")
}
}

View File

@ -14,7 +14,7 @@
-->
<?import javafx.geometry.*?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>
@ -37,12 +37,14 @@
</GridPane.margin>
<Text text="New update available: whatever"/>
</TextFlow>
<TextFlow fx:id="releaseNotesFX" GridPane.rowIndex="1">
<GridPane.margin>
<Insets bottom="20.0" left="5.0" right="5.0" top="40.0"/>
</GridPane.margin>
<Text text="Long notes on what is cool about the update"/>
</TextFlow>
<ScrollPane GridPane.rowIndex="1">
<TextFlow fx:id="releaseNotesFX">
<GridPane.margin>
<Insets bottom="20.0" left="5.0" right="5.0" top="40.0"/>
</GridPane.margin>
<Text text="Long notes on what is cool about the update"/>
</TextFlow>
</ScrollPane>
<GridPane GridPane.rowIndex="2">
<columnConstraints>
<ColumnConstraints hgrow="NEVER"/>

View File

@ -174,6 +174,11 @@
-fx-padding: 0;
}
.scroll-pane,
.scroll-pane > .viewport {
-fx-background-color: transparent;
}
/* General panes */

View File

@ -230,6 +230,7 @@ minosoft:updater.available.dismiss=Dismiss
minosoft:updater.available.later=Update later
minosoft:updater.available.open=Open in browser
minosoft:updater.available.update=Update now
updater.available.unavailable=The update is not available for downloading.\nThe update is only built for linux (64bit) at the moment.\nIf you need it for a different platform, feel free to download it from github actions or build it yourself.\nSorry :(
minosoft:updater.ask.title=Update checking