mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2026-02-08 00:32:27 +00:00
Compare commits
22 Commits
feature/cl
...
feature/im
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eba69d3a54 | ||
|
|
403bb11e7e | ||
|
|
9f05d729a7 | ||
|
|
25695c0a9f | ||
|
|
b77a1b5962 | ||
|
|
29dc67d96b | ||
|
|
2e4536ecdf | ||
|
|
8cf303132f | ||
|
|
55ef7cb7e0 | ||
|
|
77434e463e | ||
|
|
6bcb54114d | ||
|
|
09f813a7e0 | ||
|
|
a6a7768e42 | ||
|
|
33878dae24 | ||
|
|
0313a00b4f | ||
|
|
be4b1f366c | ||
|
|
c54dcb1c1c | ||
|
|
5795aeb6b7 | ||
|
|
e70268bb73 | ||
|
|
e72faa1d2c | ||
|
|
e1fc767431 | ||
|
|
737d289a19 |
98
.github/workflows/appimage.yml
vendored
98
.github/workflows/appimage.yml
vendored
@@ -1,98 +0,0 @@
|
||||
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
|
||||
129
.github/workflows/release.yml
vendored
Normal file
129
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build-appimage:
|
||||
name: Build (Linux, AppImage)
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install build deps
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential rsync wget
|
||||
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: 6.10.0
|
||||
dir: ..
|
||||
modules: qt5compat qtshadertools
|
||||
setup-python: false
|
||||
cache: true
|
||||
|
||||
- name: Build AppImage
|
||||
run: |
|
||||
./scripts/build-appimage.sh
|
||||
|
||||
- name: Collect artifact
|
||||
run: |
|
||||
mkdir -p release
|
||||
mv ./*.AppImage release/
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cool-retro-term-appimage
|
||||
path: ./release/*
|
||||
|
||||
build-dmg:
|
||||
name: Build (macOS, DMG)
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v4
|
||||
with:
|
||||
version: 6.10.*
|
||||
modules: qt5compat qtshadertools
|
||||
setup-python: true
|
||||
python-version: '3.11'
|
||||
cache: true
|
||||
|
||||
- name: Build DMG
|
||||
run: |
|
||||
JOBS="$(sysctl -n hw.ncpu)"
|
||||
./scripts/build-dmg.sh
|
||||
|
||||
- name: Collect artifact
|
||||
run: |
|
||||
mkdir -p release
|
||||
mv ./*.dmg release/
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cool-retro-term-dmg
|
||||
path: ./release/*
|
||||
|
||||
release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- build-appimage
|
||||
- build-dmg
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download AppImage
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cool-retro-term-appimage
|
||||
path: ./release
|
||||
|
||||
- name: Download DMG
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: cool-retro-term-dmg
|
||||
path: ./release
|
||||
|
||||
- name: Update rolling tag
|
||||
if: startsWith(github.ref, 'refs/heads/')
|
||||
run: |
|
||||
git tag -f rolling
|
||||
git push -f origin rolling
|
||||
|
||||
- name: Publish rolling release
|
||||
if: startsWith(github.ref, 'refs/heads/')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: rolling
|
||||
name: Rolling Release
|
||||
prerelease: true
|
||||
files: ./release/*
|
||||
|
||||
- name: Publish tagged release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
files: ./release/*
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -41,11 +41,17 @@ Makefile*
|
||||
*.json
|
||||
|
||||
# Excludes compiled files
|
||||
|
||||
imports
|
||||
cool-retro-term
|
||||
build
|
||||
|
||||
# Linux
|
||||
|
||||
*.AppImage
|
||||
|
||||
# Mac OSX
|
||||
|
||||
.DS_Store
|
||||
*.app
|
||||
*.dmg
|
||||
|
||||
37
.travis.yml
37
.travis.yml
@@ -1,37 +0,0 @@
|
||||
sudo: required
|
||||
dist: trusty
|
||||
language: c++
|
||||
|
||||
install:
|
||||
- sudo add-apt-repository -y ppa:beineri/opt-qt58-trusty
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get -y install build-essential qt58declarative qt58graphicaleffects qt58quickcontrols libgl1-mesa-dev
|
||||
- source /opt/qt*/bin/qt*-env.sh
|
||||
|
||||
script:
|
||||
- qmake CONFIG+=release PREFIX=/usr
|
||||
- make -j$(nproc)
|
||||
- mkdir -p appdir/usr/share/metainfo appdir/usr/bin
|
||||
- cp packaging/appdata/cool-retro-term.appdata.xml appdir/usr/share/metainfo/
|
||||
- cp cool-retro-term appdir/usr/bin/
|
||||
- cp ./cool-retro-term.desktop appdir/
|
||||
- cp ./app/icons/128x128/cool-retro-term.png appdir/
|
||||
- cp -r ./app/qml appdir/usr/
|
||||
- cp -r ./qmltermwidget/QMLTermWidget appdir/usr/qml/ # Workaround for https://github.com/probonopd/linuxdeployqt/issues/78
|
||||
- wget -c https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
|
||||
- chmod a+x linuxdeployqt-*.AppImage
|
||||
- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
|
||||
- export VERSION=$(git rev-parse --short HEAD) # linuxdeployqt uses this for naming the file
|
||||
- ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ # -verbose=3 2>&1 | grep "path:" -C 3
|
||||
- ./linuxdeployqt-*.AppImage appdir/usr/bin/cool-retro-term -qmldir=./app/qml/ -qmldir=./qmltermwidget/ -verbose=2 -appimage
|
||||
|
||||
after_success:
|
||||
- find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
|
||||
- # curl --upload-file Cool*.AppImage https://transfer.sh/Cool_Retro_Term-git.$(git rev-parse --short HEAD)-x86_64.AppImage
|
||||
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
||||
- bash upload.sh Cool*.AppImage*
|
||||
|
||||
branches:
|
||||
except:
|
||||
- # Do not build tags that we create when we upload to GitHub Releases
|
||||
- /^(?i:continuous)/
|
||||
@@ -10,7 +10,7 @@ It has been designed to be eye-candy, customizable, and reasonably lightweight.
|
||||
|
||||
It uses the QML port of qtermwidget (Konsole): https://github.com/Swordfish90/qmltermwidget.
|
||||
|
||||
This terminal emulator works under Linux and macOS and requires Qt5. It's suggested that you stick to the latest LTS version.
|
||||
This terminal emulator works under Linux and macOS and requires Qt6.
|
||||
|
||||
Settings such as colors, fonts, and effects can be accessed via context menu.
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
QT += qml quick widgets sql quickcontrols2
|
||||
TARGET = cool-retro-term
|
||||
APP_VERSION = $$system(git -C $$PWD/.. describe --tags --always --dirty=-dirty)
|
||||
isEmpty(APP_VERSION): APP_VERSION = "unknown"
|
||||
DEFINES += APP_VERSION=\\\"$$APP_VERSION\\\"
|
||||
|
||||
# TODO: When migrating to CMake, use KDSingleApplication's CMakeLists.txt instead of these manual sources.
|
||||
INCLUDEPATH += $$PWD/../KDSingleApplication/src
|
||||
|
||||
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString appVersion("1.2.0");
|
||||
QString appVersion(QStringLiteral(APP_VERSION));
|
||||
|
||||
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
|
||||
QTextStream cout(stdout, QIODevice::WriteOnly);
|
||||
@@ -86,6 +86,7 @@ int main(int argc, char *argv[])
|
||||
app.setApplicationName(QStringLiteral("cool-retro-term"));
|
||||
app.setOrganizationName(QStringLiteral("cool-retro-term"));
|
||||
app.setOrganizationDomain(QStringLiteral("cool-retro-term"));
|
||||
app.setApplicationVersion(appVersion);
|
||||
|
||||
KDSingleApplication singleApp(QStringLiteral("cool-retro-term"));
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ QtObject {
|
||||
property bool isMacOS: Qt.platform.os === "osx"
|
||||
|
||||
// GENERAL SETTINGS ///////////////////////////////////////////////////////
|
||||
property bool fullscreen: false
|
||||
property bool showMenubar: false
|
||||
|
||||
property bool showTerminalSize: true
|
||||
@@ -86,7 +85,7 @@ QtObject {
|
||||
property real horizontalSync: 0.08
|
||||
property real flickering: 0.1
|
||||
|
||||
property real rbgShift: 0.0
|
||||
property real rgbShift: 0.0
|
||||
|
||||
property real _frameShininess: 0.2
|
||||
property real frameShininess: _frameShininess * 0.5
|
||||
@@ -188,7 +187,7 @@ QtObject {
|
||||
"bloom": bloom,
|
||||
"rasterization": rasterization,
|
||||
"jitter": jitter,
|
||||
"rbgShift": rbgShift,
|
||||
"rgbShift": rgbShift,
|
||||
"brightness": brightness,
|
||||
"contrast": contrast,
|
||||
"ambientLight": ambientLight,
|
||||
@@ -289,7 +288,7 @@ QtObject {
|
||||
|
||||
jitter = settings.jitter !== undefined ? settings.jitter : jitter
|
||||
|
||||
rbgShift = settings.rbgShift !== undefined ? settings.rbgShift : rbgShift
|
||||
rgbShift = settings.rgbShift !== undefined ? settings.rgbShift : rgbShift
|
||||
|
||||
ambientLight = settings.ambientLight !== undefined ? settings.ambientLight : ambientLight
|
||||
contrast = settings.contrast !== undefined ? settings.contrast : contrast
|
||||
@@ -384,9 +383,9 @@ QtObject {
|
||||
"horizontalSync": 0.1,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0,
|
||||
"rgbShift": 0,
|
||||
"saturationColor": 0.2,
|
||||
"screenCurvature": 0.4,
|
||||
"screenCurvature": 0.2,
|
||||
"screenRadius": 0.1,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
@@ -410,7 +409,7 @@ QtObject {
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#0ccc68",
|
||||
"fontName": "EXCELSIOR_SCALED",
|
||||
"fontName": "DEPARTURE_MONO_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
@@ -418,9 +417,9 @@ QtObject {
|
||||
"horizontalSync": 0.1,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0,
|
||||
"rgbShift": 0,
|
||||
"saturationColor": 0.0,
|
||||
"screenCurvature": 0.7,
|
||||
"screenCurvature": 0.3,
|
||||
"screenRadius": 0.2,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
@@ -444,7 +443,7 @@ QtObject {
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#7fb4ff",
|
||||
"fontName": "COZETTE_SCALED",
|
||||
"fontName": "BIGBLUE_TERMINAL_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
@@ -452,9 +451,9 @@ QtObject {
|
||||
"horizontalSync": 0.1,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0,
|
||||
"rgbShift": 0,
|
||||
"saturationColor": 0.2,
|
||||
"screenCurvature": 1.0,
|
||||
"screenCurvature": 0.4,
|
||||
"screenRadius": 0.1,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
@@ -486,7 +485,7 @@ QtObject {
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0,
|
||||
"rgbShift": 0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.5,
|
||||
"screenRadius": 0.1,
|
||||
@@ -495,7 +494,7 @@ QtObject {
|
||||
"margin": 0.3,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.5,
|
||||
"frameColor": "#444444",
|
||||
"frameColor": "#999999",
|
||||
"frameShininess": 0.0
|
||||
}'
|
||||
builtin: true
|
||||
@@ -520,15 +519,15 @@ QtObject {
|
||||
"horizontalSync": 0.2,
|
||||
"jitter": 0.15,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.1,
|
||||
"rgbShift": 0.0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 1.0,
|
||||
"screenCurvature": 0.7,
|
||||
"screenRadius": 0.3,
|
||||
"staticNoise": 0.2,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.2,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.8,
|
||||
"frameSize": 0.5,
|
||||
"frameColor": "#000000",
|
||||
"frameShininess": 0.6
|
||||
}'
|
||||
@@ -554,15 +553,15 @@ QtObject {
|
||||
"horizontalSync": 0.2,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.1,
|
||||
"rgbShift": 0.0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 1.0,
|
||||
"screenCurvature": 0.5,
|
||||
"screenRadius": 0.3,
|
||||
"staticNoise": 0.2,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.0,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.5,
|
||||
"frameSize": 0.2,
|
||||
"frameColor": "#ffffff",
|
||||
"frameShininess": 0.8
|
||||
}'
|
||||
@@ -588,9 +587,9 @@ QtObject {
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.0,
|
||||
"rgbShift": 0.0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.3,
|
||||
"screenCurvature": 0.4,
|
||||
"screenRadius": 0.2,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
@@ -622,7 +621,7 @@ QtObject {
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.15,
|
||||
"rgbShift": 0.1,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.3,
|
||||
"screenRadius": 0.1,
|
||||
@@ -637,13 +636,13 @@ QtObject {
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "IBM 3278"
|
||||
text: "IBM 3278 Reborn"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.2,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.2,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.7,
|
||||
"burnIn": 0.5,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0,
|
||||
@@ -656,7 +655,7 @@ QtObject {
|
||||
"horizontalSync": 0,
|
||||
"jitter": 0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0,
|
||||
"rgbShift": 0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
@@ -690,7 +689,7 @@ QtObject {
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.1,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0.0,
|
||||
"rgbShift": 0.0,
|
||||
"saturationColor": 0.6,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
@@ -724,7 +723,7 @@ QtObject {
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0.1,
|
||||
"rgbShift": 0.0,
|
||||
"saturationColor": 0.0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
@@ -758,7 +757,7 @@ QtObject {
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.1,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0.1,
|
||||
"rgbShift": 0.1,
|
||||
"saturationColor": 0.8,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
@@ -792,7 +791,7 @@ QtObject {
|
||||
"horizontalSync": 0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0,
|
||||
"rgbShift": 0,
|
||||
"saturationColor": 0.0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
@@ -826,7 +825,7 @@ QtObject {
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0,
|
||||
"rgbShift": 0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
@@ -864,17 +863,12 @@ QtObject {
|
||||
|
||||
var profileArgPosition = args.indexOf("--profile")
|
||||
if (profileArgPosition !== -1) {
|
||||
var profileIndex = getProfileIndexByName(
|
||||
args[profileArgPosition + 1])
|
||||
if (profileIndex !== -1)
|
||||
var profileIndex = getProfileIndexByName(args[profileArgPosition + 1])
|
||||
if (profileIndex !== -1) {
|
||||
loadProfile(profileIndex)
|
||||
else
|
||||
} else {
|
||||
console.log("Warning: selected profile is not valid; ignoring it")
|
||||
}
|
||||
|
||||
if (args.indexOf("--fullscreen") !== -1) {
|
||||
fullscreen = true
|
||||
showMenubar = false
|
||||
}
|
||||
}
|
||||
|
||||
initializedSettings()
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
import QMLTermWidget 1.0
|
||||
import QMLTermWidget 2.0
|
||||
|
||||
import "menus"
|
||||
import "utils.js" as Utils
|
||||
@@ -141,6 +141,7 @@ Item{
|
||||
kterminal.antialiasText = !lowResolutionFont;
|
||||
kterminal.smooth = !lowResolutionFont;
|
||||
kterminal.enableBold = !lowResolutionFont;
|
||||
kterminal.enableItalic = !lowResolutionFont;
|
||||
|
||||
kterminal.font = Qt.font({
|
||||
family: fontFamily,
|
||||
@@ -185,6 +186,9 @@ Item{
|
||||
appSettings.fontManager.refresh()
|
||||
startSession();
|
||||
}
|
||||
Component.onDestruction: {
|
||||
appSettings.fontManager.terminalFontChanged.disconnect(handleFontChanged);
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
@@ -199,7 +203,7 @@ Item{
|
||||
|
||||
Loader {
|
||||
id: menuLoader
|
||||
sourceComponent: (appSettings.isMacOS || appSettings.showMenubar ? shortContextMenu : fullContextMenu)
|
||||
sourceComponent: (appSettings.isMacOS || (appSettings.showMenubar && !terminalWindow.fullscreen) ? shortContextMenu : fullContextMenu)
|
||||
}
|
||||
property alias contextmenu: menuLoader.item
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ ColumnLayout {
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
title: qsTr("Command")
|
||||
title: qsTr("Miscellaneous")
|
||||
padding: appSettings.defaultMargin
|
||||
|
||||
ColumnLayout {
|
||||
@@ -39,12 +39,6 @@ ColumnLayout {
|
||||
checked: appSettings.useCustomCommand
|
||||
onCheckedChanged: appSettings.useCustomCommand = checked
|
||||
}
|
||||
// Workaround for QTBUG-31627 for pre 5.3.0
|
||||
Binding {
|
||||
target: useCustomCommand
|
||||
property: "checked"
|
||||
value: appSettings.useCustomCommand
|
||||
}
|
||||
TextField {
|
||||
id: customCommand
|
||||
Layout.fillWidth: true
|
||||
@@ -59,26 +53,18 @@ ColumnLayout {
|
||||
Component.onCompleted: settings_window.closing.connect(
|
||||
saveSetting)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Cursor")
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: appSettings.defaultMargin
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
CheckBox {
|
||||
id: blinkingCursor
|
||||
text: qsTr("Blinking Cursor")
|
||||
checked: appSettings.blinkingCursor
|
||||
onCheckedChanged: appSettings.blinkingCursor = checked
|
||||
}
|
||||
Binding {
|
||||
target: blinkingCursor
|
||||
property: "checked"
|
||||
value: appSettings.blinkingCursor
|
||||
CheckBox {
|
||||
id: showMenubar
|
||||
text: qsTr("Show Menubar")
|
||||
enabled: !appSettings.isMacOS
|
||||
checked: appSettings.showMenubar
|
||||
onCheckedChanged: appSettings.showMenubar = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ ColumnLayout {
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("RGB Shift")
|
||||
onNewValue: function(newValue) { appSettings.rbgShift = newValue }
|
||||
value: appSettings.rbgShift
|
||||
onNewValue: function(newValue) { appSettings.rgbShift = newValue }
|
||||
value: appSettings.rgbShift
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Frame Shininess")
|
||||
|
||||
@@ -36,7 +36,7 @@ Item {
|
||||
}
|
||||
|
||||
function staticFragmentPath() {
|
||||
var rgbShiftOn = appSettings.rbgShift > 0 ? 1 : 0;
|
||||
var rgbShiftOn = appSettings.rgbShift > 0 ? 1 : 0;
|
||||
var bloomOn = appSettings.bloom > 0 ? 1 : 0;
|
||||
var curvatureOn = (appSettings.screenCurvature > 0 || appSettings.frameSize > 0) ? 1 : 0;
|
||||
var shineOn = appSettings.frameShininess > 0 ? 1 : 0;
|
||||
@@ -176,7 +176,7 @@ Item {
|
||||
|
||||
property real chromaColor: appSettings.chromaColor;
|
||||
|
||||
property real rbgShift: (appSettings.rbgShift / width) * appSettings.totalFontScaling
|
||||
property real rgbShift: appSettings.rgbShift * (4.0 / width) * appSettings.totalFontScaling
|
||||
|
||||
property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
|
||||
property real frameShininess: appSettings.frameShininess
|
||||
|
||||
@@ -21,15 +21,13 @@ import QtQuick 2.2
|
||||
|
||||
Rectangle {
|
||||
property size terminalSize
|
||||
property real topOpacity: 0.6
|
||||
property real topOpacity: 0.5
|
||||
|
||||
width: textSize.width * 2
|
||||
height: textSize.height * 2
|
||||
radius: 5
|
||||
border.width: 2
|
||||
border.color: "white"
|
||||
color: "black"
|
||||
opacity: sizetimer.running ? 0.6 : 0.0
|
||||
opacity: sizetimer.running ? 0.5 : 0.0
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
|
||||
@@ -18,19 +18,18 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQml.Models
|
||||
|
||||
Item {
|
||||
id: tabsRoot
|
||||
|
||||
readonly property string currentTitle: tabsModel.count > 0
|
||||
? (tabsModel.get(currentIndex).title ?? "cool-retro-term")
|
||||
: "cool-retro-term"
|
||||
readonly property size terminalSize: stack.currentItem ? stack.currentItem.terminalSize : Qt.size(0, 0)
|
||||
property int currentIndex: 0
|
||||
readonly property int innerPadding: 6
|
||||
readonly property string currentTitle: tabsModel.get(currentIndex).title ?? "cool-retro-term"
|
||||
property alias currentIndex: tabBar.currentIndex
|
||||
readonly property int count: tabsModel.count
|
||||
property var hostWindow
|
||||
property alias tabsModel: tabsModel
|
||||
property size terminalSize: Qt.size(0, 0)
|
||||
|
||||
function normalizeTitle(rawTitle) {
|
||||
if (rawTitle === undefined || rawTitle === null) {
|
||||
@@ -41,17 +40,17 @@ Item {
|
||||
|
||||
function addTab() {
|
||||
tabsModel.append({ title: "" })
|
||||
currentIndex = tabsModel.count - 1
|
||||
tabBar.currentIndex = tabsModel.count - 1
|
||||
}
|
||||
|
||||
function closeTab(index) {
|
||||
if (tabsModel.count <= 1) {
|
||||
hostWindow.close()
|
||||
terminalWindow.close()
|
||||
return
|
||||
}
|
||||
|
||||
tabsModel.remove(index)
|
||||
currentIndex = Math.min(currentIndex, tabsModel.count - 1)
|
||||
tabBar.currentIndex = Math.min(tabBar.currentIndex, tabsModel.count - 1)
|
||||
}
|
||||
|
||||
ListModel {
|
||||
@@ -64,11 +63,69 @@ Item {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
Rectangle {
|
||||
id: tabRow
|
||||
Layout.fillWidth: true
|
||||
height: rowLayout.implicitHeight
|
||||
color: palette.window
|
||||
visible: tabsModel.count > 1
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
TabBar {
|
||||
id: tabBar
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
focusPolicy: Qt.NoFocus
|
||||
|
||||
Repeater {
|
||||
model: tabsModel
|
||||
TabButton {
|
||||
id: tabButton
|
||||
contentItem: RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors { leftMargin: innerPadding; rightMargin: innerPadding }
|
||||
spacing: innerPadding
|
||||
|
||||
Label {
|
||||
text: model.title
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: "\u00d7"
|
||||
focusPolicy: Qt.NoFocus
|
||||
padding: innerPadding
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: tabsRoot.closeTab(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: addTabButton
|
||||
text: "+"
|
||||
focusPolicy: Qt.NoFocus
|
||||
Layout.fillHeight: true
|
||||
padding: innerPadding
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: tabsRoot.addTab()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
id: stack
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
currentIndex: tabsRoot.currentIndex
|
||||
currentIndex: tabBar.currentIndex
|
||||
|
||||
Repeater {
|
||||
model: tabsModel
|
||||
@@ -83,6 +140,14 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
onSessionFinished: tabsRoot.closeTab(index)
|
||||
onTerminalSizeChanged: updateTerminalSize()
|
||||
|
||||
function updateTerminalSize() {
|
||||
// Every tab will have the same size so we can simply take the first one.
|
||||
if (index == 0) {
|
||||
tabsRoot.terminalSize = terminalSize
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
|
||||
* https://github.com/Swordfish90/cool-retro-term
|
||||
*
|
||||
* This file is part of cool-retro-term.
|
||||
*
|
||||
* cool-retro-term is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
|
||||
Item {
|
||||
id: barRoot
|
||||
|
||||
readonly property int innerPadding: 6
|
||||
readonly property int leftInset: (isMacOS && !showWindowControls) ? 72 : 0
|
||||
property var tabsController
|
||||
property var hostWindow
|
||||
property bool isMacOS: false
|
||||
property bool showWindowControls: true
|
||||
property bool windowControlsOnLeft: false
|
||||
property bool enableSystemMove: true
|
||||
property bool enableDoubleClickMaximize: true
|
||||
|
||||
implicitHeight: rowLayout.implicitHeight
|
||||
|
||||
function toggleMaximize() {
|
||||
if (!hostWindow) {
|
||||
return
|
||||
}
|
||||
hostWindow.visibility = (hostWindow.visibility === Window.Maximized)
|
||||
? Window.Windowed
|
||||
: Window.Maximized
|
||||
}
|
||||
|
||||
onTabsControllerChanged: {
|
||||
if (tabsController) {
|
||||
tabBar.currentIndex = tabsController.currentIndex
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (tabsController) {
|
||||
tabBar.currentIndex = tabsController.currentIndex
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: palette.window
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: leftInset
|
||||
visible: leftInset > 0
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: showWindowControls && windowControlsOnLeft
|
||||
sourceComponent: windowControlsComponent
|
||||
}
|
||||
|
||||
TabBar {
|
||||
id: tabBar
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
focusPolicy: Qt.NoFocus
|
||||
|
||||
onCurrentIndexChanged: {
|
||||
if (tabsController && tabsController.currentIndex !== currentIndex) {
|
||||
tabsController.currentIndex = currentIndex
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: tabsController ? tabsController.tabsModel : null
|
||||
TabButton {
|
||||
id: tabButton
|
||||
contentItem: RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors { leftMargin: innerPadding; rightMargin: innerPadding }
|
||||
spacing: innerPadding
|
||||
|
||||
Label {
|
||||
text: model.title
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: "\u00d7"
|
||||
focusPolicy: Qt.NoFocus
|
||||
padding: innerPadding
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: {
|
||||
if (tabsController) {
|
||||
tabsController.closeTab(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
id: addTabButton
|
||||
text: "+"
|
||||
focusPolicy: Qt.NoFocus
|
||||
Layout.fillHeight: true
|
||||
padding: innerPadding
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: {
|
||||
if (tabsController) {
|
||||
tabsController.addTab()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: showWindowControls && !windowControlsOnLeft
|
||||
sourceComponent: windowControlsComponent
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: windowControlsComponent
|
||||
RowLayout {
|
||||
id: windowControls
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
spacing: 0
|
||||
|
||||
ToolButton {
|
||||
text: "\u2212"
|
||||
focusPolicy: Qt.NoFocus
|
||||
padding: innerPadding
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: {
|
||||
if (hostWindow) {
|
||||
hostWindow.visibility = Window.Minimized
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: hostWindow && hostWindow.visibility === Window.Maximized ? "\u2752" : "\u25a1"
|
||||
focusPolicy: Qt.NoFocus
|
||||
padding: innerPadding
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: toggleMaximize()
|
||||
}
|
||||
|
||||
ToolButton {
|
||||
text: "\u00d7"
|
||||
focusPolicy: Qt.NoFocus
|
||||
padding: innerPadding
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
onClicked: {
|
||||
if (hostWindow) {
|
||||
hostWindow.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: tabsController
|
||||
function onCurrentIndexChanged() {
|
||||
if (tabBar.currentIndex !== tabsController.currentIndex) {
|
||||
tabBar.currentIndex = tabsController.currentIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DragHandler {
|
||||
acceptedDevices: PointerDevice.Mouse
|
||||
acceptedButtons: Qt.LeftButton
|
||||
grabPermissions: PointerHandler.CanTakeOverFromItems
|
||||
target: null
|
||||
onActiveChanged: {
|
||||
if (active && hostWindow && enableSystemMove) {
|
||||
hostWindow.startSystemMove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: {
|
||||
if (tapCount === 2 && enableDoubleClickMaximize) {
|
||||
toggleMaximize()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts
|
||||
|
||||
import "menus"
|
||||
|
||||
@@ -40,24 +39,10 @@ ApplicationWindow {
|
||||
|
||||
visible: false
|
||||
|
||||
flags: Qt.Window | Qt.FramelessWindowHint
|
||||
|
||||
property bool fullscreen: appSettings.fullscreen
|
||||
property bool fullscreen: false
|
||||
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
|
||||
|
||||
menuBar: qtquickMenuLoader.item
|
||||
|
||||
Loader {
|
||||
id: qtquickMenuLoader
|
||||
active: !appSettings.isMacOS && appSettings.showMenubar
|
||||
sourceComponent: WindowMenu { }
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: globalMenuLoader
|
||||
active: appSettings.isMacOS
|
||||
sourceComponent: OSXMenu { }
|
||||
}
|
||||
menuBar: WindowMenu { }
|
||||
|
||||
property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height))
|
||||
|
||||
@@ -65,35 +50,26 @@ ApplicationWindow {
|
||||
|
||||
title: terminalTabs.currentTitle
|
||||
|
||||
Action {
|
||||
id: showMenubarAction
|
||||
text: qsTr("Show Menubar")
|
||||
enabled: !appSettings.isMacOS
|
||||
shortcut: "Ctrl+Shift+M"
|
||||
checkable: true
|
||||
checked: appSettings.showMenubar
|
||||
onTriggered: appSettings.showMenubar = !appSettings.showMenubar
|
||||
}
|
||||
Action {
|
||||
id: fullscreenAction
|
||||
text: qsTr("Fullscreen")
|
||||
enabled: !appSettings.isMacOS
|
||||
shortcut: "Alt+F11"
|
||||
onTriggered: appSettings.fullscreen = !appSettings.fullscreen
|
||||
shortcut: StandardKey.FullScreen
|
||||
onTriggered: fullscreen = !fullscreen
|
||||
checkable: true
|
||||
checked: appSettings.fullscreen
|
||||
checked: fullscreen
|
||||
}
|
||||
Action {
|
||||
id: newWindowAction
|
||||
text: qsTr("New Window")
|
||||
shortcut: "Ctrl+Shift+N"
|
||||
shortcut: appSettings.isMacOS ? "Meta+N" : "Ctrl+Shift+N"
|
||||
onTriggered: appRoot.createWindow()
|
||||
}
|
||||
Action {
|
||||
id: quitAction
|
||||
text: qsTr("Quit")
|
||||
shortcut: "Ctrl+Shift+Q"
|
||||
onTriggered: appSettings.close()
|
||||
shortcut: appSettings.isMacOS ? StandardKey.Close : "Ctrl+Shift+Q"
|
||||
onTriggered: terminalWindow.close()
|
||||
}
|
||||
Action {
|
||||
id: showsettingsAction
|
||||
@@ -107,23 +83,23 @@ ApplicationWindow {
|
||||
Action {
|
||||
id: copyAction
|
||||
text: qsTr("Copy")
|
||||
shortcut: "Ctrl+Shift+C"
|
||||
shortcut: appSettings.isMacOS ? StandardKey.Copy : "Ctrl+Shift+C"
|
||||
}
|
||||
Action {
|
||||
id: pasteAction
|
||||
text: qsTr("Paste")
|
||||
shortcut: "Ctrl+Shift+V"
|
||||
shortcut: appSettings.isMacOS ? StandardKey.Paste : "Ctrl+Shift+V"
|
||||
}
|
||||
Action {
|
||||
id: zoomIn
|
||||
text: qsTr("Zoom In")
|
||||
shortcut: "Ctrl++"
|
||||
shortcut: StandardKey.ZoomIn
|
||||
onTriggered: appSettings.incrementScaling()
|
||||
}
|
||||
Action {
|
||||
id: zoomOut
|
||||
text: qsTr("Zoom Out")
|
||||
shortcut: "Ctrl+-"
|
||||
shortcut: StandardKey.ZoomOut
|
||||
onTriggered: appSettings.decrementScaling()
|
||||
}
|
||||
Action {
|
||||
@@ -138,29 +114,13 @@ ApplicationWindow {
|
||||
Action {
|
||||
id: newTabAction
|
||||
text: qsTr("New Tab")
|
||||
shortcut: appSettings.isMacOS ? StandardKey.AddTab : "Ctrl+Shift+T"
|
||||
onTriggered: terminalTabs.addTab()
|
||||
}
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
TerminalTabsBar {
|
||||
Layout.fillWidth: true
|
||||
tabsController: terminalTabs
|
||||
hostWindow: terminalWindow
|
||||
isMacOS: appSettings.isMacOS
|
||||
showWindowControls: true
|
||||
windowControlsOnLeft: appSettings.isMacOS
|
||||
enableSystemMove: true
|
||||
enableDoubleClickMaximize: true
|
||||
}
|
||||
|
||||
TerminalTabs {
|
||||
id: terminalTabs
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
hostWindow: terminalWindow
|
||||
}
|
||||
TerminalTabs {
|
||||
id: terminalTabs
|
||||
width: parent.width
|
||||
height: (parent.height + Math.abs(y))
|
||||
}
|
||||
Loader {
|
||||
anchors.centerIn: parent
|
||||
@@ -170,77 +130,6 @@ ApplicationWindow {
|
||||
terminalSize: terminalTabs.terminalSize
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: resizeHandles
|
||||
anchors.fill: parent
|
||||
visible: true
|
||||
property int resizeMargin: 6
|
||||
|
||||
MouseArea {
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
width: resizeHandles.resizeMargin
|
||||
cursorShape: Qt.SizeHorCursor
|
||||
onPressed: terminalWindow.startSystemResize(Qt.LeftEdge)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
width: resizeHandles.resizeMargin
|
||||
cursorShape: Qt.SizeHorCursor
|
||||
onPressed: terminalWindow.startSystemResize(Qt.RightEdge)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: resizeHandles.resizeMargin
|
||||
cursorShape: Qt.SizeVerCursor
|
||||
onPressed: terminalWindow.startSystemResize(Qt.BottomEdge)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
width: resizeHandles.resizeMargin
|
||||
height: resizeHandles.resizeMargin
|
||||
cursorShape: Qt.SizeFDiagCursor
|
||||
onPressed: terminalWindow.startSystemResize(Qt.TopEdge | Qt.LeftEdge)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
width: resizeHandles.resizeMargin
|
||||
height: resizeHandles.resizeMargin
|
||||
cursorShape: Qt.SizeBDiagCursor
|
||||
onPressed: terminalWindow.startSystemResize(Qt.TopEdge | Qt.RightEdge)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
width: resizeHandles.resizeMargin
|
||||
height: resizeHandles.resizeMargin
|
||||
cursorShape: Qt.SizeBDiagCursor
|
||||
onPressed: terminalWindow.startSystemResize(Qt.BottomEdge | Qt.LeftEdge)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
width: resizeHandles.resizeMargin
|
||||
height: resizeHandles.resizeMargin
|
||||
cursorShape: Qt.SizeFDiagCursor
|
||||
onPressed: terminalWindow.startSystemResize(Qt.BottomEdge | Qt.RightEdge)
|
||||
}
|
||||
}
|
||||
|
||||
onClosing: {
|
||||
appRoot.closeWindow(terminalWindow)
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*******************************************************************************/
|
||||
import QtQuick 2.2
|
||||
|
||||
import "menus"
|
||||
|
||||
QtObject {
|
||||
id: appRoot
|
||||
|
||||
@@ -34,19 +36,18 @@ QtObject {
|
||||
visible: false
|
||||
}
|
||||
|
||||
property AboutDialog aboutWindow: AboutDialog {
|
||||
property AboutDialog aboutDialog: AboutDialog {
|
||||
visible: false
|
||||
}
|
||||
|
||||
property Component windowComponent: Component {
|
||||
TerminalWindow { }
|
||||
}
|
||||
|
||||
property ListModel windowsModel: ListModel { }
|
||||
|
||||
function createWindow() {
|
||||
var component = Qt.createComponent("TerminalWindow.qml")
|
||||
if (component.status === Component.Error) {
|
||||
console.error(component.errorString())
|
||||
return
|
||||
}
|
||||
var window = component.createObject(null)
|
||||
var window = windowComponent.createObject(null)
|
||||
if (!window)
|
||||
return
|
||||
|
||||
@@ -66,8 +67,6 @@ QtObject {
|
||||
window.destroy()
|
||||
|
||||
if (windowsModel.count === 0) {
|
||||
settingsWindow.close()
|
||||
aboutWindow.close()
|
||||
appSettings.close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,10 +64,6 @@ Menu {
|
||||
action: fullscreenAction
|
||||
visible: fullscreenAction.enabled
|
||||
}
|
||||
MenuItem {
|
||||
action: showMenubarAction
|
||||
visible: showMenubarAction.enabled
|
||||
}
|
||||
MenuItem {
|
||||
action: zoomIn
|
||||
}
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2013-2021 "Filippo Scognamiglio"
|
||||
* https://github.com/Swordfish90/cool-retro-term
|
||||
*
|
||||
* This file is part of cool-retro-term.
|
||||
*
|
||||
* cool-retro-term is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
|
||||
import QtQuick 2.3
|
||||
import Qt.labs.platform 1.1
|
||||
|
||||
MenuBar {
|
||||
id: defaultMenuBar
|
||||
|
||||
Menu {
|
||||
title: qsTr("File")
|
||||
MenuItem {
|
||||
text: newWindowAction.text
|
||||
shortcut: newWindowAction.shortcut
|
||||
onTriggered: newWindowAction.trigger()
|
||||
}
|
||||
MenuItem {
|
||||
text: newTabAction.text
|
||||
shortcut: newTabAction.shortcut
|
||||
onTriggered: newTabAction.trigger()
|
||||
}
|
||||
MenuSeparator {}
|
||||
MenuItem {
|
||||
text: quitAction.text
|
||||
onTriggered: quitAction.trigger()
|
||||
}
|
||||
}
|
||||
Menu {
|
||||
title: qsTr("Edit")
|
||||
MenuItem {
|
||||
text: copyAction.text
|
||||
shortcut: "Meta+C"
|
||||
onTriggered: copyAction.trigger()
|
||||
}
|
||||
MenuItem {
|
||||
text: pasteAction.text
|
||||
shortcut: "Meta+V"
|
||||
onTriggered: pasteAction.trigger()
|
||||
}
|
||||
MenuSeparator {}
|
||||
MenuItem {
|
||||
text: showsettingsAction.text
|
||||
shortcut: showsettingsAction.shortcut
|
||||
onTriggered: showsettingsAction.trigger()
|
||||
}
|
||||
}
|
||||
Menu {
|
||||
title: qsTr("View")
|
||||
MenuItem {
|
||||
text: zoomIn.text
|
||||
shortcut: "Meta++"
|
||||
onTriggered: zoomIn.trigger()
|
||||
}
|
||||
MenuItem {
|
||||
text: zoomOut.text
|
||||
shortcut: "Meta+-"
|
||||
onTriggered: zoomOut.trigger()
|
||||
}
|
||||
}
|
||||
Menu {
|
||||
id: profilesMenu
|
||||
title: qsTr("Profiles")
|
||||
Instantiator {
|
||||
model: appSettings.profilesList
|
||||
delegate: MenuItem {
|
||||
text: model.text
|
||||
onTriggered: {
|
||||
appSettings.loadProfileString(obj_string)
|
||||
}
|
||||
}
|
||||
onObjectAdded: function(index, object) { profilesMenu.insertItem(index, object) }
|
||||
onObjectRemoved: function(object) { profilesMenu.removeItem(object) }
|
||||
}
|
||||
}
|
||||
Menu {
|
||||
title: qsTr("Help")
|
||||
MenuItem {
|
||||
text: showAboutAction.text
|
||||
onTriggered: showAboutAction.trigger()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,50 +22,33 @@ import QtQuick.Controls 2.3
|
||||
|
||||
MenuBar {
|
||||
id: defaultMenuBar
|
||||
visible: appSettings.showMenubar
|
||||
visible: appSettings.isMacOS || appSettings.showMenubar
|
||||
|
||||
Menu {
|
||||
title: qsTr("File")
|
||||
MenuItem {
|
||||
action: newWindowAction
|
||||
}
|
||||
MenuItem {
|
||||
action: newTabAction
|
||||
}
|
||||
MenuSeparator {}
|
||||
MenuItem {
|
||||
action: quitAction
|
||||
}
|
||||
MenuItem { action: newWindowAction }
|
||||
MenuItem { action: newTabAction }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: quitAction }
|
||||
}
|
||||
Menu {
|
||||
title: qsTr("Edit")
|
||||
MenuItem {
|
||||
action: copyAction
|
||||
}
|
||||
MenuItem {
|
||||
action: pasteAction
|
||||
}
|
||||
MenuItem { action: copyAction }
|
||||
MenuItem { action: pasteAction }
|
||||
MenuSeparator {}
|
||||
MenuItem {
|
||||
action: showsettingsAction
|
||||
}
|
||||
MenuItem { action: showsettingsAction }
|
||||
}
|
||||
Menu {
|
||||
id: viewMenu
|
||||
title: qsTr("View")
|
||||
MenuItem {
|
||||
action: fullscreenAction
|
||||
visible: fullscreenAction.enabled
|
||||
}
|
||||
MenuItem {
|
||||
action: showMenubarAction
|
||||
visible: showMenubarAction.enabled
|
||||
}
|
||||
MenuItem {
|
||||
action: zoomIn
|
||||
}
|
||||
MenuItem {
|
||||
action: zoomOut
|
||||
Instantiator {
|
||||
model: !appSettings.isMacOS ? 1 : 0
|
||||
delegate: MenuItem { action: fullscreenAction }
|
||||
onObjectAdded: (index, object) => viewMenu.insertItem(index, object)
|
||||
onObjectRemoved: (index, object) => viewMenu.removeItem(object)
|
||||
}
|
||||
MenuItem { action: zoomIn }
|
||||
MenuItem { action: zoomOut }
|
||||
}
|
||||
Menu {
|
||||
id: profilesMenu
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<file>SettingsAdvancedTab.qml</file>
|
||||
<file>TerminalContainer.qml</file>
|
||||
<file>TerminalTabs.qml</file>
|
||||
<file>TerminalTabsBar.qml</file>
|
||||
<file>images/crt256.png</file>
|
||||
<file>utils.js</file>
|
||||
<file>images/allNoise512.png</file>
|
||||
@@ -49,7 +48,6 @@
|
||||
<file>menus/WindowMenu.qml</file>
|
||||
<file>menus/FullContextMenu.qml</file>
|
||||
<file>menus/ShortContextMenu.qml</file>
|
||||
<file>menus/OSXMenu.qml</file>
|
||||
<file>../shaders/terminal_dynamic.vert.qsb</file>
|
||||
<file>../shaders/terminal_static.vert.qsb</file>
|
||||
<file>../shaders/terminal_frame.vert.qsb</file>
|
||||
|
||||
@@ -29,7 +29,7 @@ layout(std140, binding = 0) uniform ubuf {
|
||||
vec2 scaleNoiseSize;
|
||||
float screen_brightness;
|
||||
float bloom;
|
||||
float rbgShift;
|
||||
float rgbShift;
|
||||
float frameShadowCoeff;
|
||||
float frameShininess;
|
||||
vec4 frameColor;
|
||||
|
||||
@@ -20,7 +20,7 @@ layout(std140, binding = 0) uniform ubuf {
|
||||
mat4 qt_Matrix;
|
||||
float qt_Opacity;
|
||||
float screenCurvature;
|
||||
float rbgShift;
|
||||
float rgbShift;
|
||||
float frameShininess;
|
||||
float frameSize;
|
||||
float screen_brightness;
|
||||
@@ -59,7 +59,7 @@ void main() {
|
||||
vec3 txt_color = texture(source, txt_coords).rgb;
|
||||
|
||||
#if CRT_RGB_SHIFT == 1
|
||||
vec2 displacement = vec2(12.0, 0.0) * rbgShift;
|
||||
vec2 displacement = vec2(rgbShift, 0.0);
|
||||
vec3 rightColor = texture(source, txt_coords + displacement).rgb;
|
||||
vec3 leftColor = texture(source, txt_coords - displacement).rgb;
|
||||
txt_color.r = leftColor.r * 0.10 + rightColor.r * 0.30 + txt_color.r * 0.60;
|
||||
|
||||
@@ -7,7 +7,7 @@ layout(std140, binding = 0) uniform ubuf {
|
||||
mat4 qt_Matrix;
|
||||
float qt_Opacity;
|
||||
float screenCurvature;
|
||||
float rbgShift;
|
||||
float rgbShift;
|
||||
float frameShininess;
|
||||
float frameSize;
|
||||
float screen_brightness;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Submodule qmltermwidget updated: 7a5f3b68a5...d86ebbc396
83
scripts/build-appimage.sh
Executable file
83
scripts/build-appimage.sh
Executable file
@@ -0,0 +1,83 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
REPO_ROOT="$(readlink -f "$(dirname "$(dirname "$0")")")"
|
||||
OLD_CWD="$(readlink -f .)"
|
||||
BUILD_DIR="$REPO_ROOT/build/appimage"
|
||||
TOOLS_DIR="$BUILD_DIR/tools"
|
||||
VERSION="$(git -C "$REPO_ROOT" describe --tags --always --dirty=-dirty 2>/dev/null || true)"
|
||||
if [ -z "$VERSION" ]; then
|
||||
VERSION="unknown"
|
||||
fi
|
||||
|
||||
if ! command -v qmake >/dev/null; then
|
||||
echo "qmake not found in PATH." >&2
|
||||
exit 1
|
||||
fi
|
||||
QTDIR="$(qmake -query QT_INSTALL_PREFIX)"
|
||||
QT_INSTALL_QML="$(qmake -query QT_INSTALL_QML)"
|
||||
|
||||
APPDIR="$BUILD_DIR/AppDir"
|
||||
|
||||
mkdir -p "$BUILD_DIR"
|
||||
rm -rf "$APPDIR"
|
||||
pushd "$BUILD_DIR"
|
||||
|
||||
qmake "$REPO_ROOT/cool-retro-term.pro"
|
||||
make -j"$(nproc)"
|
||||
|
||||
# Install targets from subprojects (the top-level install only installs the desktop file).
|
||||
make -C app install INSTALL_ROOT="$APPDIR"
|
||||
make -C qmltermwidget install INSTALL_ROOT="$APPDIR"
|
||||
make install INSTALL_ROOT="$APPDIR"
|
||||
|
||||
popd
|
||||
|
||||
# Relocate QMLTermWidget into the standard AppDir QML import path.
|
||||
QML_ROOT="$APPDIR$QT_INSTALL_QML"
|
||||
if [ -d "$QML_ROOT" ]; then
|
||||
mkdir -p "$APPDIR/usr/qml"
|
||||
rsync -a "$QML_ROOT/" "$APPDIR/usr/qml/"
|
||||
rm -rf "$QML_ROOT"
|
||||
QML_PARENT="$(dirname "$QML_ROOT")"
|
||||
while [ "$QML_PARENT" != "$APPDIR" ] && rmdir "$QML_PARENT" 2>/dev/null; do
|
||||
QML_PARENT="$(dirname "$QML_PARENT")"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Build AppImage using linuxdeploy and linuxdeploy-plugin-qt.
|
||||
mkdir -p "$TOOLS_DIR"
|
||||
LINUXDEPLOY="$TOOLS_DIR/linuxdeploy-x86_64.AppImage"
|
||||
LINUXDEPLOY_QT="$TOOLS_DIR/linuxdeploy-plugin-qt-x86_64.AppImage"
|
||||
if [ ! -x "$LINUXDEPLOY" ]; then
|
||||
wget -c -O "$LINUXDEPLOY" https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
chmod +x "$LINUXDEPLOY"
|
||||
fi
|
||||
if [ ! -x "$LINUXDEPLOY_QT" ]; then
|
||||
wget -c -O "$LINUXDEPLOY_QT" https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
|
||||
chmod +x "$LINUXDEPLOY_QT"
|
||||
fi
|
||||
|
||||
export QML_SOURCES_PATHS="$REPO_ROOT/app"
|
||||
|
||||
pushd "$BUILD_DIR"
|
||||
|
||||
export EXTRA_PLATFORM_PLUGINS="libqwayland.so;"
|
||||
export EXTRA_QT_MODULES="sql;waylandcompositor;waylandclient"
|
||||
export DEPLOY_PLATFORM_THEMES=true
|
||||
export LINUXDEPLOY_EXCLUDED_LIBRARIES="libmysqlclient.so;libqsqlmimer.so;libqsqlmysql.so;libqsqlodbc.so;libqsqlpsql.so;libqsqloci.so;libqsqlibase.so"
|
||||
|
||||
"$LINUXDEPLOY" \
|
||||
--appdir "$APPDIR" \
|
||||
-e "$APPDIR/usr/bin/cool-retro-term" \
|
||||
-i "$REPO_ROOT/app/icons/256x256/cool-retro-term.png" \
|
||||
-d "$REPO_ROOT/cool-retro-term.desktop" \
|
||||
--plugin qt \
|
||||
--output appimage
|
||||
|
||||
APPIMAGE_PATH="$(ls -1 ./*.AppImage | head -n 1)"
|
||||
APPIMAGE_OUT="cool-retro-term-${VERSION}.AppImage"
|
||||
mv "$APPIMAGE_PATH" "$OLD_CWD/$APPIMAGE_OUT"
|
||||
popd
|
||||
47
scripts/build-dmg.sh
Executable file
47
scripts/build-dmg.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
OLD_CWD="$(pwd -P)"
|
||||
BUILD_DIR="$REPO_ROOT/build/dmg"
|
||||
APP="cool-retro-term.app"
|
||||
QML_DIR="$REPO_ROOT/app/qml"
|
||||
JOBS="${JOBS:-$(sysctl -n hw.ncpu 2>/dev/null || echo 4)}"
|
||||
VERSION="$(git -C "$REPO_ROOT" describe --tags --always --dirty=-dirty 2>/dev/null || true)"
|
||||
if [ -z "$VERSION" ]; then
|
||||
VERSION="unknown"
|
||||
fi
|
||||
|
||||
if ! command -v qmake >/dev/null; then
|
||||
echo "qmake not found in PATH." >&2
|
||||
exit 1
|
||||
fi
|
||||
QT_DIR="${QT_DIR:-$(qmake -query QT_INSTALL_PREFIX)}"
|
||||
QT_BIN="${QT_DIR%/}/bin"
|
||||
|
||||
mkdir -p "$BUILD_DIR"
|
||||
rm -f "$BUILD_DIR/${APP%.app}.dmg"
|
||||
pushd "$BUILD_DIR"
|
||||
|
||||
"$QT_BIN/qmake" CONFIG+=release "$REPO_ROOT/cool-retro-term.pro"
|
||||
make -j"$JOBS"
|
||||
|
||||
PLUGIN_DST="$APP/Contents/PlugIns/qmltermwidget"
|
||||
rm -rf "$PLUGIN_DST"
|
||||
mkdir -p "$APP/Contents/PlugIns"
|
||||
cp -R qmltermwidget/QMLTermWidget "$PLUGIN_DST"
|
||||
|
||||
export QML_IMPORT_PATH="$PWD/$APP/Contents/PlugIns"
|
||||
"$QT_BIN/macdeployqt" "$APP" -qmldir="$QML_DIR"
|
||||
|
||||
rm -f "$APP/Contents/PlugIns/sqldrivers/"libqsql{odbc,psql,mimer}.dylib 2>/dev/null || true
|
||||
|
||||
# Remove stale signatures and ad-hoc sign so Gatekeeper doesn't report corruption.
|
||||
codesign --remove-signature "$APP" 2>/dev/null || true
|
||||
rm -rf "$APP/Contents/_CodeSignature"
|
||||
codesign --force --deep --sign - "$APP"
|
||||
DMG_OUT="${APP%.app}-${VERSION}.dmg"
|
||||
hdiutil create -volname "${APP%.app}" -srcfolder "$APP" -ov -format UDZO "$DMG_OUT"
|
||||
mv "$BUILD_DIR/$DMG_OUT" "$OLD_CWD/$DMG_OUT"
|
||||
popd
|
||||
Reference in New Issue
Block a user