diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 0863b45..f45e092 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -8,12 +8,15 @@ # Each release also has the app (v2): steamify-app.tar.gz (ui/, steamify.sh, # lib/, the icon) and its launcher, run with: # curl -fsSL https://github.com/theupriser/steamify-cachyos/releases/latest/download/steamify-app.sh | bash +# A push to feat/v2-ui (the app, not released yet) updates the pre-release +# v2-ui-preview instead, whose launcher gets that build: +# curl -fsSL https://github.com/theupriser/steamify-cachyos/releases/download/v2-ui-preview/steamify-app.sh | bash # Pull requests only build and check it, and warn when VERSION is already released. name: Single-file build on: push: - branches: [main] + branches: [main, feat/v2-ui] pull_request: workflow_dispatch: @@ -103,3 +106,23 @@ jobs: gh release create latest --title "Steamify CachyOS - latest (v$VERSION)" --notes "$latest_notes" --latest=false fi gh release upload latest dist/steamify.sh dist/steamify-app.sh dist/steamify-app.tar.gz assets/steam-gaming-settings.svg --clobber + + - name: Publish the v2-ui-preview pre-release + if: github.event_name == 'push' && github.ref == 'refs/heads/feat/v2-ui' + env: + GH_TOKEN: ${{ github.token }} + run: | + # Its launcher downloads this pre-release, not the newest release. + sed -i 's/STEAMIFY_RELEASE:-latest/STEAMIFY_RELEASE:-v2-ui-preview/' dist/steamify-app.sh + grep -q 'STEAMIFY_RELEASE:-v2-ui-preview' dist/steamify-app.sh + git tag -f v2-ui-preview "$GITHUB_SHA" && git push -f origin v2-ui-preview + notes="Preview of the Steamify app (v2) from feat/v2-ui ($(git describe --always), $(git log -1 --format='%cs %s')). Not a release. + Run it with: + + curl -fsSL https://github.com/${{ github.repository }}/releases/download/v2-ui-preview/steamify-app.sh | bash" + if gh release view v2-ui-preview >/dev/null 2>&1; then + gh release edit v2-ui-preview --title "Steamify app (v2) preview" --notes "$notes" --prerelease --latest=false + else + gh release create v2-ui-preview --target "$GITHUB_SHA" --title "Steamify app (v2) preview" --notes "$notes" --prerelease --latest=false + fi + gh release upload v2-ui-preview dist/steamify-app.sh dist/steamify-app.tar.gz --clobber diff --git a/ui/qml/Main.qml b/ui/qml/Main.qml index f0e7bf2..925d4f5 100644 --- a/ui/qml/Main.qml +++ b/ui/qml/Main.qml @@ -118,6 +118,7 @@ ApplicationWindow { } function label(it) { return (texts[it.id] && texts[it.id].label) || it.label; } function syncFromStatus() { + reapply = false; var w = {}; for (var i = 0; i < items.length; i++) w[items[i].id] = items[i].kind === "action" ? false : items[i].wanted; want = w; @@ -252,7 +253,7 @@ ApplicationWindow { else if (a === "back") Qt.quit(); } else if (screen === "review") { if (a === "accept" || a === "apply") onApplyPressed(); - else if (a === "back") screen = "menu"; + else if (a === "back") { reapply = false; screen = "menu"; } } else if (screen === "password") { if (a === "accept" || a === "apply") submitPassword(); else if (a === "back") { pw.text = ""; screen = "review"; } @@ -353,9 +354,13 @@ ApplicationWindow { // --- The 1280x720 stage, scaled to the window --- Item { id: stage - width: 1280; height: 720 - anchors.centerIn: parent - scale: Math.min(win.width / 1280, win.height / 720) + // Scaled like a 1280x720 screen, but stretched to the window's own + // shape, so the bars reach the edges and the content fills it. + readonly property real k: Math.min(win.width / 1280, win.height / 720) + width: win.width / k; height: win.height / k + x: 0; y: 0 + transformOrigin: Item.TopLeft + scale: k focus: true Keys.onPressed: function (e) { if (!(screen === "password" && pw.activeFocus && e.key !== Qt.Key_Escape && e.key !== Qt.Key_Return && e.key !== Qt.Key_Enter)) keyAct(e); } Keys.onReleased: function (e) { if (screen === "bios2" && !e.isAutoRepeat && (e.key === Qt.Key_Return || e.key === Qt.Key_Enter)) act("release"); } @@ -393,7 +398,7 @@ ApplicationWindow { Item { id: menuBody; visible: items.length > 0 - x: 40; y: 28; width: 1200; height: parent.height - 28 - 64 - 20 + x: 40; y: 28; width: parent.width - 80; height: parent.height - 28 - 64 - 20 // Left: the list Column { id: listCol; width: 740; height: parent.height; spacing: 10 @@ -564,7 +569,7 @@ ApplicationWindow { Text { anchors.verticalCenter: parent.verticalCenter; x: 18; text: "Your password is asked once. Changes to how the PC starts need a restart."; color: t.soft; font.family: t.body; font.pixelSize: 14 } } } Rectangle { - x: 812; y: 32; width: 428; height: 210; radius: 16; color: t.card + x: parent.width - 468; y: 32; width: 428; height: 210; radius: 16; color: t.card Column { anchors.fill: parent; anchors.margins: 24; spacing: 12 Text { text: "SUMMARY"; color: t.faint; font.family: t.body; font.pixelSize: 12; font.weight: Font.DemiBold; font.letterSpacing: 0.8 } Repeater { model: [["Turn on", "on"], ["Re-apply", "again"], ["Turn off", "off"]] @@ -576,7 +581,7 @@ ApplicationWindow { Rectangle { anchors.bottom: parent.bottom; width: parent.width; height: 64; color: t.bar Rectangle { width: parent.width; height: 1; color: t.line } - Btn { anchors.left: parent.left; anchors.leftMargin: 40; anchors.verticalCenter: parent.verticalCenter; k: g.back; text: "Back to the menu"; onClicked: screen = "menu" } + Btn { anchors.left: parent.left; anchors.leftMargin: 40; anchors.verticalCenter: parent.verticalCenter; k: g.back; text: "Back to the menu"; onClicked: act("back") } Btn { anchors.right: parent.right; anchors.rightMargin: 40; anchors.verticalCenter: parent.verticalCenter; k: g.ok; text: "Apply"; primary: true; visible: plan.length > 0; onClicked: onApplyPressed() } } } @@ -660,7 +665,7 @@ ApplicationWindow { } } Column { - x: 632; y: 32; width: 608; height: parent.height - 64; spacing: 10 + x: 632; y: 32; width: parent.width - 672; height: parent.height - 64; spacing: 10 Text { text: "DETAILS"; color: t.faint; font.family: t.body; font.pixelSize: 12; font.weight: Font.DemiBold; font.letterSpacing: 0.8 } Rectangle { width: parent.width; height: parent.height - 30; radius: 16; color: "#0b0e13"; border.width: 1; border.color: "#1d2531" ListView { id: logView; anchors.fill: parent; anchors.margins: 18; clip: true; model: logModel @@ -674,7 +679,7 @@ ApplicationWindow { visible: screen === "bios1" anchors.top: header.bottom; anchors.bottom: parent.bottom; width: parent.width Rectangle { - x: 40; y: 28; width: 1200; height: parent.height - 28 - 64 - 24; radius: 16; color: "#1d1416"; border.width: 2; border.color: "#b33a3a" + x: 40; y: 28; width: parent.width - 80; height: parent.height - 28 - 64 - 24; radius: 16; color: "#1d1416"; border.width: 2; border.color: "#b33a3a" Row { anchors.fill: parent; anchors.margins: 32; spacing: 40 Column { width: 640; spacing: 16 Row { spacing: 12 diff --git a/ui/steamify-app.sh b/ui/steamify-app.sh index f118b48..4fe1b83 100755 --- a/ui/steamify-app.sh +++ b/ui/steamify-app.sh @@ -4,11 +4,13 @@ # Downloads the newest release's app package (steamify-app.tar.gz: the app, # steamify.sh and lib/) to ~/.local/share/steamify/app, installs PySide6 if # it's missing, adds a launcher entry, and starts the app. -# STEAMIFY_BRANCH= takes that branch's source instead of a release -# (for testing before a release). +# STEAMIFY_RELEASE= takes that release instead of the newest (the +# v2-ui-preview build's copy of this script sets it). STEAMIFY_BRANCH= +# takes that branch's source instead (for testing before a build). set -euo pipefail REPO="theupriser/steamify-cachyos" +RELEASE="${STEAMIFY_RELEASE:-latest}" DEST="${XDG_DATA_HOME:-$HOME/.local/share}/steamify/app" APPS="${XDG_DATA_HOME:-$HOME/.local/share}/applications" @@ -26,8 +28,14 @@ if [[ -n "${STEAMIFY_BRANCH:-}" ]]; then mkdir "$tmp/app" tar -xzf "$tmp/src.tar.gz" -C "$tmp/app" --strip-components=1 else - say "Downloading the newest Steamify app..." - curl -fsSL "https://github.com/$REPO/releases/latest/download/steamify-app.tar.gz" -o "$tmp/app.tar.gz" || + if [[ "$RELEASE" == latest ]]; then + url="https://github.com/$REPO/releases/latest/download/steamify-app.tar.gz" + say "Downloading the newest Steamify app..." + else + url="https://github.com/$REPO/releases/download/$RELEASE/steamify-app.tar.gz" + say "Downloading the Steamify app ($RELEASE)..." + fi + curl -fsSL "$url" -o "$tmp/app.tar.gz" || die "Couldn't download the app (is there a release with steamify-app.tar.gz yet?)." mkdir "$tmp/app" tar -xzf "$tmp/app.tar.gz" -C "$tmp/app"