Skip to content

Commit

Permalink
update: wrap release notes in scroll panel, show if update unavailabl…
Browse files Browse the repository at this point in the history
…e for downloading

Fixes GH-31
  • Loading branch information
Bixilon committed Oct 29, 2024
1 parent c9795c4 commit 3c93f7c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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?>
Expand All @@ -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"/>
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/minosoft/eros/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
-fx-padding: 0;
}

.scroll-pane,
.scroll-pane > .viewport {
-fx-background-color: transparent;
}


/* General panes */

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/minosoft/language/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c93f7c

Please sign in to comment.