4 Commits

Author SHA1 Message Date
Jeremy Phelps
27ca6b3f73 Make the burn-in look more like the real thing.
Exponential decay instead of linear.
2024-06-14 04:26:52 -04:00
Filippo Scognamiglio
f157648d1e Merge pull request #711 from razziel89/feature/appimage-in-github-actions
Feature/appimage in GitHub actions
2022-03-31 07:18:37 +02:00
Torsten Sachse
d4baaeccfc Undo unneeded code changes 2022-03-29 08:22:59 +02:00
Torsten Sachse
d412b66c6e Add github action for building an appimage 2022-03-29 08:16:02 +02:00
4 changed files with 105 additions and 8 deletions

98
.github/workflows/appimage.yml vendored Normal file
View File

@@ -0,0 +1,98 @@
name: "ci"
on:
push:
tags: "**"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
appimage:
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:beineri/opt-qt-5.15.2-bionic
sudo apt-get update -qq
sudo apt-get install -y \
build-essential make wget libgl1-mesa-dev \
qt515declarative qt515graphicaleffects \
qt515quickcontrols qt515quickcontrols2
- name: Download QT appimage builder
run: |
wget -c -O linuxdeployqt.AppImage \
https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod a+x linuxdeployqt.AppImage
- name: Build project
run: |
source /opt/qt*/bin/qt*-env.sh && \
qmake -v && \
qmake CONFIG+=release PREFIX=/usr && \
make -j$(nproc)
- name: Install to appdir
run: |
source /opt/qt*/bin/qt*-env.sh && \
make INSTALL_ROOT=appdir -j$(nproc) install
- name: Extract version number
run: |
# Extract version for linuxdeployqt to name the file. Use the tag as
# release name but remove prefix.
echo "VERSION=$(echo '${{ github.ref }}' | sed 's;.*/;;')" >> $GITHUB_ENV
- name: Build appimage directory
run: |
mkdir -p \
appdir/usr/bin \
appdir/usr/lib \
appdir/usr/share/applications \
appdir/usr/share/metainfo \
appdir/usr/share/icons/hicolor/128x128/apps
cp cool-retro-term appdir/usr/bin/
cp cool-retro-term.desktop appdir/usr/share/applications/
cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/
cp app/icons/128x128/cool-retro-term.png appdir/usr/share/icons/hicolor/128x128/apps/
cp -r ./app/qml appdir/usr/
# Workaround for https://github.com/probonopd/linuxdeployqt/issues/78
cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/
find appdir | sort
- name: Build appimage
run: |
source /opt/qt*/bin/qt*-env.sh && \
./linuxdeployqt.AppImage appdir/usr/share/applications/cool-retro-term.desktop \
-verbose=1 -appimage \
-qmldir=./app/qml/ \
-qmldir=./qmltermwidget/
env:
# Unset environment variables
QTDIR:
QT_PLUGIN_PATH:
LD_LIBRARY_PATH:
- name: Upload release
uses: softprops/action-gh-release@v1
with:
body: appimage release
files: ./**/Cool_Retro_Term-*-x86_64.AppImage
- name: Clean up
if: always()
run: |
find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
make clean
rm -rf appdir

View File

@@ -32,7 +32,7 @@ QtObject {
readonly property real maximumFontScaling: 2.50 readonly property real maximumFontScaling: 2.50
readonly property real minBurnInFadeTime: 160 readonly property real minBurnInFadeTime: 160
readonly property real maxBurnInFadeTime: 1600 readonly property real maxBurnInFadeTime: 160000
property bool isMacOS: Qt.platform.os === "osx" property bool isMacOS: Qt.platform.os === "osx"

View File

@@ -29,8 +29,8 @@ Loader {
property real lastUpdate: 0 property real lastUpdate: 0
property real prevLastUpdate: 0 property real prevLastUpdate: 0
property real burnIn: appSettings.burnIn property real burnIn: appSettings.burnIn;
property real burnInFadeTime: 1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn) property real burnInFadeTime: (1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn))*64
property real _minBurnInFadeTime: appSettings.minBurnInFadeTime property real _minBurnInFadeTime: appSettings.minBurnInFadeTime
property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime
@@ -146,9 +146,8 @@ Loader {
float prevMask = accColor.a; float prevMask = accColor.a;
float currMask = rgb2grey(txtColor); float currMask = rgb2grey(txtColor);
highp float blurDecay = clamp((lastUpdate - prevLastUpdate) * burnInTime, 0.0, 1.0); highp float blurDecay = clamp(pow(0.5, burnInTime * (lastUpdate - prevLastUpdate)), 0.0, 1.0);
blurDecay = max(0.0, blurDecay - prevMask); vec3 blurColor = accColor.rgb * vec3(blurDecay);
vec3 blurColor = accColor.rgb - vec3(blurDecay);
vec3 color = max(blurColor, txtColor); vec3 color = max(blurColor, txtColor);
gl_FragColor = vec4(color, currMask); gl_FragColor = vec4(color, currMask);

View File

@@ -302,8 +302,8 @@ Item {
(burnIn !== 0 ? " (burnIn !== 0 ? "
vec4 txt_blur = texture2D(burnInSource, staticCoords); vec4 txt_blur = texture2D(burnInSource, staticCoords);
float blurDecay = clamp((time - burnInLastUpdate) * burnInTime, 0.0, 1.0); float blurDecay = clamp(pow(0.5, burnInTime * (time - burnInLastUpdate)), 0.0, 1.0);
vec3 burnInColor = 0.65 * (txt_blur.rgb - vec3(blurDecay)); vec3 burnInColor = txt_blur.rgb * vec3(blurDecay);
txt_color = max(txt_color, convertWithChroma(burnInColor));" txt_color = max(txt_color, convertWithChroma(burnInColor));"
: "") + : "") +