mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2026-02-08 08:42:22 +00:00
Compare commits
77 Commits
fix-qml-st
...
feature/cl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d34ce7f76 | ||
|
|
a0a16fc300 | ||
|
|
f99ccf97dc | ||
|
|
2d2749cb20 | ||
|
|
471ec29f5d | ||
|
|
56144f757d | ||
|
|
1c49b02763 | ||
|
|
60784c47d9 | ||
|
|
bd89df3564 | ||
|
|
b4e1077cb1 | ||
|
|
f518345430 | ||
|
|
f02c93c8c8 | ||
|
|
d10fe84c3a | ||
|
|
e9c818242e | ||
|
|
0bec01bfb4 | ||
|
|
9abe78ce5f | ||
|
|
f809041f85 | ||
|
|
f58710c76f | ||
|
|
267b39bc9d | ||
|
|
11ad932965 | ||
|
|
048cfcce81 | ||
|
|
33adf4106f | ||
|
|
a8ec5d6f16 | ||
|
|
384fb1da7c | ||
|
|
8e44e0f41a | ||
|
|
f851dd0a72 | ||
|
|
7038c02173 | ||
|
|
6747b8dd7c | ||
|
|
cf68aca735 | ||
|
|
265caf0df7 | ||
|
|
477621dd3e | ||
|
|
f77dad0c47 | ||
|
|
4faa6d522d | ||
|
|
ef11a4b7ef | ||
|
|
3bcf11264b | ||
|
|
68af947687 | ||
|
|
002c85e35f | ||
|
|
fed2bf21fe | ||
|
|
3f51308057 | ||
|
|
70d7d1b9ce | ||
|
|
c1082f2e3e | ||
|
|
7038b30381 | ||
|
|
1d73abda51 | ||
|
|
f157648d1e | ||
|
|
d4baaeccfc | ||
|
|
d412b66c6e | ||
|
|
74ae511f92 | ||
|
|
a3fbafe4ae | ||
|
|
8a45fbe9ed | ||
|
|
01c7929ee3 | ||
|
|
2261af17d7 | ||
|
|
41f34c3992 | ||
|
|
36b1cd2dde | ||
|
|
80374b3ec6 | ||
|
|
bc00d1e45f | ||
|
|
6ddb507247 | ||
|
|
b0f3b8f3d0 | ||
|
|
06e7191056 | ||
|
|
997131ba64 | ||
|
|
ef9f412e5f | ||
|
|
7b69d41c60 | ||
|
|
552947f507 | ||
|
|
f69f2df63c | ||
|
|
aa270067f6 | ||
|
|
28977313da | ||
|
|
cfe35d7795 | ||
|
|
4abbe332db | ||
|
|
3104abd4ad | ||
|
|
7714f7b503 | ||
|
|
9d06f10a9b | ||
|
|
8c27f7683b | ||
|
|
bf1a491789 | ||
|
|
0f18a0349a | ||
|
|
39181f42cf | ||
|
|
3d706ad1a7 | ||
|
|
a31b77e5bc | ||
|
|
b417643415 |
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
patreon: swordfish90
|
||||
custom: ['https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=flscogna%40gmail.com&item_name=Support+CRT¤cy_code=EUR&source=url']
|
||||
98
.github/workflows/appimage.yml
vendored
Normal file
98
.github/workflows/appimage.yml
vendored
Normal 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
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -43,6 +43,7 @@ Makefile*
|
||||
# Excludes compiled files
|
||||
imports
|
||||
cool-retro-term
|
||||
build
|
||||
|
||||
# Mac OSX
|
||||
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -2,3 +2,6 @@
|
||||
path = qmltermwidget
|
||||
url = https://github.com/Swordfish90/qmltermwidget
|
||||
branch = unstable
|
||||
[submodule "KDSingleApplication"]
|
||||
path = KDSingleApplication
|
||||
url = https://github.com/KDAB/KDSingleApplication.git
|
||||
|
||||
1
KDSingleApplication
Submodule
1
KDSingleApplication
Submodule
Submodule KDSingleApplication added at 1848dd64e8
193
README.md
193
README.md
@@ -8,9 +8,9 @@
|
||||
cool-retro-term is a terminal emulator which mimics the look and feel of the old cathode tube screens.
|
||||
It has been designed to be eye-candy, customizable, and reasonably lightweight.
|
||||
|
||||
It uses the QML port of qtermwidget (Konsole) developed by me: https://github.com/Swordfish90/qmltermwidget .
|
||||
It uses the QML port of qtermwidget (Konsole): https://github.com/Swordfish90/qmltermwidget.
|
||||
|
||||
This terminal emulator works under Linux and macOS and requires Qt 5.2 or higher.
|
||||
This terminal emulator works under Linux and macOS and requires Qt5. It's suggested that you stick to the latest LTS version.
|
||||
|
||||
Settings such as colors, fonts, and effects can be accessed via context menu.
|
||||
|
||||
@@ -20,192 +20,11 @@ Settings such as colors, fonts, and effects can be accessed via context menu.
|
||||

|
||||
|
||||
## Install
|
||||
Walk the easy way and install cool-retro-term using one of these convenient packages:
|
||||
|
||||
Just grab the latest AppImage from the release page and make it executable and run it:
|
||||
If you want to get a hold of the latest version, just go to the Releases page and grab the latest AppImage (Linux) or dmg (macOS).
|
||||
|
||||
wget https://github.com/Swordfish90/cool-retro-term/releases/download/1.1.1/Cool-Retro-Term-1.1.1-x86_64.AppImage
|
||||
chmod a+x Cool-Retro-Term-1.1.1-x86_64.AppImage
|
||||
./Cool-Retro-Term-1.1.1-x86_64.AppImage
|
||||
Alternatively, most distributions such as Ubuntu, Fedora or Arch already package cool-retro-term in their official repositories.
|
||||
|
||||
**Fedora** has the `cool-retro-term` in the official repositories. All you have to do is `sudo dnf install cool-retro-term`.
|
||||
## Building
|
||||
|
||||
Users of **openSUSE** can grab a package from [Open Build Service](http://software.opensuse.org/package/cool-retro-term).
|
||||
|
||||
**Arch** users can install this [package](https://aur.archlinux.org/packages/cool-retro-term-git/) directly via the [AUR](https://aur.archlinux.org):
|
||||
|
||||
trizen -S aur/cool-retro-term-git
|
||||
|
||||
or use:
|
||||
|
||||
pacman -S cool-retro-term
|
||||
|
||||
to install precompiled from community repository.
|
||||
|
||||
Users of **Ubuntu 14.04 LTS (Trusty) up to 15.10 (Wily)** can use [this PPA](https://launchpad.net/~bugs-launchpad-net-falkensweb).
|
||||
|
||||
**Ubuntu 17.10** can use [this PPA](https://launchpad.net/%7Evantuz/+archive/ubuntu/cool-retro-term)
|
||||
|
||||
**Solus** users can install using `eopg`:
|
||||
```
|
||||
eopkg it cool-retro-term
|
||||
```
|
||||
|
||||
**macOS** users can grab the latest dmg from the [release page](https://github.com/Swordfish90/cool-retro-term/releases) or install via Homebrew:
|
||||
```
|
||||
brew cask install cool-retro-term
|
||||
```
|
||||
|
||||
**FreeBSD** users can install cool-retro-term with `pkg`:
|
||||
|
||||
pkg install cool-retro-term
|
||||
|
||||
## Build instructions (FreeBSD)
|
||||
|
||||
Grab a copy of [the FreeBSD Ports Collection](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html), modify [`/usr/ports/x11/cool-retro-term/Makefile`](https://svnweb.freebsd.org/ports/head/x11/cool-retro-term/Makefile?view=markup) as you like, and then run `make install` to build and install the emulator:
|
||||
|
||||
```
|
||||
cd /usr/ports/x11/cool-retro-term
|
||||
make install
|
||||
```
|
||||
|
||||
## Build instructions (Linux)
|
||||
|
||||
Build cool-retro-term yourself, you know, the retro way.
|
||||
|
||||
## Dependencies
|
||||
Make sure to install these first.
|
||||
|
||||
---
|
||||
|
||||
**Ubuntu 14.04**
|
||||
|
||||
sudo apt-get install build-essential qmlscene qt5-qmake qt5-default qtdeclarative5-dev qtdeclarative5-controls-plugin qtdeclarative5-qtquick2-plugin libqt5qml-graphicaleffects qtdeclarative5-dialogs-plugin qtdeclarative5-localstorage-plugin qtdeclarative5-window-plugin
|
||||
|
||||
---
|
||||
|
||||
**Ubuntu 16.10**
|
||||
|
||||
sudo apt-get install build-essential qmlscene qt5-qmake qt5-default qtdeclarative5-dev qml-module-qtquick-controls qtdeclarative5-qtquick2-plugin libqt5qml-graphicaleffects qml-module-qtquick-dialogs qtdeclarative5-localstorage-plugin qtdeclarative5-window-plugin
|
||||
|
||||
---
|
||||
|
||||
**Ubuntu 17.04**
|
||||
|
||||
sudo apt install build-essential libqt5qml-graphicaleffects qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtquick-controls qml-module-qtquick-dialogs qmlscene qt5-default qt5-qmake qtdeclarative5-dev qtdeclarative5-localstorage-plugin qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin
|
||||
|
||||
---
|
||||
|
||||
**Ubuntu 17.10**
|
||||
|
||||
sudo apt-get install build-essential qml-module-qtgraphicaleffects qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtquick-controls qml-module-qtquick-dialogs qmlscene qt5-default qt5-qmake qtdeclarative5-dev qtdeclarative5-localstorage-plugin qtdeclarative5-qtquick2-plugin qtdeclarative5-window-plugin
|
||||
|
||||
---
|
||||
|
||||
**snapcraft (most of distros)**
|
||||
|
||||
sudo snap install cool-retro-term --classic
|
||||
|
||||
---
|
||||
|
||||
**Debian Jessie and above**
|
||||
|
||||
sudo apt install build-essential qmlscene qt5-qmake qt5-default qtdeclarative5-dev qml-module-qtquick-controls qml-module-qtgraphicaleffects qml-module-qtquick-dialogs qml-module-qtquick-localstorage qml-module-qtquick-window2 qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel
|
||||
|
||||
---
|
||||
|
||||
**Fedora**
|
||||
This command should install the known fedora dependencies:
|
||||
|
||||
sudo yum -y install qt5-qtbase qt5-qtbase-devel qt5-qtdeclarative qt5-qtdeclarative-devel qt5-qtgraphicaleffects qt5-qtquickcontrols redhat-rpm-config
|
||||
|
||||
or:
|
||||
|
||||
sudo dnf -y install qt5-qtbase qt5-qtbase-devel qt5-qtdeclarative qt5-qtdeclarative-devel qt5-qtgraphicaleffects qt5-qtquickcontrols redhat-rpm-config
|
||||
|
||||
---
|
||||
|
||||
**Arch Linux**
|
||||
|
||||
sudo pacman -S qt5-base qt5-declarative qt5-quickcontrols qt5-graphicaleffects
|
||||
|
||||
---
|
||||
|
||||
**openSUSE**
|
||||
|
||||
Add repository with latest Qt 5 (this is only needed on openSUSE 13.1, Factory already has it):
|
||||
|
||||
sudo zypper ar http://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_13.1/ KDE:Qt5
|
||||
|
||||
Install dependencies:
|
||||
|
||||
sudo zypper install libqt5-qtbase-devel libqt5-qtdeclarative-devel libqt5-qtquickcontrols libqt5-qtgraphicaleffects
|
||||
|
||||
---
|
||||
|
||||
**Anyone else**
|
||||
|
||||
Install Qt directly from here http://qt-project.org/downloads . Once done export them in you path (replace "_/opt/Qt5.3.1/5.3/gcc_64/bin_" with your correct folder):
|
||||
|
||||
export PATH=/opt/Qt5.3.1/5.3/gcc_64/bin/:$PATH
|
||||
---
|
||||
|
||||
### Compile
|
||||
Once you installed all dependencies (Qt is installed and in your path) you need to compile and run the application:
|
||||
|
||||
```bash
|
||||
# Get it from GitHub
|
||||
git clone --recursive https://github.com/Swordfish90/cool-retro-term.git
|
||||
|
||||
# Build it
|
||||
cd cool-retro-term
|
||||
|
||||
# Compile (Fedora and OpenSUSE user should use qmake-qt5 instead of qmake)
|
||||
qmake && make
|
||||
|
||||
# Have fun!
|
||||
./cool-retro-term
|
||||
```
|
||||
|
||||
## Build instructions (macOS)
|
||||
|
||||
1. Install [Xcode](https://developer.apple.com/xcode/) and agree to the licence agreement
|
||||
2. Enter the following commands into the terminal:
|
||||
|
||||
**Brew**
|
||||
|
||||
```sh
|
||||
brew install qt5
|
||||
git clone --recursive https://github.com/Swordfish90/cool-retro-term.git
|
||||
export CPPFLAGS="-I/usr/local/opt/qt5/include"
|
||||
export LDFLAGS="-L/usr/local/opt/qt5/lib"
|
||||
export PATH=/usr/local/opt/qt5/bin:$PATH
|
||||
cd cool-retro-term
|
||||
qmake && make
|
||||
mkdir cool-retro-term.app/Contents/PlugIns
|
||||
cp -r qmltermwidget/QMLTermWidget cool-retro-term.app/Contents/PlugIns
|
||||
open cool-retro-term.app
|
||||
```
|
||||
|
||||
**MacPorts**
|
||||
|
||||
```sh
|
||||
sudo port install qt5
|
||||
git clone --recursive https://github.com/Swordfish90/cool-retro-term.git
|
||||
cd cool-retro-term
|
||||
/opt/local/libexec/qt5/bin/qmake && make
|
||||
mkdir cool-retro-term.app/Contents/PlugIns
|
||||
cp -r qmltermwidget/QMLTermWidget cool-retro-term.app/Contents/PlugIns
|
||||
open cool-retro-term.app
|
||||
```
|
||||
|
||||
**Homebrew**
|
||||
|
||||
```sh
|
||||
brew cask install cool-retro-term
|
||||
```
|
||||
|
||||
## Donations
|
||||
I made this project in my spare time because I love what I'm doing. If you are enjoying it and you want to buy me a beer click [here](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=flscogna%40gmail%2ecom&lc=IT&item_name=Filippo%20Scognamiglio¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted).
|
||||
|
||||
You can also add "bounties" on your favourite issues. More information on the [Bountysource](https://www.bountysource.com/teams/crt/issues) page.
|
||||
Check out the wiki and follow the instructions on how to build it on [Linux](https://github.com/Swordfish90/cool-retro-term/wiki/Build-Instructions-(Linux)) and [macOS](https://github.com/Swordfish90/cool-retro-term/wiki/Build-Instructions-(macOS)).
|
||||
|
||||
86
app/app.pro
86
app/app.pro
@@ -1,20 +1,96 @@
|
||||
QT += qml quick widgets sql
|
||||
TARGET = cool-retro-term
|
||||
QT += qml quick widgets sql quickcontrols2
|
||||
TARGET = cool-retro-term
|
||||
|
||||
# TODO: When migrating to CMake, use KDSingleApplication's CMakeLists.txt instead of these manual sources.
|
||||
INCLUDEPATH += $$PWD/../KDSingleApplication/src
|
||||
HEADERS += \
|
||||
$$PWD/../KDSingleApplication/src/kdsingleapplication.h \
|
||||
$$PWD/../KDSingleApplication/src/kdsingleapplication_lib.h \
|
||||
$$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket_p.h
|
||||
SOURCES += \
|
||||
$$PWD/../KDSingleApplication/src/kdsingleapplication.cpp \
|
||||
$$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket.cpp
|
||||
DEFINES += KDSINGLEAPPLICATION_STATIC_BUILD
|
||||
|
||||
DESTDIR = $$OUT_PWD/../
|
||||
|
||||
HEADERS += \
|
||||
fileio.h \
|
||||
monospacefontmanager.h
|
||||
fontmanager.h \
|
||||
fontlistmodel.h
|
||||
|
||||
SOURCES = main.cpp \
|
||||
SOURCES += main.cpp \
|
||||
fileio.cpp \
|
||||
monospacefontmanager.cpp
|
||||
fontmanager.cpp \
|
||||
fontlistmodel.cpp
|
||||
|
||||
macx:ICON = icons/crt.icns
|
||||
|
||||
RESOURCES += qml/resources.qrc
|
||||
|
||||
# Shader compilation (Qt Shader Baker)
|
||||
QSB_BIN = $$[QT_HOST_BINS]/qsb
|
||||
isEmpty(QSB_BIN): QSB_BIN = $$[QT_INSTALL_BINS]/qsb
|
||||
|
||||
SHADERS_DIR = $${_PRO_FILE_PWD_}/shaders
|
||||
SHADERS += $$files($$SHADERS_DIR/*.frag) $$files($$SHADERS_DIR/*.vert)
|
||||
SHADERS -= $$SHADERS_DIR/terminal_dynamic.frag
|
||||
SHADERS -= $$SHADERS_DIR/terminal_static.frag
|
||||
SHADERS -= $$SHADERS_DIR/passthrough.vert
|
||||
|
||||
qsb.input = SHADERS
|
||||
qsb.output = ../../app/shaders/${QMAKE_FILE_NAME}.qsb
|
||||
qsb.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
|
||||
qsb.clean = $$qsb.output
|
||||
qsb.name = qsb ${QMAKE_FILE_IN}
|
||||
qsb.variable_out = QSB_FILES
|
||||
QMAKE_EXTRA_COMPILERS += qsb
|
||||
PRE_TARGETDEPS += $$QSB_FILES
|
||||
OTHER_FILES += $$SHADERS $$QSB_FILES
|
||||
|
||||
DYNAMIC_SHADER = $$SHADERS_DIR/terminal_dynamic.frag
|
||||
STATIC_SHADER = $$SHADERS_DIR/terminal_static.frag
|
||||
|
||||
RASTER_MODES = 0 1 2 3 4
|
||||
BINARY_FLAGS = 0 1
|
||||
VARIANT_SHADER_DIR = $$relative_path($$PWD/shaders, $$OUT_PWD)
|
||||
VARIANT_OUTPUTS =
|
||||
|
||||
for(raster_mode, RASTER_MODES) {
|
||||
for(burn_in, BINARY_FLAGS) {
|
||||
for(display_frame, BINARY_FLAGS) {
|
||||
for(chroma_on, BINARY_FLAGS) {
|
||||
dynamic_variant = terminal_dynamic_raster$${raster_mode}_burn$${burn_in}_frame$${display_frame}_chroma$${chroma_on}
|
||||
dynamic_output = $${VARIANT_SHADER_DIR}/$${dynamic_variant}.frag.qsb
|
||||
dynamic_target = shader_variant_$${dynamic_variant}
|
||||
$${dynamic_target}.target = $${dynamic_output}
|
||||
$${dynamic_target}.depends = $$DYNAMIC_SHADER
|
||||
$${dynamic_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RASTER_MODE=$${raster_mode} -DCRT_BURN_IN=$${burn_in} -DCRT_DISPLAY_FRAME=$${display_frame} -DCRT_CHROMA=$${chroma_on} -o $${dynamic_output} $$DYNAMIC_SHADER
|
||||
QMAKE_EXTRA_TARGETS += $${dynamic_target}
|
||||
VARIANT_OUTPUTS += $${dynamic_output}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(rgb_shift, BINARY_FLAGS) {
|
||||
for(bloom_on, BINARY_FLAGS) {
|
||||
for(curve_on, BINARY_FLAGS) {
|
||||
for(shine_on, BINARY_FLAGS) {
|
||||
static_variant = terminal_static_rgb$${rgb_shift}_bloom$${bloom_on}_curve$${curve_on}_shine$${shine_on}
|
||||
static_output = $${VARIANT_SHADER_DIR}/$${static_variant}.frag.qsb
|
||||
static_target = shader_variant_$${static_variant}
|
||||
$${static_target}.target = $${static_output}
|
||||
$${static_target}.depends = $$STATIC_SHADER
|
||||
$${static_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RGB_SHIFT=$${rgb_shift} -DCRT_BLOOM=$${bloom_on} -DCRT_CURVATURE=$${curve_on} -DCRT_FRAME_SHININESS=$${shine_on} -o $${static_output} $$STATIC_SHADER
|
||||
QMAKE_EXTRA_TARGETS += $${static_target}
|
||||
VARIANT_OUTPUTS += $${static_output}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
PRE_TARGETDEPS += $${VARIANT_OUTPUTS}
|
||||
|
||||
#########################################
|
||||
## INTALLS
|
||||
#########################################
|
||||
|
||||
94
app/fontlistmodel.cpp
Normal file
94
app/fontlistmodel.cpp
Normal file
@@ -0,0 +1,94 @@
|
||||
#include "fontlistmodel.h"
|
||||
|
||||
FontListModel::FontListModel(QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
int FontListModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
if (parent.isValid()) {
|
||||
return 0;
|
||||
}
|
||||
return m_fonts.size();
|
||||
}
|
||||
|
||||
QVariant FontListModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid() || index.row() < 0 || index.row() >= m_fonts.size()) {
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
const FontEntry &font = m_fonts.at(index.row());
|
||||
|
||||
switch (role) {
|
||||
case NameRole:
|
||||
return font.name;
|
||||
case TextRole:
|
||||
return font.text;
|
||||
case SourceRole:
|
||||
return font.source;
|
||||
case BaseWidthRole:
|
||||
return font.baseWidth;
|
||||
case PixelSizeRole:
|
||||
return font.pixelSize;
|
||||
case LowResolutionRole:
|
||||
return font.lowResolutionFont;
|
||||
case IsSystemRole:
|
||||
return font.isSystemFont;
|
||||
case FamilyRole:
|
||||
return font.family;
|
||||
case FallbackNameRole:
|
||||
return font.fallbackName;
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> FontListModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roles;
|
||||
roles[NameRole] = "name";
|
||||
roles[TextRole] = "text";
|
||||
roles[SourceRole] = "source";
|
||||
roles[BaseWidthRole] = "baseWidth";
|
||||
roles[PixelSizeRole] = "pixelSize";
|
||||
roles[LowResolutionRole] = "lowResolutionFont";
|
||||
roles[IsSystemRole] = "isSystemFont";
|
||||
roles[FamilyRole] = "family";
|
||||
roles[FallbackNameRole] = "fallbackName";
|
||||
return roles;
|
||||
}
|
||||
|
||||
void FontListModel::setFonts(const QVector<FontEntry> &fonts)
|
||||
{
|
||||
beginResetModel();
|
||||
m_fonts = fonts;
|
||||
endResetModel();
|
||||
emit countChanged();
|
||||
}
|
||||
|
||||
const QVector<FontEntry> &FontListModel::fonts() const
|
||||
{
|
||||
return m_fonts;
|
||||
}
|
||||
|
||||
QVariantMap FontListModel::get(int index) const
|
||||
{
|
||||
QVariantMap map;
|
||||
if (index < 0 || index >= m_fonts.size()) {
|
||||
return map;
|
||||
}
|
||||
|
||||
const FontEntry &font = m_fonts.at(index);
|
||||
map.insert("name", font.name);
|
||||
map.insert("text", font.text);
|
||||
map.insert("source", font.source);
|
||||
map.insert("baseWidth", font.baseWidth);
|
||||
map.insert("pixelSize", font.pixelSize);
|
||||
map.insert("lowResolutionFont", font.lowResolutionFont);
|
||||
map.insert("isSystemFont", font.isSystemFont);
|
||||
map.insert("family", font.family);
|
||||
map.insert("fallbackName", font.fallbackName);
|
||||
return map;
|
||||
}
|
||||
59
app/fontlistmodel.h
Normal file
59
app/fontlistmodel.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#ifndef FONTLISTMODEL_H
|
||||
#define FONTLISTMODEL_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QVector>
|
||||
#include <QVariant>
|
||||
#include <QVariantMap>
|
||||
#include <QString>
|
||||
|
||||
struct FontEntry
|
||||
{
|
||||
QString name;
|
||||
QString text;
|
||||
QString source;
|
||||
qreal baseWidth = 1.0;
|
||||
int pixelSize = 0;
|
||||
bool lowResolutionFont = false;
|
||||
bool isSystemFont = false;
|
||||
QString family;
|
||||
QString fallbackName;
|
||||
};
|
||||
|
||||
class FontListModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
|
||||
|
||||
public:
|
||||
explicit FontListModel(QObject *parent = nullptr);
|
||||
|
||||
enum Roles {
|
||||
NameRole = Qt::UserRole + 1,
|
||||
TextRole,
|
||||
SourceRole,
|
||||
BaseWidthRole,
|
||||
PixelSizeRole,
|
||||
LowResolutionRole,
|
||||
IsSystemRole,
|
||||
FamilyRole,
|
||||
FallbackNameRole
|
||||
};
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
void setFonts(const QVector<FontEntry> &fonts);
|
||||
const QVector<FontEntry> &fonts() const;
|
||||
|
||||
Q_INVOKABLE QVariantMap get(int index) const;
|
||||
|
||||
signals:
|
||||
void countChanged();
|
||||
|
||||
private:
|
||||
QVector<FontEntry> m_fonts;
|
||||
};
|
||||
|
||||
#endif // FONTLISTMODEL_H
|
||||
584
app/fontmanager.cpp
Normal file
584
app/fontmanager.cpp
Normal file
@@ -0,0 +1,584 @@
|
||||
#include "fontmanager.h"
|
||||
|
||||
#include <QFont>
|
||||
#include <QFontDatabase>
|
||||
#include <QFontMetricsF>
|
||||
#include <QtGlobal>
|
||||
#include <QtMath>
|
||||
|
||||
namespace {
|
||||
constexpr int kModernRasterization = 4;
|
||||
constexpr int kBaseFontPixelHeight = 32;
|
||||
constexpr int kSystemFontPixelSize = 32;
|
||||
}
|
||||
|
||||
FontManager::FontManager(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_fontListModel(this)
|
||||
, m_filteredFontListModel(this)
|
||||
{
|
||||
populateBundledFonts();
|
||||
populateSystemFonts();
|
||||
m_fontListModel.setFonts(m_allFonts);
|
||||
updateFilteredFonts();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
QStringList FontManager::retrieveMonospaceFonts()
|
||||
{
|
||||
QStringList result;
|
||||
|
||||
QFontDatabase fontDatabase;
|
||||
const QStringList fontFamilies = fontDatabase.families();
|
||||
|
||||
for (const QString &fontFamily : fontFamilies) {
|
||||
QFont font(fontFamily);
|
||||
if (fontDatabase.isFixedPitch(font.family())) {
|
||||
result.append(fontFamily);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void FontManager::refresh()
|
||||
{
|
||||
updateFilteredFonts();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
FontListModel *FontManager::fontList()
|
||||
{
|
||||
return &m_fontListModel;
|
||||
}
|
||||
|
||||
FontListModel *FontManager::filteredFontList()
|
||||
{
|
||||
return &m_filteredFontListModel;
|
||||
}
|
||||
|
||||
int FontManager::fontSource() const
|
||||
{
|
||||
return m_fontSource;
|
||||
}
|
||||
|
||||
void FontManager::setFontSource(int fontSource)
|
||||
{
|
||||
if (m_fontSource == fontSource) {
|
||||
return;
|
||||
}
|
||||
m_fontSource = fontSource;
|
||||
emit fontSourceChanged();
|
||||
updateFilteredFonts();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
int FontManager::rasterization() const
|
||||
{
|
||||
return m_rasterization;
|
||||
}
|
||||
|
||||
void FontManager::setRasterization(int rasterization)
|
||||
{
|
||||
if (m_rasterization == rasterization) {
|
||||
return;
|
||||
}
|
||||
m_rasterization = rasterization;
|
||||
emit rasterizationChanged();
|
||||
updateFilteredFonts();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
QString FontManager::fontName() const
|
||||
{
|
||||
return m_fontName;
|
||||
}
|
||||
|
||||
void FontManager::setFontName(const QString &fontName)
|
||||
{
|
||||
if (m_fontName == fontName) {
|
||||
return;
|
||||
}
|
||||
m_fontName = fontName;
|
||||
emit fontNameChanged();
|
||||
updateFilteredFonts();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
qreal FontManager::fontScaling() const
|
||||
{
|
||||
return m_fontScaling;
|
||||
}
|
||||
|
||||
void FontManager::setFontScaling(qreal fontScaling)
|
||||
{
|
||||
if (qFuzzyCompare(m_fontScaling, fontScaling)) {
|
||||
return;
|
||||
}
|
||||
m_fontScaling = fontScaling;
|
||||
emit fontScalingChanged();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
qreal FontManager::fontWidth() const
|
||||
{
|
||||
return m_fontWidth;
|
||||
}
|
||||
|
||||
void FontManager::setFontWidth(qreal fontWidth)
|
||||
{
|
||||
if (qFuzzyCompare(m_fontWidth, fontWidth)) {
|
||||
return;
|
||||
}
|
||||
m_fontWidth = fontWidth;
|
||||
emit fontWidthChanged();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
qreal FontManager::lineSpacing() const
|
||||
{
|
||||
return m_lineSpacing;
|
||||
}
|
||||
|
||||
void FontManager::setLineSpacing(qreal lineSpacing)
|
||||
{
|
||||
if (qFuzzyCompare(m_lineSpacing, lineSpacing)) {
|
||||
return;
|
||||
}
|
||||
m_lineSpacing = lineSpacing;
|
||||
emit lineSpacingChanged();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
qreal FontManager::baseFontScaling() const
|
||||
{
|
||||
return m_baseFontScaling;
|
||||
}
|
||||
|
||||
void FontManager::setBaseFontScaling(qreal baseFontScaling)
|
||||
{
|
||||
if (qFuzzyCompare(m_baseFontScaling, baseFontScaling)) {
|
||||
return;
|
||||
}
|
||||
m_baseFontScaling = baseFontScaling;
|
||||
emit baseFontScalingChanged();
|
||||
updateComputedFont();
|
||||
}
|
||||
|
||||
bool FontManager::lowResolutionFont() const
|
||||
{
|
||||
return m_lowResolutionFont;
|
||||
}
|
||||
|
||||
void FontManager::setFontSubstitutions(const QString &family, const QStringList &substitutes)
|
||||
{
|
||||
if (family.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QFont::removeSubstitutions(family);
|
||||
|
||||
if (substitutes.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QFont::insertSubstitutions(family, substitutes);
|
||||
}
|
||||
|
||||
void FontManager::removeFontSubstitution(const QString &family)
|
||||
{
|
||||
if (family.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QFont::removeSubstitutions(family);
|
||||
}
|
||||
|
||||
void FontManager::populateBundledFonts()
|
||||
{
|
||||
m_allFonts.clear();
|
||||
|
||||
addBundledFont(
|
||||
"TERMINESS_SCALED",
|
||||
"Terminess",
|
||||
":/fonts/terminus/TerminessNerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
12,
|
||||
true);
|
||||
addBundledFont(
|
||||
"BIGBLUE_TERMINAL_SCALED",
|
||||
"BigBlue Terminal",
|
||||
":/fonts/bigblue-terminal/BigBlueTerm437NerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
12,
|
||||
true);
|
||||
addBundledFont(
|
||||
"EXCELSIOR_SCALED",
|
||||
"Fixedsys Excelsior",
|
||||
":/fonts/fixedsys-excelsior/FSEX301-L2.ttf",
|
||||
1.0,
|
||||
16,
|
||||
true,
|
||||
"UNSCII_16_SCALED");
|
||||
addBundledFont(
|
||||
"GREYBEARD_SCALED",
|
||||
"Greybeard",
|
||||
":/fonts/greybeard/Greybeard-16px.ttf",
|
||||
1.0,
|
||||
16,
|
||||
true,
|
||||
"UNSCII_16_SCALED");
|
||||
addBundledFont(
|
||||
"COMMODORE_PET_SCALED",
|
||||
"Commodore PET",
|
||||
":/fonts/pet-me/PetMe.ttf",
|
||||
0.5,
|
||||
8,
|
||||
true,
|
||||
"UNSCII_8_SCALED");
|
||||
addBundledFont(
|
||||
"GOHU_11_SCALED",
|
||||
"Gohu 11",
|
||||
":/fonts/gohu/GohuFont11NerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
11,
|
||||
true);
|
||||
addBundledFont(
|
||||
"COZETTE_SCALED",
|
||||
"Cozette",
|
||||
":/fonts/cozette/CozetteVector.ttf",
|
||||
1.0,
|
||||
13,
|
||||
true);
|
||||
addBundledFont(
|
||||
"UNSCII_8_SCALED",
|
||||
"Unscii 8",
|
||||
":/fonts/unscii/unscii-8.ttf",
|
||||
0.5,
|
||||
8,
|
||||
true,
|
||||
"UNSCII_8_SCALED");
|
||||
addBundledFont(
|
||||
"UNSCII_8_THIN_SCALED",
|
||||
"Unscii 8 Thin",
|
||||
":/fonts/unscii/unscii-8-thin.ttf",
|
||||
0.5,
|
||||
8,
|
||||
true,
|
||||
"UNSCII_8_SCALED");
|
||||
addBundledFont(
|
||||
"UNSCII_16_SCALED",
|
||||
"Unscii 16",
|
||||
":/fonts/unscii/unscii-16-full.ttf",
|
||||
1.0,
|
||||
16,
|
||||
true,
|
||||
"UNSCII_16_SCALED");
|
||||
addBundledFont(
|
||||
"APPLE_II_SCALED",
|
||||
"Apple ][",
|
||||
":/fonts/apple2/PrintChar21.ttf",
|
||||
0.5,
|
||||
8,
|
||||
true,
|
||||
"UNSCII_8_SCALED");
|
||||
addBundledFont(
|
||||
"ATARI_400_SCALED",
|
||||
"Atari 400-800",
|
||||
":/fonts/atari-400-800/AtariClassic-Regular.ttf",
|
||||
0.5,
|
||||
8,
|
||||
true,
|
||||
"UNSCII_8_SCALED");
|
||||
addBundledFont(
|
||||
"COMMODORE_64_SCALED",
|
||||
"Commodore 64",
|
||||
":/fonts/pet-me/PetMe64.ttf",
|
||||
0.5,
|
||||
8,
|
||||
true,
|
||||
"UNSCII_8_SCALED");
|
||||
addBundledFont(
|
||||
"IBM_EGA_8x8",
|
||||
"IBM EGA 8x8",
|
||||
":/fonts/oldschool-pc-fonts/PxPlus_IBM_EGA_8x8.ttf",
|
||||
0.5,
|
||||
8,
|
||||
true,
|
||||
"UNSCII_8_SCALED");
|
||||
addBundledFont(
|
||||
"IBM_VGA_8x16",
|
||||
"IBM VGA 8x16",
|
||||
":/fonts/oldschool-pc-fonts/PxPlus_IBM_VGA_8x16.ttf",
|
||||
1.0,
|
||||
16,
|
||||
true,
|
||||
"UNSCII_16_SCALED");
|
||||
|
||||
addBundledFont(
|
||||
"TERMINESS",
|
||||
"Terminess",
|
||||
":/fonts/terminus/TerminessNerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
addBundledFont(
|
||||
"HACK",
|
||||
"Hack",
|
||||
":/fonts/hack/HackNerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
addBundledFont(
|
||||
"FIRA_CODE",
|
||||
"Fira Code",
|
||||
":/fonts/fira-code/FiraCodeNerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
addBundledFont(
|
||||
"IOSEVKA",
|
||||
"Iosevka",
|
||||
":/fonts/iosevka/IosevkaTermNerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
addBundledFont(
|
||||
"JETBRAINS_MONO",
|
||||
"JetBrains Mono",
|
||||
":/fonts/jetbrains-mono/JetBrainsMonoNerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
addBundledFont(
|
||||
"IBM_3278",
|
||||
"IBM 3278",
|
||||
":/fonts/ibm-3278/3270NerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
addBundledFont(
|
||||
"SOURCE_CODE_PRO",
|
||||
"Source Code Pro",
|
||||
":/fonts/source-code-pro/SauceCodeProNerdFontMono-Regular.ttf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
addBundledFont(
|
||||
"DEPARTURE_MONO_SCALED",
|
||||
"Departure Mono",
|
||||
":/fonts/departure-mono/DepartureMonoNerdFontMono-Regular.otf",
|
||||
1.0,
|
||||
11,
|
||||
true);
|
||||
addBundledFont(
|
||||
"OPENDYSLEXIC",
|
||||
"OpenDyslexic",
|
||||
":/fonts/opendyslexic/OpenDyslexicMNerdFontMono-Regular.otf",
|
||||
1.0,
|
||||
32,
|
||||
false);
|
||||
}
|
||||
|
||||
void FontManager::addBundledFont(const QString &name,
|
||||
const QString &text,
|
||||
const QString &source,
|
||||
qreal baseWidth,
|
||||
int pixelSize,
|
||||
bool lowResolutionFont,
|
||||
const QString &fallbackName)
|
||||
{
|
||||
FontEntry entry;
|
||||
entry.name = name;
|
||||
entry.text = text;
|
||||
entry.source = source;
|
||||
entry.pixelSize = pixelSize;
|
||||
entry.lowResolutionFont = lowResolutionFont;
|
||||
entry.isSystemFont = false;
|
||||
entry.fallbackName = fallbackName;
|
||||
entry.family = resolveFontFamily(source);
|
||||
entry.baseWidth = lowResolutionFont
|
||||
? computeBaseWidth(entry.family, pixelSize, baseWidth)
|
||||
: baseWidth;
|
||||
m_allFonts.append(entry);
|
||||
}
|
||||
|
||||
void FontManager::populateSystemFonts()
|
||||
{
|
||||
const QStringList families = retrieveMonospaceFonts();
|
||||
for (const QString &family : families) {
|
||||
if (m_bundledFamilies.contains(family)) {
|
||||
continue;
|
||||
}
|
||||
FontEntry entry;
|
||||
entry.name = family;
|
||||
entry.text = family;
|
||||
entry.source = QString();
|
||||
entry.baseWidth = 1.0;
|
||||
entry.pixelSize = kSystemFontPixelSize;
|
||||
entry.lowResolutionFont = false;
|
||||
entry.isSystemFont = true;
|
||||
entry.family = family;
|
||||
m_allFonts.append(entry);
|
||||
}
|
||||
}
|
||||
|
||||
void FontManager::updateFilteredFonts()
|
||||
{
|
||||
QVector<FontEntry> filtered;
|
||||
bool fontNameFound = false;
|
||||
const bool modernMode = (m_rasterization == kModernRasterization);
|
||||
|
||||
for (const FontEntry &font : m_allFonts) {
|
||||
const bool isBundled = !font.isSystemFont;
|
||||
const bool matchesSource = (m_fontSource == 0 && isBundled)
|
||||
|| (m_fontSource == 1 && font.isSystemFont);
|
||||
|
||||
if (!matchesSource) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const bool matchesRasterization = font.isSystemFont
|
||||
|| (modernMode == !font.lowResolutionFont);
|
||||
|
||||
if (!matchesRasterization) {
|
||||
continue;
|
||||
}
|
||||
|
||||
filtered.append(font);
|
||||
if (font.name == m_fontName) {
|
||||
fontNameFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!fontNameFound && !filtered.isEmpty()) {
|
||||
if (m_fontName != filtered.first().name) {
|
||||
m_fontName = filtered.first().name;
|
||||
emit fontNameChanged();
|
||||
}
|
||||
}
|
||||
|
||||
m_filteredFontListModel.setFonts(filtered);
|
||||
emit filteredFontListChanged();
|
||||
}
|
||||
|
||||
void FontManager::updateComputedFont()
|
||||
{
|
||||
const FontEntry *font = findFontByName(m_fontName);
|
||||
if (!font) {
|
||||
const QVector<FontEntry> &filteredFonts = m_filteredFontListModel.fonts();
|
||||
if (!filteredFonts.isEmpty()) {
|
||||
font = &filteredFonts.first();
|
||||
}
|
||||
}
|
||||
|
||||
if (!font) {
|
||||
return;
|
||||
}
|
||||
|
||||
const qreal totalFontScaling = m_baseFontScaling * m_fontScaling;
|
||||
const qreal targetPixelHeight = kBaseFontPixelHeight * totalFontScaling;
|
||||
const qreal lineSpacingFactor = m_lineSpacing;
|
||||
|
||||
const int lineSpacing = qRound(targetPixelHeight * lineSpacingFactor);
|
||||
const int pixelSize = font->lowResolutionFont
|
||||
? font->pixelSize
|
||||
: static_cast<int>(targetPixelHeight);
|
||||
|
||||
const qreal nativeLineHeight = font->pixelSize + qRound(font->pixelSize * lineSpacingFactor);
|
||||
const qreal targetLineHeight = targetPixelHeight + lineSpacing;
|
||||
const qreal screenScaling = font->lowResolutionFont
|
||||
? (nativeLineHeight > 0 ? targetLineHeight / nativeLineHeight : 1.0)
|
||||
: 1.0;
|
||||
|
||||
const qreal fontWidth = font->baseWidth * m_fontWidth;
|
||||
|
||||
QString fontFamily = font->family.isEmpty() ? font->name : font->family;
|
||||
QString fallbackFontFamily;
|
||||
|
||||
if (!font->fallbackName.isEmpty() && font->fallbackName != font->name) {
|
||||
const FontEntry *fallback = findFontByName(font->fallbackName);
|
||||
if (fallback) {
|
||||
fallbackFontFamily = fallback->family.isEmpty() ? fallback->name : fallback->family;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList fallbackChain;
|
||||
if (!fallbackFontFamily.isEmpty()) {
|
||||
fallbackChain.append(fallbackFontFamily);
|
||||
}
|
||||
#if defined(Q_OS_MAC)
|
||||
fallbackChain.append(QStringLiteral("Menlo"));
|
||||
#else
|
||||
fallbackChain.append(QStringLiteral("Monospace"));
|
||||
#endif
|
||||
setFontSubstitutions(fontFamily, fallbackChain);
|
||||
|
||||
if (m_lowResolutionFont != font->lowResolutionFont) {
|
||||
m_lowResolutionFont = font->lowResolutionFont;
|
||||
emit lowResolutionFontChanged();
|
||||
}
|
||||
|
||||
emit terminalFontChanged(fontFamily,
|
||||
pixelSize,
|
||||
lineSpacing,
|
||||
screenScaling,
|
||||
fontWidth,
|
||||
fallbackFontFamily,
|
||||
font->lowResolutionFont);
|
||||
}
|
||||
|
||||
const FontEntry *FontManager::findFontByName(const QString &name) const
|
||||
{
|
||||
for (const FontEntry &font : m_allFonts) {
|
||||
if (font.name == name) {
|
||||
return &font;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QString FontManager::resolveFontFamily(const QString &sourcePath)
|
||||
{
|
||||
const auto cached = m_loadedFamilies.constFind(sourcePath);
|
||||
if (cached != m_loadedFamilies.constEnd()) {
|
||||
return cached.value();
|
||||
}
|
||||
|
||||
const int fontId = QFontDatabase::addApplicationFont(sourcePath);
|
||||
QString family;
|
||||
if (fontId != -1) {
|
||||
const QStringList families = QFontDatabase::applicationFontFamilies(fontId);
|
||||
if (!families.isEmpty()) {
|
||||
family = families.first();
|
||||
}
|
||||
}
|
||||
|
||||
if (!family.isEmpty()) {
|
||||
m_bundledFamilies.insert(family);
|
||||
}
|
||||
|
||||
m_loadedFamilies.insert(sourcePath, family);
|
||||
return family;
|
||||
}
|
||||
|
||||
qreal FontManager::computeBaseWidth(const QString &family, int pixelSize, qreal fallbackWidth) const
|
||||
{
|
||||
if (family.isEmpty()) {
|
||||
return fallbackWidth;
|
||||
}
|
||||
|
||||
QFont font(family);
|
||||
font.setPixelSize(pixelSize);
|
||||
QFontMetricsF metrics(font);
|
||||
|
||||
const qreal glyphWidth = metrics.horizontalAdvance(QLatin1String("M"));
|
||||
const qreal glyphHeight = metrics.height();
|
||||
if (glyphWidth <= 0.0 || glyphHeight <= 0.0) {
|
||||
return fallbackWidth;
|
||||
}
|
||||
|
||||
const qreal targetRatio = 0.5;
|
||||
qreal computedWidth = (targetRatio * glyphHeight) / glyphWidth;
|
||||
return qBound(0.25, computedWidth, 2.0);
|
||||
}
|
||||
111
app/fontmanager.h
Normal file
111
app/fontmanager.h
Normal file
@@ -0,0 +1,111 @@
|
||||
#ifndef FONTMANAGER_H
|
||||
#define FONTMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QHash>
|
||||
#include <QSet>
|
||||
|
||||
#include "fontlistmodel.h"
|
||||
|
||||
class FontManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(FontListModel *fontList READ fontList CONSTANT)
|
||||
Q_PROPERTY(FontListModel *filteredFontList READ filteredFontList NOTIFY filteredFontListChanged)
|
||||
Q_PROPERTY(int fontSource READ fontSource WRITE setFontSource NOTIFY fontSourceChanged)
|
||||
Q_PROPERTY(int rasterization READ rasterization WRITE setRasterization NOTIFY rasterizationChanged)
|
||||
Q_PROPERTY(QString fontName READ fontName WRITE setFontName NOTIFY fontNameChanged)
|
||||
Q_PROPERTY(qreal fontScaling READ fontScaling WRITE setFontScaling NOTIFY fontScalingChanged)
|
||||
Q_PROPERTY(qreal fontWidth READ fontWidth WRITE setFontWidth NOTIFY fontWidthChanged)
|
||||
Q_PROPERTY(qreal lineSpacing READ lineSpacing WRITE setLineSpacing NOTIFY lineSpacingChanged)
|
||||
Q_PROPERTY(qreal baseFontScaling READ baseFontScaling WRITE setBaseFontScaling NOTIFY baseFontScalingChanged)
|
||||
Q_PROPERTY(bool lowResolutionFont READ lowResolutionFont NOTIFY lowResolutionFontChanged)
|
||||
|
||||
public:
|
||||
explicit FontManager(QObject *parent = nullptr);
|
||||
|
||||
Q_INVOKABLE void refresh();
|
||||
|
||||
FontListModel *fontList();
|
||||
FontListModel *filteredFontList();
|
||||
|
||||
int fontSource() const;
|
||||
void setFontSource(int fontSource);
|
||||
|
||||
int rasterization() const;
|
||||
void setRasterization(int rasterization);
|
||||
|
||||
QString fontName() const;
|
||||
void setFontName(const QString &fontName);
|
||||
|
||||
qreal fontScaling() const;
|
||||
void setFontScaling(qreal fontScaling);
|
||||
|
||||
qreal fontWidth() const;
|
||||
void setFontWidth(qreal fontWidth);
|
||||
|
||||
qreal lineSpacing() const;
|
||||
void setLineSpacing(qreal lineSpacing);
|
||||
|
||||
qreal baseFontScaling() const;
|
||||
void setBaseFontScaling(qreal baseFontScaling);
|
||||
|
||||
bool lowResolutionFont() const;
|
||||
|
||||
signals:
|
||||
void fontSourceChanged();
|
||||
void rasterizationChanged();
|
||||
void fontNameChanged();
|
||||
void fontScalingChanged();
|
||||
void fontWidthChanged();
|
||||
void lineSpacingChanged();
|
||||
void baseFontScalingChanged();
|
||||
void lowResolutionFontChanged();
|
||||
void filteredFontListChanged();
|
||||
|
||||
void terminalFontChanged(QString fontFamily,
|
||||
int pixelSize,
|
||||
int lineSpacing,
|
||||
qreal screenScaling,
|
||||
qreal fontWidth,
|
||||
QString fallbackFontFamily,
|
||||
bool lowResolutionFont);
|
||||
|
||||
private:
|
||||
QStringList retrieveMonospaceFonts();
|
||||
void populateBundledFonts();
|
||||
void populateSystemFonts();
|
||||
void addBundledFont(const QString &name,
|
||||
const QString &text,
|
||||
const QString &source,
|
||||
qreal baseWidth,
|
||||
int pixelSize,
|
||||
bool lowResolutionFont,
|
||||
const QString &fallbackName = QString());
|
||||
void setFontSubstitutions(const QString &family, const QStringList &substitutes);
|
||||
void removeFontSubstitution(const QString &family);
|
||||
void updateFilteredFonts();
|
||||
void updateComputedFont();
|
||||
const FontEntry *findFontByName(const QString &name) const;
|
||||
QString resolveFontFamily(const QString &sourcePath);
|
||||
qreal computeBaseWidth(const QString &family, int pixelSize, qreal fallbackWidth) const;
|
||||
|
||||
FontListModel m_fontListModel;
|
||||
FontListModel m_filteredFontListModel;
|
||||
QVector<FontEntry> m_allFonts;
|
||||
|
||||
int m_fontSource = 0;
|
||||
int m_rasterization = 0;
|
||||
QString m_fontName = QStringLiteral("TERMINESS_SCALED");
|
||||
qreal m_fontScaling = 1.0;
|
||||
qreal m_fontWidth = 1.0;
|
||||
qreal m_lineSpacing = 0.1;
|
||||
qreal m_baseFontScaling = 0.75;
|
||||
bool m_lowResolutionFont = false;
|
||||
|
||||
QHash<QString, QString> m_loadedFamilies;
|
||||
QSet<QString> m_bundledFamilies;
|
||||
};
|
||||
|
||||
#endif // FONTMANAGER_H
|
||||
111
app/main.cpp
111
app/main.cpp
@@ -6,14 +6,25 @@
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QIcon>
|
||||
#include <QQuickStyle>
|
||||
#include <QtQml/qqml.h>
|
||||
|
||||
#include <kdsingleapplication.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <QFontDatabase>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include <fileio.h>
|
||||
#include <monospacefontmanager.h>
|
||||
#include <fontlistmodel.h>
|
||||
#include <fontmanager.h>
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <QStyleFactory>
|
||||
#include <QMenu>
|
||||
#endif
|
||||
|
||||
QString getNamedArgument(QStringList args, QString name, QString defaultName)
|
||||
{
|
||||
@@ -29,59 +40,76 @@ QString getNamedArgument(QStringList args, QString name)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// Some environmental variable are necessary on certain platforms.
|
||||
// Disable Connections slot warnings
|
||||
QLoggingCategory::setFilterRules("qt.qml.connections.warning=false");
|
||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round);
|
||||
|
||||
// This disables QT appmenu under Ubuntu, which is not working with QML apps.
|
||||
setenv("QT_QPA_PLATFORMTHEME", "", 1);
|
||||
|
||||
#if defined (Q_OS_LINUX)
|
||||
setenv("QSG_RENDER_LOOP", "threaded", 0);
|
||||
#endif
|
||||
// #if defined (Q_OS_LINUX)
|
||||
// setenv("QSG_RENDER_LOOP", "threaded", 0);
|
||||
// #endif
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
// This allows UTF-8 characters usage in OSX.
|
||||
setenv("LC_CTYPE", "UTF-8", 1);
|
||||
|
||||
// Ensure key repeat works for letter keys (disable macOS press-and-hold for this app).
|
||||
CFPreferencesSetAppValue(CFSTR("ApplePressAndHoldEnabled"), kCFBooleanFalse, kCFPreferencesCurrentApplication);
|
||||
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
||||
|
||||
// Qt6 macOS default look is still lacking, so let's force Fusion for now
|
||||
QQuickStyle::setStyle(QStringLiteral("Fusion"));
|
||||
#endif
|
||||
|
||||
if (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help"))) {
|
||||
QTextStream cout(stdout, QIODevice::WriteOnly);
|
||||
cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << endl;
|
||||
cout << " --default-settings Run cool-retro-term with the default settings" << endl;
|
||||
cout << " --workdir <dir> Change working directory to 'dir'" << endl;
|
||||
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << endl;
|
||||
cout << " -T <title> Set window title to 'title'." << endl;
|
||||
cout << " --fullscreen Run cool-retro-term in fullscreen." << endl;
|
||||
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << endl;
|
||||
cout << " -h|--help Print this help." << endl;
|
||||
cout << " --verbose Print additional information such as profiles and settings." << endl;
|
||||
cout << "Usage: " << argv[0] << " [--default-settings] [--workdir <dir>] [--program <prog>] [-p|--profile <prof>] [--fullscreen] [-h|--help]" << Qt::endl;
|
||||
cout << " --default-settings Run cool-retro-term with the default settings" << Qt::endl;
|
||||
cout << " --workdir <dir> Change working directory to 'dir'" << Qt::endl;
|
||||
cout << " -e <cmd> Command to execute. This option will catch all following arguments, so use it as the last option." << Qt::endl;
|
||||
cout << " --fullscreen Run cool-retro-term in fullscreen." << Qt::endl;
|
||||
cout << " -p|--profile <prof> Run cool-retro-term with the given profile." << Qt::endl;
|
||||
cout << " -h|--help Print this help." << Qt::endl;
|
||||
cout << " --verbose Print additional information such as profiles and settings." << Qt::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString appVersion("1.1.1");
|
||||
QString appVersion("1.2.0");
|
||||
|
||||
if (argc>1 && (!strcmp(argv[1],"-v") || !strcmp(argv[1],"--version"))) {
|
||||
QTextStream cout(stdout, QIODevice::WriteOnly);
|
||||
cout << "cool-retro-term " << appVersion << endl;
|
||||
return 0;
|
||||
cout << "cool-retro-term " << appVersion << Qt::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
QApplication app(argc, argv);
|
||||
// set application attributes
|
||||
// Has no effects, see https://bugreports.qt.io/browse/QTBUG-51293
|
||||
// app.setAttribute(Qt::AA_MacDontSwapCtrlAndMeta, true);
|
||||
app.setAttribute(Qt::AA_MacDontSwapCtrlAndMeta, true);
|
||||
app.setApplicationName(QStringLiteral("cool-retro-term"));
|
||||
app.setOrganizationName(QStringLiteral("cool-retro-term"));
|
||||
app.setOrganizationDomain(QStringLiteral("cool-retro-term"));
|
||||
|
||||
KDSingleApplication singleApp(QStringLiteral("cool-retro-term"));
|
||||
|
||||
if (!singleApp.isPrimaryInstance()) {
|
||||
if (singleApp.sendMessage("new-window"))
|
||||
return 0;
|
||||
qWarning() << "KDSingleApplication: primary not reachable, continuing as independent instance.";
|
||||
}
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
FileIO fileIO;
|
||||
MonospaceFontManager monospaceFontManager;
|
||||
|
||||
qmlRegisterType<FontManager>("CoolRetroTerm", 1, 0, "FontManager");
|
||||
qmlRegisterUncreatableType<FontListModel>("CoolRetroTerm", 1, 0, "FontListModel", "FontListModel is created by FontManager");
|
||||
|
||||
#if !defined(Q_OS_MAC)
|
||||
app.setWindowIcon(QIcon::fromTheme("cool-retro-term", QIcon(":../icons/32x32/cool-retro-term.png")));
|
||||
#if defined(Q_OS_LINUX)
|
||||
QGuiApplication::setDesktopFileName(QStringLiteral("cool-retro-term"));
|
||||
#endif
|
||||
#else
|
||||
app.setWindowIcon(QIcon(":../icons/32x32/cool-retro-term.png"));
|
||||
#endif
|
||||
|
||||
app.setOrganizationName("cool-retro-term");
|
||||
app.setOrganizationDomain("cool-retro-term");
|
||||
|
||||
// Manage command line arguments from the cpp side
|
||||
QStringList args = app.arguments();
|
||||
|
||||
@@ -98,15 +126,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", "$HOME"));
|
||||
engine.rootContext()->setContextProperty("fileIO", &fileIO);
|
||||
engine.rootContext()->setContextProperty("monospaceSystemFonts", monospaceFontManager.retrieveMonospaceFonts());
|
||||
|
||||
engine.rootContext()->setContextProperty("devicePixelRatio", app.devicePixelRatio());
|
||||
|
||||
// Manage import paths for Linux and OSX.
|
||||
QStringList importPathList = engine.importPathList();
|
||||
importPathList.prepend(QCoreApplication::applicationDirPath() + "/qmltermwidget");
|
||||
importPathList.prepend(QCoreApplication::applicationDirPath() + "/../PlugIns");
|
||||
importPathList.prepend(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget");
|
||||
importPathList.append(QCoreApplication::applicationDirPath() + "/qmltermwidget");
|
||||
importPathList.append(QCoreApplication::applicationDirPath() + "/../PlugIns");
|
||||
importPathList.append(QCoreApplication::applicationDirPath() + "/../../../qmltermwidget");
|
||||
engine.setImportPathList(importPathList);
|
||||
|
||||
engine.load(QUrl(QStringLiteral ("qrc:/main.qml")));
|
||||
@@ -119,5 +144,25 @@ int main(int argc, char *argv[])
|
||||
// Quit the application when the engine closes.
|
||||
QObject::connect((QObject*) &engine, SIGNAL(quit()), (QObject*) &app, SLOT(quit()));
|
||||
|
||||
auto requestNewWindow = [&engine]() {
|
||||
if (engine.rootObjects().isEmpty())
|
||||
return;
|
||||
|
||||
QObject *rootObject = engine.rootObjects().constFirst();
|
||||
QMetaObject::invokeMethod(rootObject, "createWindow", Qt::QueuedConnection);
|
||||
};
|
||||
|
||||
QObject::connect(&singleApp, &KDSingleApplication::messageReceived, &app,
|
||||
[&requestNewWindow](const QByteArray &message) {
|
||||
if (message.isEmpty() || message == QByteArray("new-window"))
|
||||
requestNewWindow();
|
||||
});
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
QMenu *dockMenu = new QMenu(nullptr);
|
||||
dockMenu->addAction(QObject::tr("New Window"), [&requestNewWindow]() { requestNewWindow(); });
|
||||
dockMenu->setAsDockMenu();
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#include "monospacefontmanager.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
MonospaceFontManager::MonospaceFontManager(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QStringList MonospaceFontManager::retrieveMonospaceFonts() {
|
||||
QStringList result;
|
||||
|
||||
QFontDatabase fontDatabase;
|
||||
QStringList fontFamilies = fontDatabase.families();
|
||||
|
||||
for (int i = 0; i < fontFamilies.size(); i++) {
|
||||
QString fontFamily = fontFamilies[i];
|
||||
QFont font(fontFamily);
|
||||
if (fontDatabase.isFixedPitch(font.family())) {
|
||||
result.append(fontFamily);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef MONOSPACEFONTMANAGER_H
|
||||
#define MONOSPACEFONTMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QFontDatabase>
|
||||
|
||||
class MonospaceFontManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MonospaceFontManager(QObject *parent = nullptr);
|
||||
Q_INVOKABLE QStringList retrieveMonospaceFonts();
|
||||
};
|
||||
|
||||
#endif // MONOSPACEFONTMANAGER_H
|
||||
@@ -22,14 +22,12 @@ import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.0
|
||||
|
||||
Window {
|
||||
ApplicationWindow {
|
||||
id: dialogwindow
|
||||
title: qsTr("About")
|
||||
width: 600
|
||||
height: 400
|
||||
|
||||
modality: Qt.ApplicationModal
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 15
|
||||
@@ -37,6 +35,7 @@ Window {
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: "cool-retro-term"
|
||||
color: palette.text
|
||||
font {
|
||||
bold: true
|
||||
pointSize: 18
|
||||
@@ -100,6 +99,7 @@ Window {
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
color: palette.text
|
||||
text: appSettings.version + "\n" + qsTr(
|
||||
"Author: ") + "Filippo Scognamiglio\n" + qsTr(
|
||||
"Email: ") + "flscogna@gmail.com\n" + qsTr(
|
||||
@@ -115,7 +115,8 @@ Window {
|
||||
TextArea {
|
||||
readOnly: true
|
||||
wrapMode: TextEdit.Wrap
|
||||
text: "Copyright (c) 2013-2021 Filippo Scognamiglio <flscogna@gmail.com>\n\n"
|
||||
color: palette.text
|
||||
text: "Copyright (c) 2013-2025 Filippo Scognamiglio <flscogna@gmail.com>\n\n"
|
||||
+ "https://github.com/Swordfish90/cool-retro-term\n\n" +
|
||||
"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 "
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*******************************************************************************/
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.0
|
||||
import CoolRetroTerm 1.0
|
||||
|
||||
import "utils.js" as Utils
|
||||
|
||||
@@ -27,38 +28,32 @@ QtObject {
|
||||
readonly property int profileVersion: 2
|
||||
|
||||
// STATIC CONSTANTS ////////////////////////////////////////////////////////
|
||||
readonly property real screenCurvatureSize: 0.4
|
||||
readonly property real screenCurvatureSize: 0.6
|
||||
readonly property real minimumFontScaling: 0.25
|
||||
readonly property real maximumFontScaling: 2.50
|
||||
|
||||
readonly property real minBurnInFadeTime: 160
|
||||
readonly property real maxBurnInFadeTime: 1600
|
||||
readonly property int defaultMargin: 16
|
||||
|
||||
readonly property real minBurnInFadeTime: 0.16
|
||||
readonly property real maxBurnInFadeTime: 1.6
|
||||
|
||||
property bool isMacOS: Qt.platform.os === "osx"
|
||||
|
||||
// GENERAL SETTINGS ///////////////////////////////////////////////////////
|
||||
property int x: 100
|
||||
property int y: 100
|
||||
property int width: 1024
|
||||
property int height: 768
|
||||
|
||||
property bool fullscreen: false
|
||||
property bool showMenubar: Qt.platform.os === "osx" ? true : false
|
||||
|
||||
property string wintitle: "cool-retro-term"
|
||||
property bool showMenubar: false
|
||||
|
||||
property bool showTerminalSize: true
|
||||
property real windowScaling: 1.0
|
||||
|
||||
property real fps: 20
|
||||
property int effectsFrameSkip: 3
|
||||
property bool verbose: false
|
||||
|
||||
property real bloomQuality: 0.5
|
||||
|
||||
property real burnInQuality: 0.5
|
||||
property bool useFastBurnIn: Qt.platform.os === "osx" ? false : true
|
||||
|
||||
property bool blinkingCursor: false
|
||||
|
||||
onWindowScalingChanged: handleFontChanged()
|
||||
|
||||
// PROFILE SETTINGS ///////////////////////////////////////////////////////
|
||||
property real windowOpacity: 1.0
|
||||
@@ -71,16 +66,11 @@ QtObject {
|
||||
|
||||
property string _backgroundColor: "#000000"
|
||||
property string _fontColor: "#ff8100"
|
||||
property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"),
|
||||
Utils.strToColor(_fontColor),
|
||||
saturationColor * 0.5)
|
||||
property color fontColor: Utils.mix(Utils.strToColor(saturatedColor),
|
||||
Utils.strToColor(_backgroundColor),
|
||||
0.7 + (contrast * 0.3))
|
||||
property color backgroundColor: Utils.mix(Utils.strToColor(
|
||||
_backgroundColor),
|
||||
Utils.strToColor(saturatedColor),
|
||||
0.7 + (contrast * 0.3))
|
||||
property string _frameColor: "#ffffff"
|
||||
property string saturatedColor: Utils.mix(Utils.strToColor(_fontColor), Utils.strToColor("#FFFFFF"), (saturationColor * 0.5))
|
||||
property color fontColor: Utils.mix(Utils.strToColor(_backgroundColor), Utils.strToColor(saturatedColor), (0.7 + (contrast * 0.3)))
|
||||
property color backgroundColor: Utils.mix(Utils.strToColor(saturatedColor), Utils.strToColor(_backgroundColor), (0.7 + (contrast * 0.3)))
|
||||
property color frameColor: Utils.strToColor(_frameColor)
|
||||
|
||||
property real staticNoise: 0.12
|
||||
property real screenCurvature: 0.3
|
||||
@@ -98,111 +88,65 @@ QtObject {
|
||||
|
||||
property real rbgShift: 0.0
|
||||
|
||||
property real _frameShininess: 0.2
|
||||
property real frameShininess: _frameShininess * 0.5
|
||||
|
||||
property real _frameSize: 0.2
|
||||
property real frameSize: _frameSize * 0.05
|
||||
|
||||
property real _screenRadius: 0.2
|
||||
property real screenRadius: Utils.lint(4.0, 120.0, _screenRadius)
|
||||
|
||||
property real _margin: 0.5
|
||||
property real margin: Utils.lint(1.0, 20.0, _margin)
|
||||
property real margin: Utils.lint(1.0, 40.0, _margin) + (1.0 - Math.SQRT1_2) * screenRadius
|
||||
|
||||
readonly property bool frameEnabled: ambientLight > 0 || _frameSize > 0 || screenCurvature > 0
|
||||
|
||||
readonly property int no_rasterization: 0
|
||||
readonly property int scanline_rasterization: 1
|
||||
readonly property int pixel_rasterization: 2
|
||||
readonly property int subpixel_rasterization: 3
|
||||
readonly property int modern_rasterization: 4
|
||||
|
||||
property int rasterization: no_rasterization
|
||||
property alias rasterization: fontManager.rasterization
|
||||
|
||||
readonly property int bundled_fonts: 0
|
||||
readonly property int system_fonts: 1
|
||||
|
||||
property alias fontSource: fontManager.fontSource
|
||||
|
||||
// FONTS //////////////////////////////////////////////////////////////////
|
||||
readonly property real baseFontScaling: 0.75
|
||||
property real fontScaling: 1.0
|
||||
property alias fontScaling: fontManager.fontScaling
|
||||
property real totalFontScaling: baseFontScaling * fontScaling
|
||||
|
||||
property real fontWidth: 1.0
|
||||
property alias fontWidth: fontManager.fontWidth
|
||||
property alias lineSpacing: fontManager.lineSpacing
|
||||
|
||||
property bool lowResolutionFont: false
|
||||
property alias lowResolutionFont: fontManager.lowResolutionFont
|
||||
|
||||
property var fontNames: ["TERMINUS_SCALED", "COMMODORE_PET", "COMMODORE_PET"]
|
||||
property var fontlist: fontManager.item.fontlist
|
||||
property alias fontName: fontManager.fontName
|
||||
property alias filteredFontList: fontManager.filteredFontList
|
||||
|
||||
signal terminalFontChanged(string fontFamily, int pixelSize, int lineSpacing, real screenScaling, real fontWidth)
|
||||
property FontManager fontManager: FontManager {
|
||||
id: fontManager
|
||||
baseFontScaling: baseFontScaling
|
||||
}
|
||||
|
||||
signal initializedSettings
|
||||
|
||||
property Loader fontManager: Loader {
|
||||
states: [
|
||||
State {
|
||||
when: rasterization == no_rasterization
|
||||
PropertyChanges {
|
||||
target: fontManager
|
||||
source: "Fonts.qml"
|
||||
}
|
||||
},
|
||||
State {
|
||||
when: rasterization == scanline_rasterization
|
||||
PropertyChanges {
|
||||
target: fontManager
|
||||
source: "FontScanlines.qml"
|
||||
}
|
||||
},
|
||||
State {
|
||||
when: rasterization == pixel_rasterization
|
||||
PropertyChanges {
|
||||
target: fontManager
|
||||
source: "FontPixels.qml"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
onLoaded: handleFontChanged()
|
||||
}
|
||||
|
||||
property FontLoader fontLoader: FontLoader {}
|
||||
|
||||
onTotalFontScalingChanged: handleFontChanged()
|
||||
onFontWidthChanged: handleFontChanged()
|
||||
|
||||
function getIndexByName(name) {
|
||||
for (var i = 0; i < fontlist.count; i++) {
|
||||
var requestedName = fontlist.get(i).name
|
||||
if (name === requestedName)
|
||||
return i
|
||||
}
|
||||
return 0 // If the font is not available default to 0.
|
||||
}
|
||||
|
||||
function incrementScaling() {
|
||||
fontScaling = Math.min(fontScaling + 0.05, maximumFontScaling)
|
||||
handleFontChanged()
|
||||
}
|
||||
|
||||
function decrementScaling() {
|
||||
fontScaling = Math.max(fontScaling - 0.05, minimumFontScaling)
|
||||
handleFontChanged()
|
||||
}
|
||||
|
||||
function handleFontChanged() {
|
||||
if (!fontManager.item)
|
||||
return
|
||||
|
||||
var index = getIndexByName(fontNames[rasterization])
|
||||
if (index === undefined)
|
||||
return
|
||||
|
||||
fontManager.item.selectedFontIndex = index
|
||||
fontManager.item.scaling = totalFontScaling
|
||||
|
||||
var fontSource = fontManager.item.source
|
||||
var pixelSize = fontManager.item.pixelSize
|
||||
var lineSpacing = fontManager.item.lineSpacing
|
||||
var screenScaling = fontManager.item.screenScaling
|
||||
var fontWidth = fontManager.item.defaultFontWidth * appSettings.fontWidth
|
||||
var fontFamily = fontManager.item.family
|
||||
var isSystemFont = fontManager.item.isSystemFont
|
||||
|
||||
lowResolutionFont = fontManager.item.lowResolutionFont
|
||||
|
||||
if (!isSystemFont) {
|
||||
fontLoader.source = fontSource
|
||||
fontFamily = fontLoader.name
|
||||
}
|
||||
|
||||
terminalFontChanged(fontFamily, pixelSize, lineSpacing, screenScaling,
|
||||
fontWidth)
|
||||
function close() {
|
||||
storeSettings()
|
||||
storeCustomProfiles()
|
||||
Qt.quit()
|
||||
}
|
||||
|
||||
property Storage storage: Storage {}
|
||||
@@ -216,28 +160,21 @@ QtObject {
|
||||
|
||||
function composeSettingsString() {
|
||||
var settings = {
|
||||
"fps": fps,
|
||||
"x": x,
|
||||
"y": y,
|
||||
"width": width,
|
||||
"height": height,
|
||||
"effectsFrameSkip": effectsFrameSkip,
|
||||
"windowScaling": windowScaling,
|
||||
"showTerminalSize": showTerminalSize,
|
||||
"fontScaling": fontScaling,
|
||||
"fontNames": fontNames,
|
||||
"showMenubar": showMenubar,
|
||||
"bloomQuality": bloomQuality,
|
||||
"burnInQuality": burnInQuality,
|
||||
"useCustomCommand": useCustomCommand,
|
||||
"customCommand": customCommand,
|
||||
"useFastBurnIn": useFastBurnIn,
|
||||
"blinkingCursor": blinkingCursor
|
||||
"customCommand": customCommand
|
||||
}
|
||||
return stringify(settings)
|
||||
}
|
||||
|
||||
function composeProfileObject() {
|
||||
var settings = {
|
||||
var profile = {
|
||||
"backgroundColor": _backgroundColor,
|
||||
"fontColor": _fontColor,
|
||||
"flickering": flickering,
|
||||
@@ -256,11 +193,17 @@ QtObject {
|
||||
"contrast": contrast,
|
||||
"ambientLight": ambientLight,
|
||||
"windowOpacity": windowOpacity,
|
||||
"fontName": fontNames[rasterization],
|
||||
"fontName": fontName,
|
||||
"fontSource": fontSource,
|
||||
"fontWidth": fontWidth,
|
||||
"margin": _margin
|
||||
"margin": _margin,
|
||||
"blinkingCursor": blinkingCursor,
|
||||
"frameSize": _frameSize,
|
||||
"screenRadius": _screenRadius,
|
||||
"frameColor": _frameColor,
|
||||
"frameShininess": _frameShininess
|
||||
}
|
||||
return settings
|
||||
return profile
|
||||
}
|
||||
|
||||
function composeProfileString() {
|
||||
@@ -302,16 +245,10 @@ QtObject {
|
||||
showTerminalSize = settings.showTerminalSize
|
||||
!== undefined ? settings.showTerminalSize : showTerminalSize
|
||||
|
||||
fps = settings.fps !== undefined ? settings.fps : fps
|
||||
effectsFrameSkip = settings.effectsFrameSkip !== undefined ? settings.effectsFrameSkip : effectsFrameSkip
|
||||
windowScaling = settings.windowScaling
|
||||
!== undefined ? settings.windowScaling : windowScaling
|
||||
|
||||
x = settings.x !== undefined ? settings.x : x
|
||||
y = settings.y !== undefined ? settings.y : y
|
||||
width = settings.width !== undefined ? settings.width : width
|
||||
height = settings.height !== undefined ? settings.height : height
|
||||
|
||||
fontNames = settings.fontNames !== undefined ? settings.fontNames : fontNames
|
||||
fontScaling = settings.fontScaling !== undefined ? settings.fontScaling : fontScaling
|
||||
|
||||
showMenubar = settings.showMenubar !== undefined ? settings.showMenubar : showMenubar
|
||||
@@ -324,12 +261,6 @@ QtObject {
|
||||
!== undefined ? settings.useCustomCommand : useCustomCommand
|
||||
customCommand = settings.customCommand
|
||||
!== undefined ? settings.customCommand : customCommand
|
||||
|
||||
useFastBurnIn = settings.useFastBurnIn
|
||||
!== undefined ? settings.useFastBurnIn : useFastBurnIn
|
||||
|
||||
blinkingCursor = settings.blinkingCursor
|
||||
!== undefined ? settings.blinkingCursor : blinkingCursor
|
||||
}
|
||||
|
||||
function loadProfileString(profileString) {
|
||||
@@ -366,13 +297,18 @@ QtObject {
|
||||
windowOpacity = settings.windowOpacity
|
||||
!== undefined ? settings.windowOpacity : windowOpacity
|
||||
|
||||
fontNames[rasterization] = settings.fontName
|
||||
!== undefined ? settings.fontName : fontNames[rasterization]
|
||||
fontName = settings.fontName !== undefined ? settings.fontName : fontName
|
||||
fontSource = settings.fontSource !== undefined ? settings.fontSource : fontSource
|
||||
fontWidth = settings.fontWidth !== undefined ? settings.fontWidth : fontWidth
|
||||
lineSpacing = settings.lineSpacing !== undefined ? settings.lineSpacing : lineSpacing
|
||||
|
||||
_margin = settings.margin !== undefined ? settings.margin : _margin
|
||||
_frameSize = settings.frameSize !== undefined ? settings.frameSize : _frameSize
|
||||
_screenRadius = settings.screenRadius !== undefined ? settings.screenRadius : _screenRadius
|
||||
_frameColor = settings.frameColor !== undefined ? settings.frameColor : _frameColor
|
||||
_frameShininess = settings.frameShininess !== undefined ? settings.frameShininess : _frameShininess
|
||||
|
||||
handleFontChanged()
|
||||
blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor
|
||||
}
|
||||
|
||||
function storeCustomProfiles() {
|
||||
@@ -431,243 +367,476 @@ QtObject {
|
||||
ListElement {
|
||||
text: "Default Amber"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.2,
|
||||
"ambientLight": 0.3,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.5538,
|
||||
"bloom": 0.6,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.2517,
|
||||
"chromaColor": 0.2483,
|
||||
"contrast": 0.7959,
|
||||
"burnIn": 0.3,
|
||||
"chromaColor": 0.2,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#ff8100",
|
||||
"fontName": "TERMINUS_SCALED",
|
||||
"fontName": "TERMINESS_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.2,
|
||||
"horizontalSync": 0.08,
|
||||
"jitter": 0.1997,
|
||||
"horizontalSync": 0.1,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0.2483,
|
||||
"screenCurvature": 0.3,
|
||||
"staticNoise": 0.1198,
|
||||
"saturationColor": 0.2,
|
||||
"screenCurvature": 0.4,
|
||||
"screenRadius": 0.1,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
"margin": 0.3,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.1,
|
||||
"frameColor": "#cfcfcf",
|
||||
"frameShininess": 0.3
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Monochrome Green"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.2,
|
||||
"ambientLight": 0.3,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.5538,
|
||||
"bloom": 0.5,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.2517,
|
||||
"burnIn": 0.3,
|
||||
"chromaColor": 0.0,
|
||||
"contrast": 0.7959,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#0ccc68",
|
||||
"fontName": "TERMINUS_SCALED",
|
||||
"fontName": "EXCELSIOR_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.2,
|
||||
"horizontalSync": 0.08,
|
||||
"jitter": 0.1997,
|
||||
"horizontalSync": 0.1,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0.0,
|
||||
"screenCurvature": 0.3,
|
||||
"staticNoise": 0.1198,
|
||||
"screenCurvature": 0.7,
|
||||
"screenRadius": 0.2,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
"margin": 0.3,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.1,
|
||||
"frameColor": "#d4d4d4",
|
||||
"frameShininess": 0.1
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Green Scanlines"
|
||||
text: "Deep Blue"
|
||||
obj_string: '{
|
||||
"ambientLight": 0,
|
||||
"ambientLight": 0.0,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.6,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.3,
|
||||
"chromaColor": 0.5,
|
||||
"contrast": 0.6,
|
||||
"chromaColor": 1.0,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#7cff4f",
|
||||
"fontName": "PRO_FONT_SCALED",
|
||||
"fontColor": "#7fb4ff",
|
||||
"fontName": "COZETTE_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.2,
|
||||
"horizontalSync": 0.151,
|
||||
"jitter": 0.11,
|
||||
"rasterization": 1,
|
||||
"horizontalSync": 0.1,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0.5,
|
||||
"screenCurvature": 0.3,
|
||||
"staticNoise": 0.15,
|
||||
"saturationColor": 0.2,
|
||||
"screenCurvature": 1.0,
|
||||
"screenRadius": 0.1,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
"margin": 0.3,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.1,
|
||||
"frameColor": "#ffffff",
|
||||
"frameShininess": 0.9
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Default Pixelated"
|
||||
text: "Commodore 64"
|
||||
obj_string: '{
|
||||
"ambientLight": 0,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.4045,
|
||||
"brightness": 0.6041,
|
||||
"burnIn": 0.1024,
|
||||
"chromaColor": 0.7517,
|
||||
"contrast": 0.7473,
|
||||
"flickering": 0.1962,
|
||||
"fontColor": "#ffffff",
|
||||
"fontName": "COMMODORE_PET",
|
||||
"ambientLight": 0.4,
|
||||
"backgroundColor": "#3b3b8f",
|
||||
"bloom": 0.4,
|
||||
"brightness": 0.6,
|
||||
"burnIn": 0.1,
|
||||
"chromaColor": 0.0,
|
||||
"contrast": 0.7,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#a9a7ff",
|
||||
"fontName": "COMMODORE_64_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"glowingLine": 0.2,
|
||||
"horizontalSync": 0.151,
|
||||
"jitter": 0,
|
||||
"rasterization": 2,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.1,
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0,
|
||||
"staticNoise": 0.15,
|
||||
"screenCurvature": 0.5,
|
||||
"screenRadius": 0.1,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
"margin": 0.3,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.5,
|
||||
"frameColor": "#444444",
|
||||
"frameShininess": 0.0
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Commodore PET"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.0,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.4,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.4,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.2,
|
||||
"fontColor": "#ffffff",
|
||||
"fontName": "COMMODORE_PET_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1.25,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.3,
|
||||
"horizontalSync": 0.2,
|
||||
"jitter": 0.15,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.1,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 1.0,
|
||||
"screenRadius": 0.3,
|
||||
"staticNoise": 0.2,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.2,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.8,
|
||||
"frameColor": "#000000",
|
||||
"frameShininess": 0.6
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Apple ]["
|
||||
obj_string: '{
|
||||
"ambientLight": 0.3038,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.5,
|
||||
"ambientLight": 1.0,
|
||||
"backgroundColor": "#001100",
|
||||
"bloom": 0.3,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.5017,
|
||||
"burnIn": 0.3,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.85,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.2,
|
||||
"fontColor": "#00d56d",
|
||||
"fontName": "APPLE_II",
|
||||
"fontWidth": 1,
|
||||
"glowingLine": 0.22,
|
||||
"horizontalSync": 0.16,
|
||||
"jitter": 0.1,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.5,
|
||||
"staticNoise": 0.099,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Vintage"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.5,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.4983,
|
||||
"brightness": 0.5014,
|
||||
"burnIn": 0.4983,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.7473,
|
||||
"flickering": 0.9,
|
||||
"fontColor": "#00ff3e",
|
||||
"fontName": "COMMODORE_PET",
|
||||
"fontWidth": 1,
|
||||
"fontColor": "#4dff6b",
|
||||
"fontName": "APPLE_II_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1.25,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.3,
|
||||
"horizontalSync": 0.42,
|
||||
"jitter": 0.4,
|
||||
"horizontalSync": 0.2,
|
||||
"jitter": 0.2,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.2969,
|
||||
"rbgShift": 0.1,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.5,
|
||||
"staticNoise": 0.2969,
|
||||
"screenCurvature": 1.0,
|
||||
"screenRadius": 0.3,
|
||||
"staticNoise": 0.2,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
"margin": 0.0,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.5,
|
||||
"frameColor": "#ffffff",
|
||||
"frameShininess": 0.8
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "IBM Dos"
|
||||
text: "Atari 400"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.151,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.2969,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.0469,
|
||||
"chromaColor": 1,
|
||||
"contrast": 0.85,
|
||||
"flickering": 0.0955,
|
||||
"fontColor": "#ffffff",
|
||||
"fontName": "IBM_DOS",
|
||||
"ambientLight": 0.1,
|
||||
"backgroundColor": "#0f1f5a",
|
||||
"bloom": 0.1,
|
||||
"brightness": 0.6,
|
||||
"burnIn": 0.2,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.9,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#8ed6ff",
|
||||
"fontName": "ATARI_400_SCALED",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"glowingLine": 0.1545,
|
||||
"horizontalSync": 0,
|
||||
"jitter": 0.1545,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0.3524,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.1,
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.4,
|
||||
"staticNoise": 0.0503,
|
||||
"screenCurvature": 0.3,
|
||||
"screenRadius": 0.2,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
"margin": 0.2,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.4,
|
||||
"frameColor": "#cccccc",
|
||||
"frameShininess": 0.3
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "IBM VGA 8x16"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.2,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.2,
|
||||
"brightness": 0.6,
|
||||
"burnIn": 0.1,
|
||||
"chromaColor": 0.5,
|
||||
"contrast": 1.0,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#c0c0c0",
|
||||
"fontName": "IBM_VGA_8x16",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.1,
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 1,
|
||||
"rbgShift": 0.15,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.3,
|
||||
"screenRadius": 0.1,
|
||||
"staticNoise": 0.0,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.2,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0.1,
|
||||
"frameColor": "#ffffff",
|
||||
"frameShininess": 0.3
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "IBM 3278"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.1,
|
||||
"ambientLight": 0.2,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.2969,
|
||||
"bloom": 0.2,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.6,
|
||||
"burnIn": 0.7,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.85,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0,
|
||||
"fontColor": "#0ccc68",
|
||||
"fontColor": "#3cff7a",
|
||||
"fontName": "IBM_3278",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"glowingLine": 0,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.0,
|
||||
"horizontalSync": 0,
|
||||
"jitter": 0,
|
||||
"rasterization": 0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0.2,
|
||||
"staticNoise": 0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
"staticNoise": 0.0,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.5
|
||||
"margin": 0.1,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0,
|
||||
"frameColor": "#ffffff",
|
||||
"frameShininess": 0.2
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Futuristic"
|
||||
text: "Neon Cyan"
|
||||
obj_string: '{
|
||||
"ambientLight": 0,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.5017,
|
||||
"brightness": 0.5014,
|
||||
"burnIn": 0.0955,
|
||||
"ambientLight": 0.1,
|
||||
"backgroundColor": "#001018",
|
||||
"bloom": 0.6,
|
||||
"brightness": 0.6,
|
||||
"burnIn": 0.1,
|
||||
"chromaColor": 1,
|
||||
"contrast": 0.85,
|
||||
"flickering": 0.2,
|
||||
"fontColor": "#729fcf",
|
||||
"fontName": "TERMINUS",
|
||||
"contrast": 0.9,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#52f7ff",
|
||||
"fontName": "IOSEVKA",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"glowingLine": 0.1476,
|
||||
"horizontalSync": 0,
|
||||
"jitter": 0.099,
|
||||
"rasterization": 0,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0.4983,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.2,
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.1,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0.0,
|
||||
"saturationColor": 0.6,
|
||||
"screenCurvature": 0,
|
||||
"staticNoise": 0.0955,
|
||||
"screenRadius": 0.0,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 0.8,
|
||||
"margin": 0.1,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0,
|
||||
"frameColor": "#c3c3c3",
|
||||
"frameShininess": 0.2
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Ghost Terminal"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.3,
|
||||
"backgroundColor": "#0b1014",
|
||||
"bloom": 0.3,
|
||||
"brightness": 0.6,
|
||||
"burnIn": 0.2,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.5,
|
||||
"flickering": 0.0,
|
||||
"fontColor": "#a6b3c0",
|
||||
"fontName": "JETBRAINS_MONO",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.1,
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0.1,
|
||||
"saturationColor": 0.0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 0.7,
|
||||
"margin": 0.1
|
||||
"margin": 0.1,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0,
|
||||
"frameColor": "#a7a7a7",
|
||||
"frameShininess": 0.2
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Plasma"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.1,
|
||||
"backgroundColor": "#070014",
|
||||
"bloom": 0.7,
|
||||
"brightness": 0.6,
|
||||
"burnIn": 0.1,
|
||||
"chromaColor": 1,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.1,
|
||||
"fontColor": "#ff9bd6",
|
||||
"fontName": "FIRA_CODE",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.2,
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.1,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0.1,
|
||||
"saturationColor": 0.8,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
"staticNoise": 0.1,
|
||||
"windowOpacity": 1.0,
|
||||
"margin": 0.1,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0,
|
||||
"frameColor": "#d0d0d0",
|
||||
"frameShininess": 0.2
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "Boring"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.1,
|
||||
"backgroundColor": "#000000",
|
||||
"bloom": 0.5,
|
||||
"brightness": 0.5,
|
||||
"burnIn": 0.05,
|
||||
"chromaColor": 1,
|
||||
"contrast": 0.8,
|
||||
"flickering": 0.0,
|
||||
"fontColor": "#ffffff",
|
||||
"fontName": "JETBRAINS_MONO",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.1,
|
||||
"horizontalSync": 0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0.0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
"staticNoise": 0.0,
|
||||
"windowOpacity": 1.0,
|
||||
"margin": 0.0,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0,
|
||||
"frameColor": "#c0c0c0",
|
||||
"frameShininess": 0.2
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
ListElement {
|
||||
text: "E-Ink"
|
||||
obj_string: '{
|
||||
"ambientLight": 0.6,
|
||||
"backgroundColor": "#f2f2ec",
|
||||
"bloom": 0.0,
|
||||
"brightness": 1.0,
|
||||
"burnIn": 0.6,
|
||||
"chromaColor": 0,
|
||||
"contrast": 0.5,
|
||||
"flickering": 0.0,
|
||||
"fontColor": "#101010",
|
||||
"fontName": "HACK",
|
||||
"fontSource": 0,
|
||||
"fontWidth": 1,
|
||||
"lineSpacing": 0.1,
|
||||
"glowingLine": 0.0,
|
||||
"horizontalSync": 0.0,
|
||||
"jitter": 0.0,
|
||||
"rasterization": 4,
|
||||
"rbgShift": 0,
|
||||
"saturationColor": 0,
|
||||
"screenCurvature": 0,
|
||||
"screenRadius": 0.0,
|
||||
"staticNoise": 0.0,
|
||||
"windowOpacity": 1,
|
||||
"margin": 0.1,
|
||||
"blinkingCursor": false,
|
||||
"frameSize": 0,
|
||||
"frameColor": "#cdcdcd",
|
||||
"frameShininess": 0.2
|
||||
}'
|
||||
builtin: true
|
||||
}
|
||||
@@ -708,17 +877,8 @@ QtObject {
|
||||
showMenubar = false
|
||||
}
|
||||
|
||||
if (args.indexOf("-T") !== -1) {
|
||||
wintitle = args[args.indexOf("-T") + 1]
|
||||
}
|
||||
|
||||
initializedSettings()
|
||||
}
|
||||
Component.onDestruction: {
|
||||
storeSettings()
|
||||
storeCustomProfiles()
|
||||
// storage.dropSettings(); //DROPS THE SETTINGS!.. REMEMBER TO DISABLE ONCE ENABLED!!
|
||||
}
|
||||
|
||||
// VARS ///////////////////////////////////////////////////////////////////
|
||||
property Label _sampleLabel: Label {
|
||||
|
||||
@@ -24,31 +24,34 @@ import "utils.js" as Utils
|
||||
Loader {
|
||||
id: burnInEffect
|
||||
|
||||
property ShaderEffectSource source: item ? item.source : null
|
||||
property ShaderEffectSource effectSource: item ? item.source : null
|
||||
|
||||
property real lastUpdate: 0
|
||||
property real prevLastUpdate: 0
|
||||
|
||||
property real delay: (1.0 / appSettings.fps) * 1000
|
||||
property real burnIn: appSettings.burnIn
|
||||
property real burnInFadeTime: 1 / Utils.lint(_minBurnInFadeTime, _maxBurnInFadeTime, burnIn)
|
||||
property real _minBurnInFadeTime: appSettings.minBurnInFadeTime
|
||||
property real _maxBurnInFadeTime: appSettings.maxBurnInFadeTime
|
||||
|
||||
active: appSettings.useFastBurnIn && appSettings.burnIn !== 0
|
||||
active: appSettings.burnIn !== 0
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
function completelyUpdate() {
|
||||
prevLastUpdate = lastUpdate;
|
||||
lastUpdate = timeManager.time;
|
||||
item.source.scheduleUpdate();
|
||||
let newTime = timeManager.time
|
||||
if (newTime > lastUpdate) {
|
||||
prevLastUpdate = lastUpdate
|
||||
lastUpdate = newTime
|
||||
}
|
||||
|
||||
item.source.scheduleUpdate()
|
||||
}
|
||||
|
||||
function restartBlurSource(){
|
||||
prevLastUpdate = timeManager.time;
|
||||
lastUpdate = prevLastUpdate;
|
||||
completelyUpdate();
|
||||
function restartBlurSource() {
|
||||
prevLastUpdate = timeManager.time
|
||||
lastUpdate = prevLastUpdate
|
||||
completelyUpdate()
|
||||
}
|
||||
|
||||
sourceComponent: Item {
|
||||
@@ -72,73 +75,53 @@ Loader {
|
||||
|
||||
Connections {
|
||||
target: kterminal
|
||||
onImagePainted: completelyUpdate()
|
||||
|
||||
onImagePainted: {
|
||||
completelyUpdate()
|
||||
}
|
||||
}
|
||||
// Restart blurred source settings change.
|
||||
Connections{
|
||||
target: appSettings
|
||||
onBurnInChanged: burnInEffect.restartBlurSource();
|
||||
onTerminalFontChanged: burnInEffect.restartBlurSource();
|
||||
onRasterizationChanged: burnInEffect.restartBlurSource();
|
||||
onBurnInQualityChanged: burnInEffect.restartBlurSource();
|
||||
Connections {
|
||||
target: appSettings.fontManager
|
||||
|
||||
onTerminalFontChanged: {
|
||||
burnInEffect.restartBlurSource()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: kterminalScrollbar
|
||||
onOpacityChanged: completelyUpdate()
|
||||
target: appSettings
|
||||
|
||||
onBurnInChanged: {
|
||||
burnInEffect.restartBlurSource()
|
||||
}
|
||||
|
||||
onRasterizationChanged: {
|
||||
burnInEffect.restartBlurSource()
|
||||
}
|
||||
|
||||
onBurnInQualityChanged: {
|
||||
burnInEffect.restartBlurSource()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShaderEffect {
|
||||
id: burnInShaderEffect
|
||||
|
||||
property real time: timeManager.time
|
||||
|
||||
property variant txt_source: kterminalSource
|
||||
property variant burnInSource: burnInEffectSource
|
||||
property real burnInTime: burnInFadeTime
|
||||
property real lastUpdate: burnInEffect.lastUpdate
|
||||
property real burnInLastUpdate: burnInEffect.lastUpdate
|
||||
property real prevLastUpdate: burnInEffect.prevLastUpdate
|
||||
|
||||
anchors.fill: parent
|
||||
blending: false
|
||||
|
||||
fragmentShader:
|
||||
"#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif\n" +
|
||||
|
||||
"uniform lowp float qt_Opacity;" +
|
||||
"uniform lowp sampler2D txt_source;" +
|
||||
|
||||
"varying highp vec2 qt_TexCoord0;
|
||||
|
||||
uniform lowp sampler2D burnInSource;
|
||||
uniform highp float burnInTime;
|
||||
|
||||
uniform highp float lastUpdate;
|
||||
|
||||
uniform highp float prevLastUpdate;" +
|
||||
|
||||
"float rgb2grey(vec3 v){
|
||||
return dot(v, vec3(0.21, 0.72, 0.04));
|
||||
}" +
|
||||
|
||||
"void main() {
|
||||
vec2 coords = qt_TexCoord0;
|
||||
|
||||
vec3 txtColor = texture2D(txt_source, coords).rgb;
|
||||
vec4 accColor = texture2D(burnInSource, coords);
|
||||
|
||||
float prevMask = accColor.a;
|
||||
float currMask = rgb2grey(txtColor);
|
||||
|
||||
highp float blurDecay = clamp((lastUpdate - prevLastUpdate) * burnInTime, 0.0, 1.0);
|
||||
blurDecay = max(0.0, blurDecay - prevMask);
|
||||
vec3 blurColor = accColor.rgb - vec3(blurDecay);
|
||||
vec3 color = max(blurColor, txtColor);
|
||||
|
||||
gl_FragColor = vec4(color, currMask);
|
||||
}
|
||||
"
|
||||
fragmentShader: "qrc:/shaders/burn_in.frag.qsb"
|
||||
vertexShader: "qrc:/shaders/burn_in.vert.qsb"
|
||||
|
||||
onStatusChanged: if (log) console.log(log) //Print warning messages
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Dialogs
|
||||
|
||||
Item {
|
||||
id: rootItem
|
||||
@@ -31,13 +31,13 @@ Item {
|
||||
id: colorDialog
|
||||
title: qsTr("Choose a color")
|
||||
modality: Qt.ApplicationModal
|
||||
visible: false
|
||||
selectedColor: rootItem.color
|
||||
|
||||
//This is a workaround to a Qt 5.2 bug.
|
||||
onColorChanged: if (Qt.platform.os !== "osx")
|
||||
colorSelected(color)
|
||||
onAccepted: if (Qt.platform.os === "osx")
|
||||
colorSelected(color)
|
||||
onSelectedColorChanged: {
|
||||
if (!appSettings.isMacOS && visible)
|
||||
colorSelected(selectedColor)
|
||||
}
|
||||
onAccepted: colorSelected(selectedColor)
|
||||
}
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
@@ -59,6 +59,6 @@ Item {
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: colorDialog.visible = true
|
||||
onClicked: colorDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,107 +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.2
|
||||
|
||||
QtObject {
|
||||
property int selectedFontIndex
|
||||
property real scaling
|
||||
property var _font: fontlist.get(selectedFontIndex)
|
||||
property var source: _font.source
|
||||
property int pixelSize: _font.pixelSize
|
||||
property int lineSpacing: _font.lineSpacing
|
||||
property real screenScaling: scaling * _font.baseScaling
|
||||
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
|
||||
property bool lowResolutionFont: true
|
||||
|
||||
property ListModel fontlist: ListModel {
|
||||
ListElement {
|
||||
name: "COMMODORE_PET"
|
||||
text: "Commodore PET (1977)"
|
||||
source: "fonts/1977-commodore-pet/PetMe.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
}
|
||||
ListElement {
|
||||
name: "IBM_PC"
|
||||
text: "IBM PC (1981)"
|
||||
source: "fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
}
|
||||
ListElement {
|
||||
name: "PROGGY_TINY"
|
||||
text: "Proggy Tiny (Modern)"
|
||||
source: "fonts/modern-proggy-tiny/ProggyTiny.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 16
|
||||
baseScaling: 3.3
|
||||
fontWidth: 0.9
|
||||
}
|
||||
ListElement {
|
||||
name: "TERMINUS_SCALED"
|
||||
text: "Terminus (Modern)"
|
||||
source: "fonts/modern-terminus/TerminusTTF-4.46.0.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 12
|
||||
baseScaling: 3.0
|
||||
fontWidth: 1.0
|
||||
}
|
||||
ListElement {
|
||||
name: "PRO_FONT_SCALED"
|
||||
text: "Pro Font (Modern)"
|
||||
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 12
|
||||
baseScaling: 3.0
|
||||
fontWidth: 1.0
|
||||
}
|
||||
ListElement {
|
||||
name: "APPLE_II"
|
||||
text: "Apple ][ (1977)"
|
||||
source: "fonts/1977-apple2/PrintChar21.ttf"
|
||||
lineSpacing: 2
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.9
|
||||
}
|
||||
ListElement {
|
||||
name: "ATARI_400"
|
||||
text: "Atari 400-800 (1979)"
|
||||
source: "fonts/1979-atari-400-800/AtariClassic-Regular.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
}
|
||||
ListElement {
|
||||
name: "COMMODORE_64"
|
||||
text: "Commodore 64 (1982)"
|
||||
source: "fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,107 +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.2
|
||||
|
||||
QtObject {
|
||||
property int selectedFontIndex
|
||||
property real scaling
|
||||
property var _font: fontlist.get(selectedFontIndex)
|
||||
property var source: _font.source
|
||||
property int pixelSize: _font.pixelSize
|
||||
property int lineSpacing: _font.lineSpacing
|
||||
property real screenScaling: scaling * _font.baseScaling
|
||||
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
|
||||
property bool lowResolutionFont: true
|
||||
|
||||
property ListModel fontlist: ListModel {
|
||||
ListElement {
|
||||
name: "COMMODORE_PET"
|
||||
text: "Commodore PET (1977)"
|
||||
source: "fonts/1977-commodore-pet/PetMe.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.7
|
||||
}
|
||||
ListElement {
|
||||
name: "IBM_PC"
|
||||
text: "IBM PC (1981)"
|
||||
source: "fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
}
|
||||
ListElement {
|
||||
name: "PROGGY_TINY"
|
||||
text: "Proggy Tiny (Modern)"
|
||||
source: "fonts/modern-proggy-tiny/ProggyTiny.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 16
|
||||
baseScaling: 3.3
|
||||
fontWidth: 0.9
|
||||
}
|
||||
ListElement {
|
||||
name: "TERMINUS_SCALED"
|
||||
text: "Terminus (Modern)"
|
||||
source: "fonts/modern-terminus/TerminusTTF-4.46.0.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 12
|
||||
baseScaling: 3.0
|
||||
fontWidth: 1.0
|
||||
}
|
||||
ListElement {
|
||||
name: "PRO_FONT_SCALED"
|
||||
text: "Pro Font (Modern)"
|
||||
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 12
|
||||
baseScaling: 3.0
|
||||
fontWidth: 1.0
|
||||
}
|
||||
ListElement {
|
||||
name: "APPLE_II"
|
||||
text: "Apple ][ (1977)"
|
||||
source: "fonts/1977-apple2/PrintChar21.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
}
|
||||
ListElement {
|
||||
name: "ATARI_400"
|
||||
text: "Atari 400-800 (1979)"
|
||||
source: "fonts/1979-atari-400-800/AtariClassic-Regular.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.7
|
||||
}
|
||||
ListElement {
|
||||
name: "COMMODORE_64"
|
||||
text: "Commodore 64 (1982)"
|
||||
source: "fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.7
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,252 +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.2
|
||||
|
||||
QtObject {
|
||||
property int selectedFontIndex
|
||||
property real scaling
|
||||
property var source: fontlist.get(selectedFontIndex).source
|
||||
property var _font: fontlist.get(selectedFontIndex)
|
||||
property bool lowResolutionFont: _font.lowResolutionFont
|
||||
|
||||
property int pixelSize: lowResolutionFont ? _font.pixelSize : _font.pixelSize * scaling
|
||||
|
||||
property int lineSpacing: lowResolutionFont ? _font.lineSpacing : pixelSize * _font.lineSpacing
|
||||
|
||||
property real screenScaling: lowResolutionFont ? _font.baseScaling * scaling : 1.0
|
||||
|
||||
property real defaultFontWidth: fontlist.get(selectedFontIndex).fontWidth
|
||||
|
||||
property string family: fontlist.get(selectedFontIndex).family
|
||||
|
||||
property bool isSystemFont: fontlist.get(selectedFontIndex).isSystemFont
|
||||
|
||||
// There are two kind of fonts: low resolution and high resolution.
|
||||
// Low resolution font sets the lowResolutionFont property to true.
|
||||
// They are rendered at a fixed pixel size and the texture is upscaled
|
||||
// to fill the screen (they are much faster to render).
|
||||
// High resolution fonts are instead drawn on a texture which has the
|
||||
// size of the screen, and the scaling directly controls their pixels size.
|
||||
// Those are slower to render but are not pixelated.
|
||||
property ListModel fontlist: ListModel {
|
||||
ListElement {
|
||||
name: "TERMINUS_SCALED"
|
||||
text: "Terminus (Modern)"
|
||||
source: "fonts/modern-terminus/TerminusTTF-4.46.0.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 12
|
||||
baseScaling: 3.0
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "PRO_FONT_SCALED"
|
||||
text: "Pro Font (Modern)"
|
||||
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 12
|
||||
baseScaling: 3.0
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "EXCELSIOR_SCALED"
|
||||
text: "Fixedsys Excelsior (Modern)"
|
||||
source: "fonts/modern-fixedsys-excelsior/FSEX301-L2.ttf"
|
||||
lineSpacing: 0
|
||||
pixelSize: 16
|
||||
baseScaling: 2.4
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "COMMODORE_PET_SCALED"
|
||||
text: "Commodore PET (1977)"
|
||||
source: "fonts/1977-commodore-pet/PetMe.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.7
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "PROGGY_TINY_SCALED"
|
||||
text: "Proggy Tiny (Modern)"
|
||||
source: "fonts/modern-proggy-tiny/ProggyTiny.ttf"
|
||||
lineSpacing: 1
|
||||
pixelSize: 16
|
||||
baseScaling: 3.3
|
||||
fontWidth: 0.9
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "APPLE_II_SCALED"
|
||||
text: "Apple ][ (1977)"
|
||||
source: "fonts/1977-apple2/PrintChar21.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "ATARI_400_SCALED"
|
||||
text: "Atari 400-800 (1979)"
|
||||
source: "fonts/1979-atari-400-800/AtariClassic-Regular.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.7
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "IBM_PC_SCALED"
|
||||
text: "IBM PC (1981)"
|
||||
source: "fonts/1981-ibm-pc/PxPlus_IBM_BIOS.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.8
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "COMMODORE_64_SCALED"
|
||||
text: "Commodore 64 (1982)"
|
||||
source: "fonts/1982-commodore64/C64_Pro_Mono-STYLE.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 8
|
||||
baseScaling: 3.5
|
||||
fontWidth: 0.7
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "IBM_DOS"
|
||||
text: "IBM DOS (1985)"
|
||||
source: "fonts/1985-ibm-pc-vga/PxPlus_IBM_VGA8.ttf"
|
||||
lineSpacing: 3
|
||||
pixelSize: 16
|
||||
baseScaling: 2.0
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: true
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "HERMIT"
|
||||
text: "HD: Hermit (Modern)"
|
||||
source: "fonts/modern-hermit/Hermit-medium.otf"
|
||||
lineSpacing: 0.05
|
||||
pixelSize: 27
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: false
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "TERMINUS"
|
||||
text: "HD: Terminus (Modern)"
|
||||
source: "fonts/modern-terminus/TerminusTTF-4.46.0.ttf"
|
||||
lineSpacing: 0.1
|
||||
pixelSize: 35
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: false
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "PRO_FONT"
|
||||
text: "HD: Pro Font (Modern)"
|
||||
source: "fonts/modern-pro-font-win-tweaked/ProFontWindows.ttf"
|
||||
lineSpacing: 0.1
|
||||
pixelSize: 35
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: false
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "INCONSOLATA"
|
||||
text: "HD: Inconsolata (Modern)"
|
||||
source: "fonts/modern-inconsolata/Inconsolata.otf"
|
||||
lineSpacing: 0.1
|
||||
pixelSize: 35
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: false
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
ListElement {
|
||||
name: "IBM_3278"
|
||||
text: "HD: IBM 3278 (1971)"
|
||||
source: "fonts/1971-ibm-3278/3270Medium.ttf"
|
||||
lineSpacing: 0.2
|
||||
pixelSize: 32
|
||||
fontWidth: 1.0
|
||||
lowResolutionFont: false
|
||||
isSystemFont: false
|
||||
family: ""
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: addSystemFonts()
|
||||
|
||||
function addSystemFonts() {
|
||||
var families = monospaceSystemFonts
|
||||
for (var i = 0; i < families.length; i++) {
|
||||
if (verbose) {
|
||||
console.log("Adding system font: ", families[i])
|
||||
}
|
||||
fontlist.append(convertToListElement(families[i]))
|
||||
}
|
||||
}
|
||||
|
||||
function convertToListElement(family) {
|
||||
return {
|
||||
"name": "System: " + family,
|
||||
"text": qsTr("System: ") + family,
|
||||
"source": "",
|
||||
"lineSpacing": 0.1,
|
||||
"pixelSize": 30,
|
||||
"fontWidth": 1.0,
|
||||
"baseScaling": 1.0,
|
||||
"lowResolutionFont": false,
|
||||
"isSystemFont": true,
|
||||
"family": family
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import QtQuick 2.2
|
||||
import QtQuick.Window 2.0
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Dialogs
|
||||
|
||||
Window {
|
||||
id: insertnamedialog
|
||||
|
||||
@@ -1,97 +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.0
|
||||
|
||||
import "utils.js" as Utils
|
||||
|
||||
ShaderEffect {
|
||||
property color _staticFrameColor: "#ffffff"
|
||||
property color _backgroundColor: appSettings.backgroundColor
|
||||
property color _fontColor: appSettings.fontColor
|
||||
property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)
|
||||
property real _ambientLight: Utils.lint(0.2, 0.8, appSettings.ambientLight)
|
||||
|
||||
property color frameColor: Utils.mix(_staticFrameColor, _lightColor, _ambientLight)
|
||||
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
|
||||
property real shadowLength: 0.5 * screenCurvature * Utils.lint(0.50, 1.5, _ambientLight)
|
||||
|
||||
property size aadelta: Qt.size(1.0 / width, 1.0 / height)
|
||||
|
||||
fragmentShader: "
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform lowp float screenCurvature;
|
||||
uniform lowp float shadowLength;
|
||||
uniform highp float qt_Opacity;
|
||||
uniform lowp vec4 frameColor;
|
||||
uniform mediump vec2 aadelta;
|
||||
|
||||
varying highp vec2 qt_TexCoord0;
|
||||
|
||||
vec2 distortCoordinates(vec2 coords){
|
||||
vec2 cc = (coords - vec2(0.5));
|
||||
float dist = dot(cc, cc) * screenCurvature;
|
||||
return (coords + cc * (1.0 + dist) * dist);
|
||||
}
|
||||
|
||||
float max2(vec2 v) {
|
||||
return max(v.x, v.y);
|
||||
}
|
||||
|
||||
float min2(vec2 v) {
|
||||
return min(v.x, v.y);
|
||||
}
|
||||
|
||||
float prod2(vec2 v) {
|
||||
return v.x * v.y;
|
||||
}
|
||||
|
||||
float sum2(vec2 v) {
|
||||
return v.x + v.y;
|
||||
}
|
||||
|
||||
void main(){
|
||||
vec2 staticCoords = qt_TexCoord0;
|
||||
vec2 coords = distortCoordinates(staticCoords);
|
||||
|
||||
vec3 color = vec3(0.0);
|
||||
float alpha = 0.0;
|
||||
|
||||
float outShadowLength = shadowLength;
|
||||
float inShadowLength = shadowLength * 0.5;
|
||||
|
||||
float outShadow = max2(1.0 - smoothstep(vec2(-outShadowLength), vec2(0.0), coords) + smoothstep(vec2(1.0), vec2(1.0 + outShadowLength), coords));
|
||||
outShadow = clamp(sqrt(outShadow), 0.0, 1.0);
|
||||
color += frameColor.rgb * outShadow;
|
||||
alpha = sum2(1.0 - smoothstep(vec2(0.0), aadelta, coords) + smoothstep(vec2(1.0) - aadelta, vec2(1.0), coords));
|
||||
alpha = clamp(alpha, 0.0, 1.0) * mix(1.0, 0.9, outShadow);
|
||||
|
||||
float inShadow = 1.0 - prod2(smoothstep(0.0, inShadowLength, coords) - smoothstep(1.0 - inShadowLength, 1.0, coords));
|
||||
inShadow = 0.5 * inShadow * inShadow;
|
||||
alpha = max(alpha, inShadow);
|
||||
|
||||
gl_FragColor = vec4(color * alpha, alpha);
|
||||
}
|
||||
"
|
||||
|
||||
onStatusChanged: if (log) console.log(log) //Print warning messages
|
||||
}
|
||||
@@ -28,13 +28,13 @@ import "utils.js" as Utils
|
||||
|
||||
Item{
|
||||
id: terminalContainer
|
||||
signal sessionFinished()
|
||||
|
||||
property size virtualResolution: Qt.size(kterminal.totalWidth, kterminal.totalHeight)
|
||||
property alias mainTerminal: kterminal
|
||||
|
||||
property ShaderEffectSource mainSource: kterminalSource
|
||||
property BurnInEffect burnInEffect: burnInEffect
|
||||
property SlowBurnIn slowBurnInEffect: slowBurnInEffect
|
||||
property real fontWidth: 1.0
|
||||
property real screenScaling: 1.0
|
||||
property real scaleTexture: 1.0
|
||||
@@ -45,34 +45,53 @@ Item{
|
||||
property size fontMetrics: kterminal.fontMetrics
|
||||
|
||||
// Manage copy and paste
|
||||
Connections{
|
||||
Connections {
|
||||
target: copyAction
|
||||
onTriggered: kterminal.copyClipboard();
|
||||
|
||||
onTriggered: {
|
||||
kterminal.copyClipboard()
|
||||
}
|
||||
}
|
||||
Connections{
|
||||
Connections {
|
||||
target: pasteAction
|
||||
onTriggered: kterminal.pasteClipboard()
|
||||
|
||||
onTriggered: {
|
||||
kterminal.pasteClipboard()
|
||||
}
|
||||
}
|
||||
|
||||
//When settings are updated sources need to be redrawn.
|
||||
Connections{
|
||||
Connections {
|
||||
target: appSettings
|
||||
onFontScalingChanged: terminalContainer.updateSources();
|
||||
onFontWidthChanged: terminalContainer.updateSources();
|
||||
|
||||
onFontScalingChanged: {
|
||||
terminalContainer.updateSources()
|
||||
}
|
||||
|
||||
onFontWidthChanged: {
|
||||
terminalContainer.updateSources()
|
||||
}
|
||||
}
|
||||
Connections{
|
||||
Connections {
|
||||
target: terminalContainer
|
||||
onWidthChanged: terminalContainer.updateSources();
|
||||
onHeightChanged: terminalContainer.updateSources();
|
||||
|
||||
onWidthChanged: {
|
||||
terminalContainer.updateSources()
|
||||
}
|
||||
|
||||
onHeightChanged: {
|
||||
terminalContainer.updateSources()
|
||||
}
|
||||
}
|
||||
|
||||
function updateSources() {
|
||||
kterminal.update();
|
||||
kterminal.update()
|
||||
}
|
||||
|
||||
QMLTermWidget {
|
||||
id: kterminal
|
||||
|
||||
property int textureResolutionScale: appSettings.lowResolutionFont ? devicePixelRatio : 1
|
||||
property int textureResolutionScale: appSettings.lowResolutionFont ? Screen.devicePixelRatio : 1
|
||||
property int margin: appSettings.margin / screenScaling
|
||||
property int totalWidth: Math.floor(parent.width / (screenScaling * fontWidth))
|
||||
property int totalHeight: Math.floor(parent.height / screenScaling)
|
||||
@@ -82,26 +101,24 @@ Item{
|
||||
|
||||
textureSize: Qt.size(width / textureResolutionScale, height / textureResolutionScale)
|
||||
|
||||
width: ensureMultiple(rawWidth, devicePixelRatio)
|
||||
height: ensureMultiple(rawHeight, devicePixelRatio)
|
||||
width: ensureMultiple(rawWidth, Screen.devicePixelRatio)
|
||||
height: ensureMultiple(rawHeight, Screen.devicePixelRatio)
|
||||
|
||||
/** Ensure size is a multiple of factor. This is needed for pixel perfect scaling on highdpi screens. */
|
||||
function ensureMultiple(size, factor) {
|
||||
return Math.round(size / factor) * factor;
|
||||
}
|
||||
|
||||
colorScheme: "cool-retro-term"
|
||||
|
||||
smooth: !appSettings.lowResolutionFont
|
||||
enableBold: false
|
||||
fullCursorHeight: true
|
||||
blinkingCursor: appSettings.blinkingCursor
|
||||
|
||||
colorScheme: "cool-retro-term"
|
||||
|
||||
session: QMLTermSession {
|
||||
id: ksession
|
||||
|
||||
onFinished: {
|
||||
Qt.quit()
|
||||
terminalContainer.sessionFinished()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,26 +132,35 @@ Item{
|
||||
anchors.topMargin: 1
|
||||
anchors.bottomMargin: 1
|
||||
color: "white"
|
||||
radius: width * 0.25
|
||||
opacity: 0.7
|
||||
}
|
||||
}
|
||||
|
||||
function handleFontChanged(fontFamily, pixelSize, lineSpacing, screenScaling, fontWidth) {
|
||||
kterminal.antialiasText = !appSettings.lowResolutionFont;
|
||||
font.pixelSize = pixelSize;
|
||||
font.family = fontFamily;
|
||||
function handleFontChanged(fontFamily, pixelSize, lineSpacing, screenScaling, fontWidth, fallbackFontFamily, lowResolutionFont) {
|
||||
kterminal.lineSpacing = lineSpacing;
|
||||
kterminal.antialiasText = !lowResolutionFont;
|
||||
kterminal.smooth = !lowResolutionFont;
|
||||
kterminal.enableBold = !lowResolutionFont;
|
||||
|
||||
kterminal.font = Qt.font({
|
||||
family: fontFamily,
|
||||
pixelSize: pixelSize
|
||||
});
|
||||
|
||||
terminalContainer.fontWidth = fontWidth;
|
||||
terminalContainer.screenScaling = screenScaling;
|
||||
scaleTexture = Math.max(1.0, Math.floor(screenScaling * appSettings.windowScaling));
|
||||
}
|
||||
|
||||
kterminal.lineSpacing = lineSpacing;
|
||||
Connections {
|
||||
target: appSettings
|
||||
|
||||
onWindowScalingChanged: {
|
||||
scaleTexture = Math.max(1.0, Math.floor(terminalContainer.screenScaling * appSettings.windowScaling));
|
||||
}
|
||||
}
|
||||
|
||||
function startSession() {
|
||||
appSettings.initializedSettings.disconnect(startSession);
|
||||
|
||||
// Retrieve the variable set in main.cpp if arguments are passed.
|
||||
if (defaultCmd) {
|
||||
ksession.setShellProgram(defaultCmd);
|
||||
@@ -143,7 +169,7 @@ Item{
|
||||
var args = Utils.tokenizeCommandLine(appSettings.customCommand);
|
||||
ksession.setShellProgram(args[0]);
|
||||
ksession.setArgs(args.slice(1));
|
||||
} else if (!defaultCmd && Qt.platform.os === "osx") {
|
||||
} else if (!defaultCmd && appSettings.isMacOS) {
|
||||
// OSX Requires the following default parameters for auto login.
|
||||
ksession.setArgs(["-i", "-l"]);
|
||||
}
|
||||
@@ -155,9 +181,9 @@ Item{
|
||||
forceActiveFocus();
|
||||
}
|
||||
Component.onCompleted: {
|
||||
appSettings.terminalFontChanged.connect(handleFontChanged);
|
||||
appSettings.initializedSettings.connect(startSession);
|
||||
appSettings.handleFontChanged()
|
||||
appSettings.fontManager.terminalFontChanged.connect(handleFontChanged);
|
||||
appSettings.fontManager.refresh()
|
||||
startSession();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,54 +199,61 @@ Item{
|
||||
|
||||
Loader {
|
||||
id: menuLoader
|
||||
sourceComponent: (Qt.platform.os === "osx" || appSettings.showMenubar ? shortContextMenu : fullContextMenu)
|
||||
sourceComponent: (appSettings.isMacOS || appSettings.showMenubar ? shortContextMenu : fullContextMenu)
|
||||
}
|
||||
property alias contextmenu: menuLoader.item
|
||||
|
||||
MouseArea{
|
||||
MouseArea {
|
||||
property real margin: appSettings.margin
|
||||
property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale
|
||||
|
||||
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
||||
anchors.fill: parent
|
||||
cursorShape: kterminal.terminalUsesMouse ? Qt.ArrowCursor : Qt.IBeamCursor
|
||||
onWheel:{
|
||||
if(wheel.modifiers & Qt.ControlModifier){
|
||||
onWheel: function(wheel) {
|
||||
if (wheel.modifiers & Qt.ControlModifier) {
|
||||
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();
|
||||
} else {
|
||||
var coord = correctDistortion(wheel.x, wheel.y);
|
||||
kterminal.simulateWheel(coord.x, coord.y, wheel.buttons, wheel.modifiers, wheel.angleDelta);
|
||||
}
|
||||
}
|
||||
onDoubleClicked: {
|
||||
onDoubleClicked: function(mouse) {
|
||||
var coord = correctDistortion(mouse.x, mouse.y);
|
||||
kterminal.simulateMouseDoubleClick(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
|
||||
}
|
||||
onPressed: {
|
||||
if((!kterminal.terminalUsesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
|
||||
onPressed: function(mouse) {
|
||||
kterminal.forceActiveFocus()
|
||||
if ((!kterminal.terminalUsesMouse || mouse.modifiers & Qt.ShiftModifier) && mouse.button == Qt.RightButton) {
|
||||
contextmenu.popup();
|
||||
} else {
|
||||
var coord = correctDistortion(mouse.x, mouse.y);
|
||||
kterminal.simulateMousePress(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers)
|
||||
}
|
||||
}
|
||||
onReleased: {
|
||||
onReleased: function(mouse) {
|
||||
var coord = correctDistortion(mouse.x, mouse.y);
|
||||
kterminal.simulateMouseRelease(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
|
||||
}
|
||||
onPositionChanged: {
|
||||
onPositionChanged: function(mouse) {
|
||||
var coord = correctDistortion(mouse.x, mouse.y);
|
||||
kterminal.simulateMouseMove(coord.x, coord.y, mouse.button, mouse.buttons, mouse.modifiers);
|
||||
}
|
||||
|
||||
function correctDistortion(x, y){
|
||||
function correctDistortion(x, y) {
|
||||
x = (x - margin) / width;
|
||||
y = (y - margin) / height;
|
||||
|
||||
var cc = Qt.size(0.5 - x, 0.5 - y);
|
||||
var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature * appSettings.screenCurvatureSize;
|
||||
x = x * (1 + frameSize * 2) - frameSize;
|
||||
y = y * (1 + frameSize * 2) - frameSize;
|
||||
|
||||
return Qt.point((x - cc.width * (1+distortion) * distortion) * kterminal.totalWidth,
|
||||
(y - cc.height * (1+distortion) * distortion) * kterminal.totalHeight)
|
||||
var cc = Qt.size(0.5 - x, 0.5 - y);
|
||||
var distortion = (cc.height * cc.height + cc.width * cc.width)
|
||||
* appSettings.screenCurvature * appSettings.screenCurvatureSize
|
||||
* terminalWindow.normalizedWindowScale;
|
||||
|
||||
return Qt.point((x - cc.width * (1+distortion) * distortion) * (kterminal.totalWidth),
|
||||
(y - cc.height * (1+distortion) * distortion) * (kterminal.totalHeight))
|
||||
}
|
||||
}
|
||||
ShaderEffectSource{
|
||||
@@ -250,9 +283,5 @@ Item{
|
||||
BurnInEffect {
|
||||
id: burnInEffect
|
||||
}
|
||||
|
||||
SlowBurnIn {
|
||||
id: slowBurnInEffect
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,9 @@ import "Components"
|
||||
ColumnLayout {
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
title: qsTr("Command")
|
||||
padding: appSettings.defaultMargin
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
@@ -60,9 +62,32 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Performance")
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: appSettings.defaultMargin
|
||||
GridLayout {
|
||||
anchors.fill: parent
|
||||
columns: 4
|
||||
@@ -73,24 +98,17 @@ ColumnLayout {
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
id: fpsSlider
|
||||
onValueChanged: {
|
||||
if (enabled) {
|
||||
appSettings.fps = value !== 60 ? value + 1 : 0
|
||||
}
|
||||
}
|
||||
id: effectsFpsSlider
|
||||
onValueChanged: appSettings.effectsFrameSkip = Math.round(value)
|
||||
stepSize: 1
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0
|
||||
to = 60
|
||||
value = appSettings.fps !== 0 ? appSettings.fps - 1 : 60
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 5
|
||||
to: 1
|
||||
value: appSettings.effectsFrameSkip
|
||||
}
|
||||
|
||||
Label {
|
||||
text: appSettings.fps !== 0 ? appSettings.fps : qsTr("Max")
|
||||
SizedLabel {
|
||||
text: Math.round(100 / Math.max(1, Math.round(effectsFpsSlider.value))) + "%"
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Texture Quality")
|
||||
@@ -99,17 +117,13 @@ ColumnLayout {
|
||||
id: txtslider
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
onValueChanged: if (enabled)
|
||||
appSettings.windowScaling = value
|
||||
onValueChanged: appSettings.windowScaling = value
|
||||
stepSize: 0.05
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0.25 //Without this value gets set to 0.5
|
||||
value = appSettings.windowScaling
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 0.25
|
||||
value: appSettings.windowScaling
|
||||
}
|
||||
Label {
|
||||
SizedLabel {
|
||||
text: Math.round(txtslider.value * 100) + "%"
|
||||
}
|
||||
|
||||
@@ -120,17 +134,13 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
id: bloomSlider
|
||||
onValueChanged: if (enabled)
|
||||
appSettings.bloomQuality = value
|
||||
onValueChanged: appSettings.bloomQuality = value
|
||||
stepSize: 0.05
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0.25
|
||||
value = appSettings.bloomQuality
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 0.25
|
||||
value: appSettings.bloomQuality
|
||||
}
|
||||
Label {
|
||||
SizedLabel {
|
||||
text: Math.round(bloomSlider.value * 100) + "%"
|
||||
}
|
||||
|
||||
@@ -141,25 +151,15 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
id: burnInSlider
|
||||
Layout.columnSpan: 2
|
||||
onValueChanged: if (enabled)
|
||||
appSettings.burnInQuality = value
|
||||
onValueChanged: appSettings.burnInQuality = value
|
||||
stepSize: 0.05
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0.25
|
||||
value = appSettings.burnInQuality
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 0.25
|
||||
value: appSettings.burnInQuality
|
||||
}
|
||||
Label {
|
||||
SizedLabel {
|
||||
text: Math.round(burnInSlider.value * 100) + "%"
|
||||
}
|
||||
CheckBox {
|
||||
Layout.columnSpan: 2
|
||||
text: qsTr("Burnin optimization (Might display timing artifacts)")
|
||||
checked: appSettings.useFastBurnIn
|
||||
onCheckedChanged: appSettings.useFastBurnIn = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,66 +22,75 @@ import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: 2
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Effects")
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: appSettings.defaultMargin
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
CheckableSlider {
|
||||
name: qsTr("Bloom")
|
||||
onNewValue: appSettings.bloom = newValue
|
||||
onNewValue: function(newValue) { appSettings.bloom = newValue }
|
||||
value: appSettings.bloom
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("BurnIn")
|
||||
onNewValue: appSettings.burnIn = newValue
|
||||
onNewValue: function(newValue) { appSettings.burnIn = newValue }
|
||||
value: appSettings.burnIn
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Static Noise")
|
||||
onNewValue: appSettings.staticNoise = newValue
|
||||
onNewValue: function(newValue) { appSettings.staticNoise = newValue }
|
||||
value: appSettings.staticNoise
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Jitter")
|
||||
onNewValue: appSettings.jitter = newValue
|
||||
onNewValue: function(newValue) { appSettings.jitter = newValue }
|
||||
value: appSettings.jitter
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Glow Line")
|
||||
onNewValue: appSettings.glowingLine = newValue
|
||||
onNewValue: function(newValue) { appSettings.glowingLine = newValue }
|
||||
value: appSettings.glowingLine
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Screen Curvature")
|
||||
onNewValue: appSettings.screenCurvature = newValue
|
||||
onNewValue: function(newValue) { appSettings.screenCurvature = newValue }
|
||||
value: appSettings.screenCurvature
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Ambient Light")
|
||||
onNewValue: appSettings.ambientLight = newValue
|
||||
onNewValue: function(newValue) { appSettings.ambientLight = newValue }
|
||||
value: appSettings.ambientLight
|
||||
enabled: appSettings.framesIndex !== 0
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Flickering")
|
||||
onNewValue: appSettings.flickering = newValue
|
||||
onNewValue: function(newValue) { appSettings.flickering = newValue }
|
||||
value: appSettings.flickering
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Horizontal Sync")
|
||||
onNewValue: appSettings.horizontalSync = newValue
|
||||
onNewValue: function(newValue) { appSettings.horizontalSync = newValue }
|
||||
value: appSettings.horizontalSync
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("RGB Shift")
|
||||
onNewValue: appSettings.rbgShift = newValue
|
||||
onNewValue: function(newValue) { appSettings.rbgShift = newValue }
|
||||
value: appSettings.rbgShift
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Frame Shininess")
|
||||
onNewValue: function(newValue) { appSettings._frameShininess = newValue }
|
||||
value: appSettings._frameShininess
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,14 @@
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Dialogs
|
||||
|
||||
ColumnLayout {
|
||||
GroupBox {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
title: qsTr("Profile")
|
||||
padding: appSettings.defaultMargin
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
ListView {
|
||||
@@ -33,6 +35,7 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
model: appSettings.profilesList
|
||||
clip: true
|
||||
delegate: Rectangle {
|
||||
width: label.width
|
||||
height: label.height
|
||||
@@ -182,6 +185,8 @@ ColumnLayout {
|
||||
GroupBox {
|
||||
title: qsTr("Screen")
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: appSettings.defaultMargin
|
||||
GridLayout {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
@@ -206,12 +211,28 @@ ColumnLayout {
|
||||
onValueChanged: appSettings._margin = value
|
||||
value: appSettings._margin
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Radius")
|
||||
}
|
||||
SimpleSlider {
|
||||
onValueChanged: appSettings._screenRadius = value
|
||||
value: appSettings._screenRadius
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Frame size")
|
||||
}
|
||||
SimpleSlider {
|
||||
onValueChanged: appSettings._frameSize = value
|
||||
value: appSettings._frameSize
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Opacity")
|
||||
visible: !appSettings.isMacOS
|
||||
}
|
||||
SimpleSlider {
|
||||
onValueChanged: appSettings.windowOpacity = value
|
||||
value: appSettings.windowOpacity
|
||||
visible: !appSettings.isMacOS
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -227,6 +248,7 @@ ColumnLayout {
|
||||
MessageDialog {
|
||||
id: messageDialog
|
||||
title: qsTr("File Error")
|
||||
buttons: MessageDialog.Ok
|
||||
onAccepted: {
|
||||
messageDialog.close()
|
||||
}
|
||||
@@ -238,10 +260,8 @@ ColumnLayout {
|
||||
|
||||
sourceComponent: FileDialog {
|
||||
nameFilters: ["Json files (*.json)"]
|
||||
selectMultiple: false
|
||||
selectFolder: false
|
||||
selectExisting: fileDialog.selectExisting
|
||||
onAccepted: callBack(fileUrl)
|
||||
fileMode: fileDialog.selectExisting ? FileDialog.OpenFile : FileDialog.SaveFile
|
||||
onAccepted: callBack(selectedFile)
|
||||
}
|
||||
|
||||
onSelectExistingChanged: reload()
|
||||
|
||||
@@ -25,27 +25,50 @@ import QtQml 2.0
|
||||
import "Components"
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
GroupBox {
|
||||
title: qsTr("Font")
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: appSettings.defaultMargin
|
||||
GridLayout {
|
||||
anchors.fill: parent
|
||||
columns: 2
|
||||
Label {
|
||||
text: qsTr("Rasterization")
|
||||
text: qsTr("Source")
|
||||
}
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
RadioButton {
|
||||
text: qsTr("Bundled")
|
||||
checked: appSettings.fontSource === appSettings.bundled_fonts
|
||||
onClicked: {
|
||||
appSettings.fontSource = appSettings.bundled_fonts
|
||||
}
|
||||
}
|
||||
RadioButton {
|
||||
text: qsTr("System")
|
||||
checked: appSettings.fontSource === appSettings.system_fonts
|
||||
onClicked: {
|
||||
appSettings.fontSource = appSettings.system_fonts
|
||||
}
|
||||
}
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Rendering")
|
||||
enabled: appSettings.fontSource === appSettings.bundled_fonts
|
||||
}
|
||||
ComboBox {
|
||||
id: rasterizationBox
|
||||
id: renderingBox
|
||||
|
||||
property string selectedElement: model[currentIndex]
|
||||
|
||||
Layout.fillWidth: true
|
||||
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels")]
|
||||
model: [qsTr("Default"), qsTr("Scanlines"), qsTr("Pixels"), qsTr("Sub-Pixels"), qsTr("Modern")]
|
||||
currentIndex: appSettings.rasterization
|
||||
onCurrentIndexChanged: {
|
||||
appSettings.rasterization = currentIndex
|
||||
}
|
||||
enabled: appSettings.fontSource === appSettings.bundled_fonts
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Name")
|
||||
@@ -53,22 +76,43 @@ ColumnLayout {
|
||||
ComboBox {
|
||||
id: fontChanger
|
||||
Layout.fillWidth: true
|
||||
model: appSettings.fontlist
|
||||
model: appSettings.filteredFontList
|
||||
textRole: "text"
|
||||
onActivated: {
|
||||
var name = appSettings.fontlist.get(index).name
|
||||
appSettings.fontNames[appSettings.rasterization] = name
|
||||
appSettings.handleFontChanged()
|
||||
var font = appSettings.filteredFontList.get(currentIndex)
|
||||
|
||||
// If selecting a high-res font while not in Modern mode,
|
||||
// switch to Modern to render at full resolution.
|
||||
if (!font.lowResolutionFont && appSettings.rasterization !== appSettings.modern_rasterization) {
|
||||
appSettings.rasterization = appSettings.modern_rasterization
|
||||
}
|
||||
// If selecting a low-res font while in Modern mode, switch back to default.
|
||||
if (font.lowResolutionFont && appSettings.rasterization === appSettings.modern_rasterization) {
|
||||
appSettings.rasterization = appSettings.no_rasterization
|
||||
}
|
||||
|
||||
appSettings.fontName = font.name
|
||||
}
|
||||
function updateIndex() {
|
||||
var name = appSettings.fontNames[appSettings.rasterization]
|
||||
var index = appSettings.getIndexByName(name)
|
||||
if (index !== undefined)
|
||||
currentIndex = index
|
||||
for (var i = 0; i < appSettings.filteredFontList.count; i++) {
|
||||
var font = appSettings.filteredFontList.get(i)
|
||||
if (font.name === appSettings.fontName) {
|
||||
currentIndex = i
|
||||
return
|
||||
}
|
||||
}
|
||||
currentIndex = 0
|
||||
}
|
||||
Connections {
|
||||
target: appSettings
|
||||
onTerminalFontChanged: fontChanger.updateIndex()
|
||||
target: appSettings.fontManager
|
||||
|
||||
onTerminalFontChanged: {
|
||||
fontChanger.updateIndex()
|
||||
}
|
||||
|
||||
onFilteredFontListChanged: {
|
||||
fontChanger.updateIndex()
|
||||
}
|
||||
}
|
||||
Component.onCompleted: updateIndex()
|
||||
}
|
||||
@@ -108,41 +152,43 @@ ColumnLayout {
|
||||
text: Math.round(widthChanger.value * 100) + "%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GroupBox {
|
||||
title: qsTr("Cursor")
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
CheckBox {
|
||||
id: blinkingCursor
|
||||
text: qsTr("Blinking Cursor")
|
||||
checked: appSettings.blinkingCursor
|
||||
onCheckedChanged: appSettings.blinkingCursor = checked
|
||||
Label {
|
||||
text: qsTr("Line Spacing")
|
||||
}
|
||||
Binding {
|
||||
target: blinkingCursor
|
||||
property: "checked"
|
||||
value: appSettings.blinkingCursor
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
id: lineSpacingChanger
|
||||
onValueChanged: appSettings.lineSpacing = value
|
||||
value: appSettings.lineSpacing
|
||||
stepSize: 0.01
|
||||
from: 0.0
|
||||
to: 1.0
|
||||
}
|
||||
SizedLabel {
|
||||
text: Math.round(lineSpacingChanger.value * 100) + "%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GroupBox {
|
||||
title: qsTr("Colors")
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: appSettings.defaultMargin
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
CheckableSlider {
|
||||
name: qsTr("Chroma Color")
|
||||
onNewValue: appSettings.chromaColor = newValue
|
||||
onNewValue: function(newValue) { appSettings.chromaColor = newValue }
|
||||
value: appSettings.chromaColor
|
||||
}
|
||||
CheckableSlider {
|
||||
name: qsTr("Saturation Color")
|
||||
onNewValue: appSettings.saturationColor = newValue
|
||||
onNewValue: function(newValue) { appSettings.saturationColor = newValue }
|
||||
value: appSettings.saturationColor
|
||||
enabled: appSettings.chromaColor !== 0
|
||||
}
|
||||
@@ -163,6 +209,13 @@ ColumnLayout {
|
||||
onColorSelected: appSettings._backgroundColor = color
|
||||
color: appSettings._backgroundColor
|
||||
}
|
||||
ColorButton {
|
||||
name: qsTr("Frame")
|
||||
height: 50
|
||||
Layout.fillWidth: true
|
||||
onColorSelected: appSettings._frameColor = color
|
||||
color: appSettings._frameColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,47 +22,55 @@ import QtQuick 2.2
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Dialogs
|
||||
|
||||
ApplicationWindow {
|
||||
readonly property real tabButtonPadding: 10
|
||||
|
||||
Window {
|
||||
id: settings_window
|
||||
title: qsTr("Settings")
|
||||
width: 800
|
||||
height: 600
|
||||
width: 640
|
||||
height: 520
|
||||
|
||||
property int tabmargins: 15
|
||||
Item {
|
||||
anchors { fill: parent; }
|
||||
|
||||
TabBar {
|
||||
id: bar
|
||||
width: parent.width
|
||||
TabButton {
|
||||
text: qsTr("General")
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Terminal")
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Effects")
|
||||
}
|
||||
TabButton {
|
||||
text: qsTr("Advanced")
|
||||
}
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
anchors {
|
||||
top: bar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: tabmargins
|
||||
TabBar {
|
||||
id: bar
|
||||
anchors { left: parent.left; right: parent.right; top: parent.top; }
|
||||
TabButton {
|
||||
padding: tabButtonPadding
|
||||
text: qsTr("General")
|
||||
}
|
||||
TabButton {
|
||||
padding: tabButtonPadding
|
||||
text: qsTr("Terminal")
|
||||
}
|
||||
TabButton {
|
||||
padding: tabButtonPadding
|
||||
text: qsTr("Effects")
|
||||
}
|
||||
TabButton {
|
||||
padding: tabButtonPadding
|
||||
text: qsTr("Advanced")
|
||||
}
|
||||
}
|
||||
|
||||
currentIndex: bar.currentIndex
|
||||
StackLayout {
|
||||
anchors {
|
||||
top: bar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
margins: 16
|
||||
}
|
||||
|
||||
SettingsGeneralTab { }
|
||||
SettingsTerminalTab { }
|
||||
SettingsEffectsTab { }
|
||||
SettingsAdvancedTab { }
|
||||
currentIndex: bar.currentIndex
|
||||
|
||||
SettingsGeneralTab { }
|
||||
SettingsTerminalTab { }
|
||||
SettingsEffectsTab { }
|
||||
SettingsAdvancedTab { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,34 @@
|
||||
*******************************************************************************/
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import "utils.js" as Utils
|
||||
|
||||
Item {
|
||||
property SlowBurnIn slowBurnInEffect
|
||||
function dynamicFragmentPath() {
|
||||
var rasterMode = appSettings.rasterization;
|
||||
var burnInOn = appSettings.burnIn > 0 ? 1 : 0;
|
||||
var frameOn = appSettings.frameEnabled ? 1 : 0;
|
||||
var chromaOn = appSettings.chromaColor > 0 ? 1 : 0;
|
||||
return "qrc:/shaders/terminal_dynamic_raster" + rasterMode +
|
||||
"_burn" + burnInOn +
|
||||
"_frame" + frameOn +
|
||||
"_chroma" + chromaOn +
|
||||
".frag.qsb";
|
||||
}
|
||||
|
||||
function staticFragmentPath() {
|
||||
var rgbShiftOn = appSettings.rbgShift > 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;
|
||||
return "qrc:/shaders/terminal_static_rgb" + rgbShiftOn +
|
||||
"_bloom" + bloomOn +
|
||||
"_curve" + curvatureOn +
|
||||
"_shine" + shineOn +
|
||||
".frag.qsb";
|
||||
}
|
||||
|
||||
property ShaderEffectSource source
|
||||
property BurnInEffect burnInEffect
|
||||
property ShaderEffectSource bloomSource
|
||||
@@ -32,504 +54,147 @@ Item {
|
||||
property color fontColor: appSettings.fontColor
|
||||
property color backgroundColor: appSettings.backgroundColor
|
||||
|
||||
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize
|
||||
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize * terminalWindow.normalizedWindowScale
|
||||
property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale
|
||||
|
||||
property real chromaColor: appSettings.chromaColor
|
||||
|
||||
property real ambientLight: appSettings.ambientLight * 0.2
|
||||
|
||||
property size virtual_resolution
|
||||
|
||||
ShaderEffect {
|
||||
id: dynamicShader
|
||||
|
||||
property ShaderEffectSource screenBuffer: frameBuffer
|
||||
property ShaderEffectSource burnInSource: burnInEffect.source
|
||||
property ShaderEffectSource frameSource: terminalFrameLoader.item
|
||||
|
||||
property color fontColor: parent.fontColor
|
||||
property color backgroundColor: parent.backgroundColor
|
||||
property real screenCurvature: parent.screenCurvature
|
||||
property real chromaColor: parent.chromaColor
|
||||
property real ambientLight: parent.ambientLight
|
||||
|
||||
property real flickering: appSettings.flickering
|
||||
property real horizontalSync: appSettings.horizontalSync
|
||||
property real horizontalSyncStrength: Utils.lint(0.05, 0.35, horizontalSync)
|
||||
property real glowingLine: appSettings.glowingLine * 0.2
|
||||
|
||||
// Fast burnin properties
|
||||
property real burnIn: appSettings.useFastBurnIn ? appSettings.burnIn : 0
|
||||
property real burnInLastUpdate: burnInEffect.lastUpdate
|
||||
property real burnInTime: burnInEffect.burnInFadeTime
|
||||
|
||||
// Slow burnin properties
|
||||
property real slowBurnIn: appSettings.useFastBurnIn ? 0 : appSettings.burnIn
|
||||
property ShaderEffectSource slowBurnInSource: slowBurnInEffect.source
|
||||
|
||||
property real jitter: appSettings.jitter
|
||||
property size jitterDisplacement: Qt.size(0.007 * jitter, 0.002 * jitter)
|
||||
property real shadowLength: 0.25 * screenCurvature * Utils.lint(0.50, 1.5, ambientLight)
|
||||
property real staticNoise: appSettings.staticNoise
|
||||
property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.windowScaling * appSettings.totalFontScaling),
|
||||
(height) / (noiseTexture.height * appSettings.windowScaling * appSettings.totalFontScaling))
|
||||
|
||||
property size virtual_resolution: parent.virtual_resolution
|
||||
|
||||
property real time: timeManager.time
|
||||
property ShaderEffectSource noiseSource: noiseShaderSource
|
||||
|
||||
// If something goes wrong activate the fallback version of the shader.
|
||||
property bool fallBack: false
|
||||
|
||||
anchors.fill: parent
|
||||
blending: false
|
||||
|
||||
//Smooth random texture used for flickering effect.
|
||||
Image {
|
||||
id: noiseTexture
|
||||
source: "images/allNoise512.png"
|
||||
width: 512
|
||||
height: 512
|
||||
fillMode: Image.Tile
|
||||
visible: false
|
||||
}
|
||||
ShaderEffectSource {
|
||||
id: noiseShaderSource
|
||||
sourceItem: noiseTexture
|
||||
wrapMode: ShaderEffectSource.Repeat
|
||||
visible: false
|
||||
smooth: true
|
||||
}
|
||||
|
||||
//Print the number with a reasonable precision for the shader.
|
||||
function str(num){
|
||||
return num.toFixed(8);
|
||||
}
|
||||
|
||||
vertexShader: "
|
||||
uniform highp mat4 qt_Matrix;
|
||||
uniform highp float time;
|
||||
|
||||
attribute highp vec4 qt_Vertex;
|
||||
attribute highp vec2 qt_MultiTexCoord0;
|
||||
|
||||
varying highp vec2 qt_TexCoord0;" +
|
||||
|
||||
(!fallBack ? "
|
||||
uniform sampler2D noiseSource;" : "") +
|
||||
|
||||
(!fallBack && flickering !== 0.0 ?"
|
||||
varying lowp float brightness;
|
||||
uniform lowp float flickering;" : "") +
|
||||
|
||||
(!fallBack && horizontalSync !== 0.0 ?"
|
||||
uniform lowp float horizontalSyncStrength;
|
||||
varying lowp float distortionScale;
|
||||
varying lowp float distortionFreq;" : "") +
|
||||
|
||||
"
|
||||
void main() {
|
||||
qt_TexCoord0 = qt_MultiTexCoord0;
|
||||
vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" +
|
||||
|
||||
(!fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
|
||||
"vec4 initialNoiseTexel = texture2D(noiseSource, coords);"
|
||||
: "") +
|
||||
|
||||
(!fallBack && flickering !== 0.0 ? "
|
||||
brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
|
||||
: "") +
|
||||
|
||||
(!fallBack && horizontalSync !== 0.0 ? "
|
||||
float randval = horizontalSyncStrength - initialNoiseTexel.r;
|
||||
distortionScale = step(0.0, randval) * randval * horizontalSyncStrength;
|
||||
distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
|
||||
: "") +
|
||||
|
||||
"gl_Position = qt_Matrix * qt_Vertex;
|
||||
}"
|
||||
|
||||
fragmentShader: "
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform sampler2D screenBuffer;
|
||||
uniform highp float qt_Opacity;
|
||||
uniform highp float time;
|
||||
varying highp vec2 qt_TexCoord0;
|
||||
|
||||
uniform highp vec4 fontColor;
|
||||
uniform highp vec4 backgroundColor;
|
||||
uniform lowp float shadowLength;
|
||||
|
||||
uniform highp vec2 virtual_resolution;" +
|
||||
|
||||
(burnIn !== 0 ? "
|
||||
uniform sampler2D burnInSource;
|
||||
uniform highp float burnInLastUpdate;
|
||||
uniform highp float burnInTime;" : "") +
|
||||
(slowBurnIn !== 0 ? "
|
||||
uniform sampler2D slowBurnInSource;" : "") +
|
||||
(staticNoise !== 0 ? "
|
||||
uniform highp float staticNoise;" : "") +
|
||||
(((staticNoise !== 0 || jitter !== 0)
|
||||
||(fallBack && (flickering || horizontalSync))) ? "
|
||||
uniform lowp sampler2D noiseSource;
|
||||
uniform highp vec2 scaleNoiseSize;" : "") +
|
||||
(screenCurvature !== 0 ? "
|
||||
uniform highp float screenCurvature;
|
||||
uniform lowp sampler2D frameSource;" : "") +
|
||||
(glowingLine !== 0 ? "
|
||||
uniform highp float glowingLine;" : "") +
|
||||
(chromaColor !== 0 ? "
|
||||
uniform lowp float chromaColor;" : "") +
|
||||
(jitter !== 0 ? "
|
||||
uniform lowp vec2 jitterDisplacement;" : "") +
|
||||
(ambientLight !== 0 ? "
|
||||
uniform lowp float ambientLight;" : "") +
|
||||
|
||||
(fallBack && horizontalSync !== 0 ? "
|
||||
uniform lowp float horizontalSyncStrength;" : "") +
|
||||
(fallBack && flickering !== 0.0 ?"
|
||||
uniform lowp float flickering;" : "") +
|
||||
(!fallBack && flickering !== 0 ? "
|
||||
varying lowp float brightness;"
|
||||
: "") +
|
||||
(!fallBack && horizontalSync !== 0 ? "
|
||||
varying lowp float distortionScale;
|
||||
varying lowp float distortionFreq;" : "") +
|
||||
|
||||
(glowingLine !== 0 ? "
|
||||
float randomPass(vec2 coords){
|
||||
return fract(smoothstep(-120.0, 0.0, coords.y - (virtual_resolution.y + 120.0) * fract(time * 0.00015)));
|
||||
}" : "") +
|
||||
|
||||
"float min2(vec2 v) {
|
||||
return min(v.x, v.y);
|
||||
}
|
||||
|
||||
float rgb2grey(vec3 v){
|
||||
return dot(v, vec3(0.21, 0.72, 0.04));
|
||||
}
|
||||
|
||||
float isInScreen(vec2 v) {
|
||||
return min2(step(0.0, v) - step(1.0, v));
|
||||
}
|
||||
|
||||
vec2 barrel(vec2 v, vec2 cc) {" +
|
||||
|
||||
(screenCurvature !== 0 ? "
|
||||
float distortion = dot(cc, cc) * screenCurvature;
|
||||
return (v - cc * (1.0 + distortion) * distortion);"
|
||||
:
|
||||
"return v;") +
|
||||
"}" +
|
||||
|
||||
"vec3 convertWithChroma(vec3 inColor) {
|
||||
vec3 outColor = inColor;" +
|
||||
|
||||
(chromaColor !== 0 ?
|
||||
"outColor = fontColor.rgb * mix(vec3(rgb2grey(inColor)), inColor, chromaColor);"
|
||||
:
|
||||
"outColor = fontColor.rgb * rgb2grey(inColor);") +
|
||||
|
||||
" return outColor;
|
||||
}" +
|
||||
|
||||
"void main() {" +
|
||||
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
||||
"float distance = length(cc);" +
|
||||
|
||||
//FallBack if there are problems
|
||||
(fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
|
||||
"vec2 initialCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));
|
||||
vec4 initialNoiseTexel = texture2D(noiseSource, initialCoords);"
|
||||
: "") +
|
||||
(fallBack && flickering !== 0.0 ? "
|
||||
float brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
|
||||
: "") +
|
||||
(fallBack && horizontalSync !== 0.0 ? "
|
||||
float randval = horizontalSyncStrength - initialNoiseTexel.r;
|
||||
float distortionScale = step(0.0, randval) * randval * horizontalSyncStrength;
|
||||
float distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
|
||||
: "") +
|
||||
|
||||
(staticNoise ? "
|
||||
float noise = staticNoise;" : "") +
|
||||
|
||||
(screenCurvature !== 0 ? "
|
||||
vec2 staticCoords = barrel(qt_TexCoord0, cc);"
|
||||
:"
|
||||
vec2 staticCoords = qt_TexCoord0;") +
|
||||
|
||||
"vec2 coords = qt_TexCoord0;" +
|
||||
|
||||
(horizontalSync !== 0 ? "
|
||||
float dst = sin((coords.y + time * 0.001) * distortionFreq);
|
||||
coords.x += dst * distortionScale;" +
|
||||
|
||||
(staticNoise ? "
|
||||
noise += distortionScale * 7.0;" : "")
|
||||
|
||||
: "") +
|
||||
|
||||
(jitter !== 0 || staticNoise !== 0 ?
|
||||
"vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));"
|
||||
: "") +
|
||||
|
||||
(jitter !== 0 ? "
|
||||
vec2 offset = vec2(noiseTexel.b, noiseTexel.a) - vec2(0.5);
|
||||
vec2 txt_coords = coords + offset * jitterDisplacement;"
|
||||
: "vec2 txt_coords = coords;") +
|
||||
property size virtualResolution
|
||||
property size screenResolution
|
||||
|
||||
property real _screenDensity: Math.min(
|
||||
screenResolution.width / virtualResolution.width,
|
||||
screenResolution.height / virtualResolution.height
|
||||
)
|
||||
|
||||
ShaderEffect {
|
||||
id: dynamicShader
|
||||
|
||||
property ShaderEffectSource screenBuffer: frameBuffer
|
||||
property ShaderEffectSource burnInSource: burnInEffect.effectSource
|
||||
property ShaderEffectSource frameSource: terminalFrameLoader.item
|
||||
|
||||
"float color = 0.0001;" +
|
||||
property color fontColor: parent.fontColor
|
||||
property color backgroundColor: parent.backgroundColor
|
||||
property real screenCurvature: parent.screenCurvature
|
||||
property real chromaColor: parent.chromaColor
|
||||
property real ambientLight: parent.ambientLight
|
||||
|
||||
(staticNoise !== 0 ? "
|
||||
float noiseVal = noiseTexel.a;
|
||||
color += noiseVal * noise * (1.0 - distance * 1.3);" : "") +
|
||||
property real flickering: appSettings.flickering
|
||||
property real horizontalSync: appSettings.horizontalSync
|
||||
property real horizontalSyncStrength: Utils.lint(0.05, 0.35, horizontalSync)
|
||||
property real glowingLine: appSettings.glowingLine * 0.2
|
||||
|
||||
(glowingLine !== 0 ? "
|
||||
color += randomPass(coords * virtual_resolution) * glowingLine;" : "") +
|
||||
// Fast burnin properties
|
||||
property real burnIn: appSettings.burnIn
|
||||
property real burnInLastUpdate: burnInEffect.lastUpdate
|
||||
property real burnInTime: burnInEffect.burnInFadeTime
|
||||
|
||||
"vec3 txt_color = texture2D(screenBuffer, txt_coords).rgb;" +
|
||||
property real jitter: appSettings.jitter
|
||||
property size jitterDisplacement: Qt.size(0.007 * jitter, 0.002 * jitter)
|
||||
property real staticNoise: appSettings.staticNoise
|
||||
property size scaleNoiseSize: Qt.size((width * 0.75) / (noiseTexture.width * appSettings.windowScaling * appSettings.totalFontScaling),
|
||||
(height * 0.75) / (noiseTexture.height * appSettings.windowScaling * appSettings.totalFontScaling))
|
||||
|
||||
property size virtualResolution: parent.virtualResolution
|
||||
|
||||
// Rasterization might display oversamping issues if virtual resolution is close to physical display resolution.
|
||||
// We progressively disable rasterization from 4x up to 2x resolution.
|
||||
property real rasterizationIntensity: Utils.smoothstep(2.0, 4.0, _screenDensity)
|
||||
|
||||
property real time: timeManager ? timeManager.time : 0
|
||||
property ShaderEffectSource noiseSource: noiseShaderSource
|
||||
|
||||
property real frameSize: parent.frameSize
|
||||
property real frameShininess: appSettings.frameShininess
|
||||
property real bloom: parent.bloomSource ? appSettings.bloom * 2.5 : 0
|
||||
|
||||
anchors.fill: parent
|
||||
blending: false
|
||||
|
||||
Image {
|
||||
id: noiseTexture
|
||||
source: "images/allNoise512.png"
|
||||
width: 512
|
||||
height: 512
|
||||
fillMode: Image.Tile
|
||||
visible: false
|
||||
}
|
||||
ShaderEffectSource {
|
||||
id: noiseShaderSource
|
||||
sourceItem: noiseTexture
|
||||
wrapMode: ShaderEffectSource.Repeat
|
||||
visible: false
|
||||
smooth: true
|
||||
}
|
||||
|
||||
vertexShader: "qrc:/shaders/terminal_dynamic.vert.qsb"
|
||||
fragmentShader: dynamicFragmentPath()
|
||||
|
||||
onStatusChanged: if (log) console.log(log)
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: terminalFrameLoader
|
||||
|
||||
active: appSettings.frameEnabled
|
||||
|
||||
width: staticShader.width
|
||||
height: staticShader.height
|
||||
|
||||
sourceComponent: ShaderEffectSource {
|
||||
|
||||
sourceItem: terminalFrame
|
||||
hideSource: true
|
||||
visible: false
|
||||
format: ShaderEffectSource.RGBA
|
||||
|
||||
TerminalFrame {
|
||||
id: terminalFrame
|
||||
blending: false
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShaderEffect {
|
||||
id: staticShader
|
||||
|
||||
width: parent.width * appSettings.windowScaling
|
||||
height: parent.height * appSettings.windowScaling
|
||||
|
||||
property ShaderEffectSource source: parent.source
|
||||
property ShaderEffectSource bloomSource: parent.bloomSource
|
||||
|
||||
(burnIn !== 0 ? "
|
||||
vec4 txt_blur = texture2D(burnInSource, staticCoords);
|
||||
float blurDecay = clamp((time - burnInLastUpdate) * burnInTime, 0.0, 1.0);
|
||||
vec3 burnInColor = 0.65 * (txt_blur.rgb - vec3(blurDecay));
|
||||
txt_color = max(txt_color, convertWithChroma(burnInColor));"
|
||||
: "") +
|
||||
property color fontColor: parent.fontColor
|
||||
property color backgroundColor: parent.backgroundColor
|
||||
property real bloom: bloomSource ? appSettings.bloom * 2.5 : 0
|
||||
|
||||
(slowBurnIn !== 0 ? "
|
||||
vec4 txt_blur = texture2D(slowBurnInSource, staticCoords);
|
||||
txt_color = max(txt_color, convertWithChroma(txt_blur.rgb * txt_blur.a));
|
||||
" : "") +
|
||||
property real screenCurvature: parent.screenCurvature
|
||||
|
||||
property real chromaColor: appSettings.chromaColor;
|
||||
|
||||
"txt_color += fontColor.rgb * vec3(color);" +
|
||||
property real rbgShift: (appSettings.rbgShift / width) * appSettings.totalFontScaling
|
||||
|
||||
property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
|
||||
property real frameShininess: appSettings.frameShininess
|
||||
property real frameSize: parent.frameSize
|
||||
|
||||
"vec3 finalColor = txt_color;" +
|
||||
blending: false
|
||||
visible: false
|
||||
|
||||
(flickering !== 0 ? "
|
||||
finalColor *= brightness;" : "") +
|
||||
vertexShader: "qrc:/shaders/terminal_static.vert.qsb"
|
||||
fragmentShader: staticFragmentPath()
|
||||
|
||||
(ambientLight !== 0 ? "
|
||||
finalColor += vec3(ambientLight) * (1.0 - distance) * (1.0 - distance);" : "") +
|
||||
onStatusChanged: if (log) console.log(log)
|
||||
}
|
||||
|
||||
(screenCurvature !== 0 ?
|
||||
"vec4 frameColor = texture2D(frameSource, qt_TexCoord0);
|
||||
finalColor = mix(finalColor, frameColor.rgb, frameColor.a);"
|
||||
: "") +
|
||||
|
||||
"gl_FragColor = vec4(finalColor, qt_Opacity);" +
|
||||
"}"
|
||||
|
||||
onStatusChanged: {
|
||||
// Print warning messages
|
||||
if (log)
|
||||
console.log(log);
|
||||
|
||||
// Activate fallback mode
|
||||
if (status == ShaderEffect.Error) {
|
||||
fallBack = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: terminalFrameLoader
|
||||
|
||||
active: screenCurvature !== 0
|
||||
|
||||
width: staticShader.width
|
||||
height: staticShader.height
|
||||
|
||||
sourceComponent: ShaderEffectSource {
|
||||
|
||||
sourceItem: terminalFrame
|
||||
hideSource: true
|
||||
visible: false
|
||||
format: ShaderEffectSource.RGBA
|
||||
|
||||
NewTerminalFrame {
|
||||
id: terminalFrame
|
||||
blending: false
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ShaderEffect {
|
||||
id: staticShader
|
||||
|
||||
width: parent.width * appSettings.windowScaling
|
||||
height: parent.height * appSettings.windowScaling
|
||||
|
||||
property ShaderEffectSource source: parent.source
|
||||
property ShaderEffectSource bloomSource: parent.bloomSource
|
||||
|
||||
property color fontColor: parent.fontColor
|
||||
property color backgroundColor: parent.backgroundColor
|
||||
property real bloom: appSettings.bloom * 2.5
|
||||
|
||||
property real screenCurvature: parent.screenCurvature
|
||||
|
||||
property real chromaColor: appSettings.chromaColor;
|
||||
|
||||
property real rbgShift: (appSettings.rbgShift / width) * appSettings.totalFontScaling // TODO FILIPPO width here is wrong.
|
||||
|
||||
property int rasterization: appSettings.rasterization
|
||||
|
||||
property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
|
||||
|
||||
property real ambientLight: parent.ambientLight
|
||||
|
||||
property size virtual_resolution: parent.virtual_resolution
|
||||
|
||||
blending: false
|
||||
visible: false
|
||||
|
||||
//Print the number with a reasonable precision for the shader.
|
||||
function str(num){
|
||||
return num.toFixed(8);
|
||||
}
|
||||
|
||||
fragmentShader: "
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif
|
||||
|
||||
uniform sampler2D source;
|
||||
uniform highp float qt_Opacity;
|
||||
varying highp vec2 qt_TexCoord0;
|
||||
|
||||
uniform highp vec4 fontColor;
|
||||
uniform highp vec4 backgroundColor;
|
||||
uniform lowp float screen_brightness;
|
||||
|
||||
uniform highp vec2 virtual_resolution;" +
|
||||
|
||||
(bloom !== 0 ? "
|
||||
uniform highp sampler2D bloomSource;
|
||||
uniform lowp float bloom;" : "") +
|
||||
|
||||
(screenCurvature !== 0 ? "
|
||||
uniform highp float screenCurvature;" : "") +
|
||||
|
||||
(chromaColor !== 0 ? "
|
||||
uniform lowp float chromaColor;" : "") +
|
||||
|
||||
(rbgShift !== 0 ? "
|
||||
uniform lowp float rbgShift;" : "") +
|
||||
|
||||
(ambientLight !== 0 ? "
|
||||
uniform lowp float ambientLight;" : "") +
|
||||
|
||||
"highp float getScanlineIntensity(vec2 coords) {
|
||||
float result = 1.0;" +
|
||||
|
||||
(appSettings.rasterization != appSettings.no_rasterization ?
|
||||
"float val = 0.0;
|
||||
vec2 rasterizationCoords = fract(coords * virtual_resolution);
|
||||
val += smoothstep(0.0, 0.5, rasterizationCoords.y);
|
||||
val -= smoothstep(0.5, 1.0, rasterizationCoords.y);
|
||||
result *= mix(0.5, 1.0, val);" : "") +
|
||||
|
||||
(appSettings.rasterization == appSettings.pixel_rasterization ?
|
||||
"val = 0.0;
|
||||
val += smoothstep(0.0, 0.5, rasterizationCoords.x);
|
||||
val -= smoothstep(0.5, 1.0, rasterizationCoords.x);
|
||||
result *= mix(0.5, 1.0, val);" : "") + "
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
float min2(vec2 v) {
|
||||
return min(v.x, v.y);
|
||||
}
|
||||
|
||||
float sum2(vec2 v) {
|
||||
return v.x + v.y;
|
||||
}
|
||||
|
||||
float rgb2grey(vec3 v){
|
||||
return dot(v, vec3(0.21, 0.72, 0.04));
|
||||
}" +
|
||||
|
||||
"vec3 convertWithChroma(vec3 inColor) {
|
||||
vec3 outColor = inColor;" +
|
||||
|
||||
(chromaColor !== 0 ?
|
||||
"outColor = fontColor.rgb * mix(vec3(rgb2grey(inColor)), inColor, chromaColor);"
|
||||
:
|
||||
"outColor = fontColor.rgb * rgb2grey(inColor);") +
|
||||
|
||||
" return outColor;
|
||||
}" +
|
||||
|
||||
|
||||
"void main() {" +
|
||||
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
||||
|
||||
(screenCurvature !== 0 ? "
|
||||
float distortion = dot(cc, cc) * screenCurvature;
|
||||
vec2 curvatureCoords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);
|
||||
vec2 txt_coords = - 2.0 * curvatureCoords + 3.0 * step(vec2(0.0), curvatureCoords) * curvatureCoords - 3.0 * step(vec2(1.0), curvatureCoords) * curvatureCoords;"
|
||||
:"
|
||||
vec2 txt_coords = qt_TexCoord0;") +
|
||||
|
||||
"vec3 txt_color = texture2D(source, txt_coords).rgb;" +
|
||||
|
||||
(rbgShift !== 0 ? "
|
||||
vec2 displacement = vec2(12.0, 0.0) * rbgShift;
|
||||
vec3 rightColor = texture2D(source, txt_coords + displacement).rgb;
|
||||
vec3 leftColor = texture2D(source, txt_coords - displacement).rgb;
|
||||
txt_color.r = leftColor.r * 0.10 + rightColor.r * 0.30 + txt_color.r * 0.60;
|
||||
txt_color.g = leftColor.g * 0.20 + rightColor.g * 0.20 + txt_color.g * 0.60;
|
||||
txt_color.b = leftColor.b * 0.30 + rightColor.b * 0.10 + txt_color.b * 0.60;
|
||||
" : "") +
|
||||
|
||||
"txt_color *= getScanlineIntensity(txt_coords);" +
|
||||
|
||||
"txt_color += vec3(0.0001);" +
|
||||
"float greyscale_color = rgb2grey(txt_color);" +
|
||||
|
||||
(screenCurvature !== 0 ? "
|
||||
float reflectionMask = sum2(step(vec2(0.0), curvatureCoords) - step(vec2(1.0), curvatureCoords));
|
||||
reflectionMask = clamp(reflectionMask, 0.0, 1.0);"
|
||||
:
|
||||
"float reflectionMask = 1.0;") +
|
||||
|
||||
(chromaColor !== 0 ?
|
||||
"vec3 foregroundColor = mix(fontColor.rgb, txt_color * fontColor.rgb / greyscale_color, chromaColor);
|
||||
vec3 finalColor = mix(backgroundColor.rgb, foregroundColor, greyscale_color * reflectionMask);"
|
||||
:
|
||||
"vec3 finalColor = mix(backgroundColor.rgb, fontColor.rgb, greyscale_color * reflectionMask);") +
|
||||
|
||||
(bloom !== 0 ?
|
||||
"vec4 bloomFullColor = texture2D(bloomSource, txt_coords);
|
||||
vec3 bloomColor = bloomFullColor.rgb;
|
||||
float bloomAlpha = bloomFullColor.a;
|
||||
bloomColor = convertWithChroma(bloomColor);
|
||||
finalColor += clamp(bloomColor * bloom * bloomAlpha, 0.0, 0.5);"
|
||||
: "") +
|
||||
|
||||
"finalColor *= screen_brightness;" +
|
||||
|
||||
"gl_FragColor = vec4(finalColor, qt_Opacity);" +
|
||||
"}"
|
||||
|
||||
onStatusChanged: {
|
||||
// Print warning messages
|
||||
if (log) console.log(log);
|
||||
}
|
||||
}
|
||||
|
||||
ShaderEffectSource {
|
||||
id: frameBuffer
|
||||
visible: false
|
||||
sourceItem: staticShader
|
||||
hideSource: true
|
||||
}
|
||||
ShaderEffectSource {
|
||||
id: frameBuffer
|
||||
visible: false
|
||||
sourceItem: staticShader
|
||||
hideSource: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,140 +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.0
|
||||
|
||||
import "utils.js" as Utils
|
||||
|
||||
Loader {
|
||||
property ShaderEffectSource source: item ? item.source : null
|
||||
|
||||
active: !appSettings.useFastBurnIn && appSettings.burnIn !== 0
|
||||
anchors.fill: parent
|
||||
|
||||
sourceComponent: Item {
|
||||
property alias source: burnInSourceEffect
|
||||
property int burnInScaling: scaleTexture * appSettings.burnInQuality
|
||||
|
||||
ShaderEffectSource {
|
||||
property bool updateBurnIn: false
|
||||
property real burnIn: appSettings.burnIn
|
||||
property real fps: appSettings.fps !== 0 ? appSettings.fps : 60
|
||||
property real burnInFadeTime: Utils.lint(minBurnInFadeTime, maxBurnInFadeTime, burnIn)
|
||||
property real burnInCoefficient: 1000 / (fps * burnInFadeTime)
|
||||
property real minBurnInFadeTime: appSettings.minBurnInFadeTime
|
||||
property real maxBurnInFadeTime: appSettings.maxBurnInFadeTime
|
||||
|
||||
id: burnInSourceEffect
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
sourceItem: burnInEffect
|
||||
recursive: true
|
||||
live: false
|
||||
hideSource: true
|
||||
wrapMode: kterminalSource.wrapMode
|
||||
|
||||
visible: false
|
||||
|
||||
function restartBlurSource(){
|
||||
livetimer.restart();
|
||||
}
|
||||
|
||||
// This updates the burnin synched with the timer.
|
||||
Connections {
|
||||
target: burnInSourceEffect.updateBurnIn ? timeManager : null
|
||||
ignoreUnknownSignals: false
|
||||
onTimeChanged: {
|
||||
burnInSourceEffect.scheduleUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: livetimer
|
||||
|
||||
// The interval assumes 60 fps. This is the time needed burnout a white pixel.
|
||||
// We multiply 1.1 to have a little bit of margin over the theoretical value.
|
||||
// This solution is not extremely clean, but it's probably the best to avoid measuring fps.
|
||||
|
||||
interval: burnInSourceEffect.burnInFadeTime * 1.1
|
||||
running: true
|
||||
onTriggered: burnInSourceEffect.updateBurnIn = false;
|
||||
}
|
||||
Connections {
|
||||
target: kterminal
|
||||
onImagePainted:{
|
||||
burnInSourceEffect.scheduleUpdate();
|
||||
burnInSourceEffect.updateBurnIn = true;
|
||||
livetimer.restart();
|
||||
}
|
||||
}
|
||||
// Restart blurred source settings change.
|
||||
Connections {
|
||||
target: appSettings
|
||||
onBurnInChanged: burnInSourceEffect.restartBlurSource();
|
||||
onTerminalFontChanged: burnInSourceEffect.restartBlurSource();
|
||||
onRasterizationChanged: burnInSourceEffect.restartBlurSource();
|
||||
onBurnInQualityChanged: burnInSourceEffect.restartBlurSource();
|
||||
}
|
||||
Connections {
|
||||
target: kterminalScrollbar
|
||||
onOpacityChanged: burnInSourceEffect.restartBlurSource();
|
||||
}
|
||||
|
||||
ShaderEffect {
|
||||
id: burnInEffect
|
||||
|
||||
property variant txt_source: kterminalSource
|
||||
property variant blurredSource: burnInSourceEffect
|
||||
property real burnInCoefficient: burnInSourceEffect.burnInCoefficient
|
||||
|
||||
anchors.fill: parent
|
||||
blending: false
|
||||
|
||||
fragmentShader:
|
||||
"#ifdef GL_ES
|
||||
precision mediump float;
|
||||
#endif\n" +
|
||||
|
||||
"uniform lowp float qt_Opacity;" +
|
||||
"uniform lowp sampler2D txt_source;" +
|
||||
|
||||
"varying highp vec2 qt_TexCoord0;
|
||||
uniform lowp sampler2D blurredSource;
|
||||
uniform highp float burnInCoefficient;" +
|
||||
|
||||
"float max3(vec3 v) {
|
||||
return max (max (v.x, v.y), v.z);
|
||||
}" +
|
||||
|
||||
"void main() {" +
|
||||
"vec2 coords = qt_TexCoord0;" +
|
||||
"vec3 origColor = texture2D(txt_source, coords).rgb;" +
|
||||
"vec3 blur_color = texture2D(blurredSource, coords).rgb - vec3(burnInCoefficient);" +
|
||||
"vec3 color = min(origColor + blur_color, max(origColor, blur_color));" +
|
||||
|
||||
"gl_FragColor = vec4(color, max3(color - origColor));" +
|
||||
"}"
|
||||
|
||||
onStatusChanged: if (log) console.log(log) //Print warning messages
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import QtQuick 2.2
|
||||
import QtQuick.LocalStorage 2.0
|
||||
|
||||
QtObject {
|
||||
readonly property string dbMajorVersion: "1"
|
||||
readonly property string dbMajorVersion: "2"
|
||||
readonly property string dbMinorVersion: "1.0"
|
||||
property bool initialized: false
|
||||
|
||||
|
||||
@@ -18,36 +18,43 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
import QtQuick 2.2
|
||||
import QtGraphicalEffects 1.0
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import "utils.js" as Utils
|
||||
|
||||
ShaderTerminal {
|
||||
property alias title: terminal.title
|
||||
property alias terminalSize: terminal.terminalSize
|
||||
signal sessionFinished()
|
||||
|
||||
property bool loadBloomEffect: appSettings.bloom > 0 || appSettings._frameShininess > 0
|
||||
|
||||
id: mainShader
|
||||
opacity: appSettings.windowOpacity * 0.3 + 0.7
|
||||
|
||||
source: terminal.mainSource
|
||||
burnInEffect: terminal.burnInEffect
|
||||
slowBurnInEffect: terminal.slowBurnInEffect
|
||||
virtual_resolution: terminal.virtualResolution
|
||||
|
||||
TimeManager {
|
||||
id: timeManager
|
||||
enableTimer: terminalWindow.visible
|
||||
}
|
||||
virtualResolution: terminal.virtualResolution
|
||||
screenResolution: Qt.size(
|
||||
terminalWindow.width * Screen.devicePixelRatio * appSettings.windowScaling,
|
||||
terminalWindow.height * Screen.devicePixelRatio * appSettings.windowScaling
|
||||
)
|
||||
bloomSource: bloomSourceLoader.item
|
||||
|
||||
PreprocessedTerminal {
|
||||
id: terminal
|
||||
anchors.fill: parent
|
||||
onSessionFinished: mainShader.sessionFinished()
|
||||
}
|
||||
|
||||
function activate() {
|
||||
terminal.mainTerminal.forceActiveFocus()
|
||||
}
|
||||
|
||||
// EFFECTS ////////////////////////////////////////////////////////////////
|
||||
Loader {
|
||||
id: bloomEffectLoader
|
||||
active: appSettings.bloom
|
||||
active: loadBloomEffect
|
||||
asynchronous: true
|
||||
width: parent.width * appSettings.bloomQuality
|
||||
height: parent.height * appSettings.bloomQuality
|
||||
@@ -60,16 +67,15 @@ ShaderTerminal {
|
||||
}
|
||||
Loader {
|
||||
id: bloomSourceLoader
|
||||
active: appSettings.bloom !== 0
|
||||
active: loadBloomEffect
|
||||
asynchronous: true
|
||||
sourceComponent: ShaderEffectSource {
|
||||
id: _bloomEffectSource
|
||||
sourceItem: bloomEffectLoader.item
|
||||
wrapMode: ShaderEffectSource.Repeat
|
||||
hideSource: true
|
||||
smooth: true
|
||||
visible: false
|
||||
}
|
||||
}
|
||||
|
||||
bloomSource: bloomSourceLoader.item
|
||||
}
|
||||
|
||||
52
app/qml/TerminalFrame.qml
Normal file
52
app/qml/TerminalFrame.qml
Normal file
@@ -0,0 +1,52 @@
|
||||
/*******************************************************************************
|
||||
* 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.0
|
||||
|
||||
import "utils.js" as Utils
|
||||
|
||||
ShaderEffect {
|
||||
property color _staticFrameColor: Utils.sum(appSettings.frameColor, Qt.rgba(0.1, 0.1, 0.1, 1.0))
|
||||
property color _backgroundColor: appSettings.backgroundColor
|
||||
property color _fontColor: appSettings.fontColor
|
||||
property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2)
|
||||
|
||||
property color frameColor: Utils.mix(
|
||||
Utils.scaleColor(_lightColor, 0.2),
|
||||
_staticFrameColor,
|
||||
0.125 + 0.750 * ambientLight
|
||||
)
|
||||
|
||||
property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize * terminalWindow.normalizedWindowScale
|
||||
|
||||
property real frameShininess: appSettings.frameShininess
|
||||
|
||||
property real frameSize: appSettings.frameSize * terminalWindow.normalizedWindowScale
|
||||
|
||||
property real screenRadius: appSettings.screenRadius
|
||||
|
||||
property size viewportSize: Qt.size(width / appSettings.windowScaling, height / appSettings.windowScaling)
|
||||
|
||||
property real ambientLight: appSettings.ambientLight
|
||||
|
||||
vertexShader: "qrc:/shaders/terminal_frame.vert.qsb"
|
||||
fragmentShader: "qrc:/shaders/terminal_frame.frag.qsb"
|
||||
|
||||
onStatusChanged: if (log) console.log(log) //Print warning messages
|
||||
}
|
||||
90
app/qml/TerminalTabs.qml
Normal file
90
app/qml/TerminalTabs.qml
Normal file
@@ -0,0 +1,90 @@
|
||||
/*******************************************************************************
|
||||
* 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.Layouts
|
||||
|
||||
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 count: tabsModel.count
|
||||
property var hostWindow
|
||||
property alias tabsModel: tabsModel
|
||||
|
||||
function normalizeTitle(rawTitle) {
|
||||
if (rawTitle === undefined || rawTitle === null) {
|
||||
return ""
|
||||
}
|
||||
return String(rawTitle).trim()
|
||||
}
|
||||
|
||||
function addTab() {
|
||||
tabsModel.append({ title: "" })
|
||||
currentIndex = tabsModel.count - 1
|
||||
}
|
||||
|
||||
function closeTab(index) {
|
||||
if (tabsModel.count <= 1) {
|
||||
hostWindow.close()
|
||||
return
|
||||
}
|
||||
|
||||
tabsModel.remove(index)
|
||||
currentIndex = Math.min(currentIndex, tabsModel.count - 1)
|
||||
}
|
||||
|
||||
ListModel {
|
||||
id: tabsModel
|
||||
}
|
||||
|
||||
Component.onCompleted: addTab()
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
StackLayout {
|
||||
id: stack
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
currentIndex: tabsRoot.currentIndex
|
||||
|
||||
Repeater {
|
||||
model: tabsModel
|
||||
TerminalContainer {
|
||||
property bool shouldHaveFocus: terminalWindow.active && StackLayout.isCurrentItem
|
||||
onShouldHaveFocusChanged: {
|
||||
if (shouldHaveFocus) {
|
||||
activate()
|
||||
}
|
||||
}
|
||||
onTitleChanged: tabsModel.setProperty(index, "title", normalizeTitle(title))
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
onSessionFinished: tabsRoot.closeTab(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
217
app/qml/TerminalTabsBar.qml
Normal file
217
app/qml/TerminalTabsBar.qml
Normal file
@@ -0,0 +1,217 @@
|
||||
/*******************************************************************************
|
||||
* 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
247
app/qml/TerminalWindow.qml
Normal file
247
app/qml/TerminalWindow.qml
Normal file
@@ -0,0 +1,247 @@
|
||||
/*******************************************************************************
|
||||
* 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.2
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts
|
||||
|
||||
import "menus"
|
||||
|
||||
ApplicationWindow {
|
||||
id: terminalWindow
|
||||
|
||||
width: 1024
|
||||
height: 768
|
||||
|
||||
// Show the window once it is ready.
|
||||
Component.onCompleted: {
|
||||
visible = true
|
||||
}
|
||||
|
||||
minimumWidth: 320
|
||||
minimumHeight: 240
|
||||
|
||||
visible: false
|
||||
|
||||
flags: Qt.Window | Qt.FramelessWindowHint
|
||||
|
||||
property bool fullscreen: appSettings.fullscreen
|
||||
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 { }
|
||||
}
|
||||
|
||||
property real normalizedWindowScale: 1024 / ((0.5 * width + 0.5 * height))
|
||||
|
||||
color: "#00000000"
|
||||
|
||||
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
|
||||
checkable: true
|
||||
checked: appSettings.fullscreen
|
||||
}
|
||||
Action {
|
||||
id: newWindowAction
|
||||
text: qsTr("New Window")
|
||||
shortcut: "Ctrl+Shift+N"
|
||||
onTriggered: appRoot.createWindow()
|
||||
}
|
||||
Action {
|
||||
id: quitAction
|
||||
text: qsTr("Quit")
|
||||
shortcut: "Ctrl+Shift+Q"
|
||||
onTriggered: appSettings.close()
|
||||
}
|
||||
Action {
|
||||
id: showsettingsAction
|
||||
text: qsTr("Settings")
|
||||
onTriggered: {
|
||||
settingsWindow.show()
|
||||
settingsWindow.requestActivate()
|
||||
settingsWindow.raise()
|
||||
}
|
||||
}
|
||||
Action {
|
||||
id: copyAction
|
||||
text: qsTr("Copy")
|
||||
shortcut: "Ctrl+Shift+C"
|
||||
}
|
||||
Action {
|
||||
id: pasteAction
|
||||
text: qsTr("Paste")
|
||||
shortcut: "Ctrl+Shift+V"
|
||||
}
|
||||
Action {
|
||||
id: zoomIn
|
||||
text: qsTr("Zoom In")
|
||||
shortcut: "Ctrl++"
|
||||
onTriggered: appSettings.incrementScaling()
|
||||
}
|
||||
Action {
|
||||
id: zoomOut
|
||||
text: qsTr("Zoom Out")
|
||||
shortcut: "Ctrl+-"
|
||||
onTriggered: appSettings.decrementScaling()
|
||||
}
|
||||
Action {
|
||||
id: showAboutAction
|
||||
text: qsTr("About")
|
||||
onTriggered: {
|
||||
aboutDialog.show()
|
||||
aboutDialog.requestActivate()
|
||||
aboutDialog.raise()
|
||||
}
|
||||
}
|
||||
Action {
|
||||
id: newTabAction
|
||||
text: qsTr("New Tab")
|
||||
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
|
||||
}
|
||||
}
|
||||
Loader {
|
||||
anchors.centerIn: parent
|
||||
active: appSettings.showTerminalSize
|
||||
sourceComponent: SizeOverlay {
|
||||
z: 3
|
||||
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)
|
||||
}
|
||||
}
|
||||
@@ -17,22 +17,29 @@
|
||||
* 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.2
|
||||
import QtQuick
|
||||
|
||||
Timer {
|
||||
default property bool enableTimer: false
|
||||
property real time
|
||||
QtObject {
|
||||
id: timeManager
|
||||
|
||||
NumberAnimation on time {
|
||||
from: 0
|
||||
to: 100000
|
||||
running: appSettings.fps === 0 && enableTimer
|
||||
duration: 100000
|
||||
loops: Animation.Infinite
|
||||
property bool enableTimer: false
|
||||
property real time: 0
|
||||
|
||||
property int framesPerUpdate: Math.max(1, appSettings.effectsFrameSkip)
|
||||
property int _frameCounter: 0
|
||||
|
||||
property var frameDriver: FrameAnimation {
|
||||
running: enableTimer
|
||||
onTriggered: {
|
||||
timeManager._frameCounter += 1
|
||||
|
||||
if (timeManager._frameCounter >= timeManager.framesPerUpdate) {
|
||||
time = elapsedTime
|
||||
timeManager._frameCounter = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onTriggered: time += interval
|
||||
running: appSettings.fps !== 0 && enableTimer
|
||||
interval: Math.round(1000 / appSettings.fps)
|
||||
repeat: true
|
||||
onEnableTimerChanged: if (!enableTimer) _frameCounter = 0
|
||||
onFramesPerUpdateChanged: _frameCounter = 0
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +0,0 @@
|
||||
|
||||
Fonts in this package are (c) 2010-2014 Style.
|
||||
|
||||
This license is applicable to each font file included in this package in all their variants (ttf, eot, woff, woff2, svg).
|
||||
|
||||
You MAY NOT: sell this font; include/redistribute the font in any font collection regardless of pricing; provide the font for direct download from any web site, modify or rename the font. You MAY: link to "http://style64.org/c64-truetype" in order for others to download and install the font; embed the font (without any modification or file renaming) for display on any web site using @font-face rules; use this font in static images and vector art; include this font (without any modification or file renaming) as part of a software package but ONLY if said software package is freely provided to end users. You may also contact us to negotiate a (possibly commercial) license for your use outside of these guidelines at "http://style64.org/contact-style".
|
||||
|
||||
At all times the most recent version of this license can be found at "http://style64.org/c64-truetype/license".
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
app/qml/fonts/cozette/CozetteVector.ttf
Normal file
BIN
app/qml/fonts/cozette/CozetteVector.ttf
Normal file
Binary file not shown.
Binary file not shown.
93
app/qml/fonts/departure-mono/LICENSE
Normal file
93
app/qml/fonts/departure-mono/LICENSE
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2022–2024 Helena Zhang (helenazhang.com).
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
BIN
app/qml/fonts/fira-code/FiraCodeNerdFontMono-Regular.ttf
Normal file
BIN
app/qml/fonts/fira-code/FiraCodeNerdFontMono-Regular.ttf
Normal file
Binary file not shown.
187
app/qml/fonts/modern-hermit/LICENSE → app/qml/fonts/fira-code/LICENSE.txt
Executable file → Normal file
187
app/qml/fonts/modern-hermit/LICENSE → app/qml/fonts/fira-code/LICENSE.txt
Executable file → Normal file
@@ -1,94 +1,93 @@
|
||||
Copyright (c) 2013, Pablo Caro <me AT pcaro DOT es> - http://pcaro.es/
|
||||
with Reserved Font Name Hermit.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Copyright (c) 2014, The Fira Code Project Authors (https://github.com/tonsky/FiraCode)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
BIN
app/qml/fonts/gohu/GohuFont11NerdFontMono-Regular.ttf
Normal file
BIN
app/qml/fonts/gohu/GohuFont11NerdFontMono-Regular.ttf
Normal file
Binary file not shown.
13
app/qml/fonts/gohu/LICENSE
Normal file
13
app/qml/fonts/gohu/LICENSE
Normal file
@@ -0,0 +1,13 @@
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar
|
||||
14 rue de Plaisance, 75014 Paris, France
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
BIN
app/qml/fonts/greybeard/Greybeard-12px.ttf
Normal file
BIN
app/qml/fonts/greybeard/Greybeard-12px.ttf
Normal file
Binary file not shown.
BIN
app/qml/fonts/greybeard/Greybeard-16px.ttf
Normal file
BIN
app/qml/fonts/greybeard/Greybeard-16px.ttf
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
ProFont
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014 Carl Osterwald, Stephen C. Gilardi, Andrew Welch
|
||||
Copyright (c) 2012-2015 Uwe Waldmann
|
||||
Modified work Copyright 2018 Andy Walker
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -10,13 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
BIN
app/qml/fonts/hack/HackNerdFontMono-Regular.ttf
Normal file
BIN
app/qml/fonts/hack/HackNerdFontMono-Regular.ttf
Normal file
Binary file not shown.
45
app/qml/fonts/hack/LICENSE.txt
Normal file
45
app/qml/fonts/hack/LICENSE.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
The work in the Hack project is Copyright 2018 Source Foundry Authors and licensed under the MIT License
|
||||
|
||||
The work in the DejaVu project was committed to the public domain.
|
||||
|
||||
Bitstream Vera Sans Mono Copyright 2003 Bitstream Inc. and licensed under the Bitstream Vera License with Reserved Font Names "Bitstream" and "Vera"
|
||||
|
||||
### MIT License
|
||||
|
||||
Copyright (c) 2018 Source Foundry Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
### BITSTREAM VERA LICENSE
|
||||
|
||||
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
|
||||
|
||||
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words "Bitstream" or the word "Vera".
|
||||
|
||||
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "Bitstream Vera" names.
|
||||
|
||||
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
|
||||
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.
|
||||
BIN
app/qml/fonts/ibm-3278/3270NerdFontMono-Regular.ttf
Normal file
BIN
app/qml/fonts/ibm-3278/3270NerdFontMono-Regular.ttf
Normal file
Binary file not shown.
@@ -1,4 +1,6 @@
|
||||
Copyright (c) 2011-2017, Ricardo Banffy.
|
||||
Copyright 2022 The 3270font Authors (https://github.com/rbanffy/3270font)
|
||||
|
||||
Copyright (c) 2011-2022, Ricardo Banffy.
|
||||
Copyright (c) 1993-2011, Paul Mattes.
|
||||
Copyright (c) 2004-2005, Don Russell.
|
||||
Copyright (c) 2004, Dick Altenbern.
|
||||
@@ -10,27 +12,27 @@ Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Ricardo Banffy, Paul Mattes, Don Russell,
|
||||
Dick Altenbern, Jeff Sparkes, GTRC nor the names of their contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
|
||||
* Neither the name of Ricardo Banffy, Paul Mattes, Don Russell,
|
||||
Dick Altenbern, Jeff Sparkes, GTRC nor the names of their contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL RICARDO BANFFY, PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF
|
||||
SPARKES OR GTRC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL RICARDO BANFFY, PAUL MATTES, DON RUSSELL, DICK ALTENBERN, JEFF
|
||||
SPARKES OR GTRC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The Debian Logo glyph is based on the Debian Open Use Logo and is
|
||||
BIN
app/qml/fonts/iosevka/IosevkaTermNerdFontMono-Regular.ttf
Normal file
BIN
app/qml/fonts/iosevka/IosevkaTermNerdFontMono-Regular.ttf
Normal file
Binary file not shown.
110
app/qml/fonts/iosevka/LICENSE.txt
Normal file
110
app/qml/fonts/iosevka/LICENSE.txt
Normal file
@@ -0,0 +1,110 @@
|
||||
Copyright (c) 2015-2023, Renzhi Li (aka. Belleve Invis, belleve@typeof.net)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
--------------------------
|
||||
|
||||
|
||||
SIL Open Font License v1.1
|
||||
====================================================
|
||||
|
||||
|
||||
Preamble
|
||||
----------
|
||||
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
|
||||
Definitions
|
||||
-------------
|
||||
|
||||
`"Font Software"` refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
`"Reserved Font Name"` refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
`"Original Version"` refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
`"Modified Version"` refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
`"Author"` refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
|
||||
Permission & Conditions
|
||||
------------------------
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1. Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2. Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3. No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4. The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5. The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
|
||||
|
||||
Termination
|
||||
-----------
|
||||
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
93
app/qml/fonts/jetbrains-mono/LICENSE.txt
Normal file
93
app/qml/fonts/jetbrains-mono/LICENSE.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
dopustz:-480
|
||||
Binary file not shown.
@@ -1,31 +0,0 @@
|
||||
WHAT IS THIS?
|
||||
|
||||
This is ProFont TrueType, converted to Windows TrueType format
|
||||
by Mike Smith, with some tweaks added by "ardu".
|
||||
|
||||
Modifications include:
|
||||
- A Euro character
|
||||
- Missing characters from the Latin 1 code page
|
||||
- Full support for CodePage 850. These are mostly the famous
|
||||
block/box characters you know from DOS. Very useful if you use
|
||||
Mightnight Commander through PuTTY.
|
||||
- Fixed metrics so that point size of 9 works correctly. Until now
|
||||
you had to select 7 to obtain the native point size of 9.
|
||||
- Added some quick&dirty hinting for point size of 9. Most characters
|
||||
now match closely the look of the bitmap version.
|
||||
Don't expect it to look good on anything else than Windows...
|
||||
|
||||
|
||||
|
||||
To get the full original Distribution, other ProFont builds
|
||||
and more information
|
||||
go to <http://tobiasjung.name/profont/>
|
||||
|
||||
|
||||
DISCLAIMER
|
||||
See LICENSE file
|
||||
|
||||
|
||||
Tobias Jung
|
||||
January 2014
|
||||
profont@tobiasjung.name
|
||||
@@ -1,7 +0,0 @@
|
||||
Copyright (c) 2004, 2005 Tristan Grimmer
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Binary file not shown.
Binary file not shown.
BIN
app/qml/fonts/oldschool-pc-fonts/PxPlus_IBM_EGA_8x8.ttf
Normal file
BIN
app/qml/fonts/oldschool-pc-fonts/PxPlus_IBM_EGA_8x8.ttf
Normal file
Binary file not shown.
BIN
app/qml/fonts/oldschool-pc-fonts/PxPlus_IBM_VGA_8x16.ttf
Normal file
BIN
app/qml/fonts/oldschool-pc-fonts/PxPlus_IBM_VGA_8x16.ttf
Normal file
Binary file not shown.
22
app/qml/fonts/opendyslexic/LICENSE.txt
Normal file
22
app/qml/fonts/opendyslexic/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
License
|
||||
-------
|
||||
The license for this font is:
|
||||
|
||||
♡ Copying is an act of love. Please copy.
|
||||
Bitstream License:
|
||||
|
||||
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license (“Fonts”) and associated documentation files (the “Font Software”), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright and trademark notices and this permission notice shall be included in all copies of one or more of the Font Software typefaces.
|
||||
|
||||
The Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing either the words “Bitstream” or the word “Vera”.
|
||||
|
||||
This License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the “Bitstream Vera” names.
|
||||
|
||||
The Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself.
|
||||
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the names of Gnome, the Gnome Foundation, and Bitstream Inc., shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Font Software without prior written authorization from the Gnome Foundation or Bitstream Inc., respectively. For further information, contact: fonts at gnome dot org.
|
||||
BIN
app/qml/fonts/opendyslexic/OpenDyslexicMNerdFontMono-Regular.otf
Normal file
BIN
app/qml/fonts/opendyslexic/OpenDyslexicMNerdFontMono-Regular.otf
Normal file
Binary file not shown.
Binary file not shown.
BIN
app/qml/fonts/pet-me/PetMe64.ttf
Normal file
BIN
app/qml/fonts/pet-me/PetMe64.ttf
Normal file
Binary file not shown.
93
app/qml/fonts/source-code-pro/LICENSE.txt
Normal file
93
app/qml/fonts/source-code-pro/LICENSE.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2010-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
Copyright (c) 2010 Dimitar Toshkov Zhekov,
|
||||
with Reserved Font Name "Terminus Font".
|
||||
|
||||
Copyright (c) 2011 Tilman Blumenbach,
|
||||
Copyright (c) 2011-2021 Tilman Blumenbach,
|
||||
with Reserved Font Name "Terminus (TTF)".
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
BIN
app/qml/fonts/terminus/TerminessNerdFontMono-Regular.ttf
Normal file
BIN
app/qml/fonts/terminus/TerminessNerdFontMono-Regular.ttf
Normal file
Binary file not shown.
1
app/qml/fonts/unscii/LICENSE
Normal file
1
app/qml/fonts/unscii/LICENSE
Normal file
@@ -0,0 +1 @@
|
||||
You can consider it Public Domain (or CC-0) except for the files derived from or containing parts of Roman Czyborra's Unifont project (unifont.hex, hex2bdf.pl, unscii-16-full.*) which fall under GPL. See https://savannah.gnu.org/projects/unifont/ for more.
|
||||
BIN
app/qml/fonts/unscii/unscii-16-full.ttf
Normal file
BIN
app/qml/fonts/unscii/unscii-16-full.ttf
Normal file
Binary file not shown.
BIN
app/qml/fonts/unscii/unscii-8-thin.ttf
Normal file
BIN
app/qml/fonts/unscii/unscii-8-thin.ttf
Normal file
Binary file not shown.
BIN
app/qml/fonts/unscii/unscii-8.ttf
Normal file
BIN
app/qml/fonts/unscii/unscii-8.ttf
Normal file
Binary file not shown.
166
app/qml/main.qml
166
app/qml/main.qml
@@ -18,143 +18,57 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import "menus"
|
||||
QtObject {
|
||||
id: appRoot
|
||||
|
||||
ApplicationWindow {
|
||||
id: terminalWindow
|
||||
|
||||
width: 1024
|
||||
height: 768
|
||||
|
||||
// Save window properties automatically
|
||||
onXChanged: appSettings.x = x
|
||||
onYChanged: appSettings.y = y
|
||||
onWidthChanged: appSettings.width = width
|
||||
onHeightChanged: appSettings.height = height
|
||||
|
||||
// Load saved window geometry and show the window
|
||||
Component.onCompleted: {
|
||||
x = appSettings.x
|
||||
y = appSettings.y
|
||||
width = appSettings.width
|
||||
height = appSettings.height
|
||||
|
||||
visible = true
|
||||
property ApplicationSettings appSettings: ApplicationSettings {
|
||||
onInitializedSettings: appRoot.createWindow()
|
||||
}
|
||||
|
||||
minimumWidth: 320
|
||||
minimumHeight: 240
|
||||
|
||||
visible: false
|
||||
|
||||
property bool fullscreen: appSettings.fullscreen
|
||||
onFullscreenChanged: visibility = (fullscreen ? Window.FullScreen : Window.Windowed)
|
||||
|
||||
menuBar: WindowMenu {
|
||||
id: mainMenu
|
||||
visible: (Qt.platform.os === "osx" || appSettings.showMenubar)
|
||||
property TimeManager timeManager: TimeManager {
|
||||
enableTimer: windowsModel.count > 0
|
||||
}
|
||||
|
||||
property string wintitle: appSettings.wintitle
|
||||
|
||||
color: "#00000000"
|
||||
title: terminalContainer.title || qsTr(appSettings.wintitle)
|
||||
|
||||
Action {
|
||||
id: showMenubarAction
|
||||
text: qsTr("Show Menubar")
|
||||
enabled: Qt.platform.os !== "osx"
|
||||
shortcut: "Ctrl+Shift+M"
|
||||
checkable: true
|
||||
checked: appSettings.showMenubar
|
||||
onTriggered: appSettings.showMenubar = !appSettings.showMenubar
|
||||
}
|
||||
Action {
|
||||
id: fullscreenAction
|
||||
text: qsTr("Fullscreen")
|
||||
enabled: Qt.platform.os !== "osx"
|
||||
shortcut: "Alt+F11"
|
||||
onTriggered: appSettings.fullscreen = !appSettings.fullscreen
|
||||
checkable: true
|
||||
checked: appSettings.fullscreen
|
||||
}
|
||||
Action {
|
||||
id: quitAction
|
||||
text: qsTr("Quit")
|
||||
shortcut: "Ctrl+Shift+Q"
|
||||
onTriggered: Qt.quit()
|
||||
}
|
||||
Action {
|
||||
id: showsettingsAction
|
||||
text: qsTr("Settings")
|
||||
onTriggered: {
|
||||
settingswindow.show()
|
||||
settingswindow.requestActivate()
|
||||
settingswindow.raise()
|
||||
}
|
||||
}
|
||||
Action {
|
||||
id: copyAction
|
||||
text: qsTr("Copy")
|
||||
shortcut: "Ctrl+Shift+C"
|
||||
}
|
||||
Action {
|
||||
id: pasteAction
|
||||
text: qsTr("Paste")
|
||||
shortcut: "Ctrl+Shift+V"
|
||||
}
|
||||
Action {
|
||||
id: zoomIn
|
||||
text: qsTr("Zoom In")
|
||||
shortcut: "Ctrl++"
|
||||
onTriggered: appSettings.incrementScaling()
|
||||
}
|
||||
Action {
|
||||
id: zoomOut
|
||||
text: qsTr("Zoom Out")
|
||||
shortcut: "Ctrl+-"
|
||||
onTriggered: appSettings.decrementScaling()
|
||||
}
|
||||
Action {
|
||||
id: showAboutAction
|
||||
text: qsTr("About")
|
||||
onTriggered: {
|
||||
aboutDialog.show()
|
||||
aboutDialog.requestActivate()
|
||||
aboutDialog.raise()
|
||||
}
|
||||
}
|
||||
ApplicationSettings {
|
||||
id: appSettings
|
||||
}
|
||||
TerminalContainer {
|
||||
id: terminalContainer
|
||||
width: parent.width
|
||||
height: (parent.height + Math.abs(y))
|
||||
}
|
||||
SettingsWindow {
|
||||
id: settingswindow
|
||||
property SettingsWindow settingsWindow: SettingsWindow {
|
||||
visible: false
|
||||
}
|
||||
AboutDialog {
|
||||
id: aboutDialog
|
||||
|
||||
property AboutDialog aboutWindow: AboutDialog {
|
||||
visible: false
|
||||
}
|
||||
Loader {
|
||||
anchors.centerIn: parent
|
||||
active: appSettings.showTerminalSize
|
||||
sourceComponent: SizeOverlay {
|
||||
z: 3
|
||||
terminalSize: terminalContainer.terminalSize
|
||||
|
||||
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)
|
||||
if (!window)
|
||||
return
|
||||
|
||||
windowsModel.append({ window: window })
|
||||
window.show()
|
||||
window.requestActivate()
|
||||
}
|
||||
onClosing: {
|
||||
// OSX Since we are currently supporting only one window
|
||||
// quit the application when it is closed.
|
||||
if (Qt.platform.os === "osx")
|
||||
Qt.quit()
|
||||
|
||||
function closeWindow(window) {
|
||||
for (var i = 0; i < windowsModel.count; i++) {
|
||||
if (windowsModel.get(i).window === window) {
|
||||
windowsModel.remove(i)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
window.destroy()
|
||||
|
||||
if (windowsModel.count === 0) {
|
||||
settingsWindow.close()
|
||||
aboutWindow.close()
|
||||
appSettings.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,15 @@ Menu {
|
||||
action: showsettingsAction
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
|
||||
Menu {
|
||||
title: qsTr("File")
|
||||
MenuItem {
|
||||
action: newWindowAction
|
||||
}
|
||||
MenuItem {
|
||||
action: newTabAction
|
||||
}
|
||||
MenuSeparator {}
|
||||
MenuItem {
|
||||
action: quitAction
|
||||
}
|
||||
@@ -79,11 +84,10 @@ Menu {
|
||||
text: model.text
|
||||
onTriggered: {
|
||||
appSettings.loadProfileString(obj_string)
|
||||
appSettings.handleFontChanged()
|
||||
}
|
||||
}
|
||||
onObjectAdded: profilesMenu.insertItem(index, object)
|
||||
onObjectRemoved: profilesMenu.removeItem(object)
|
||||
onObjectAdded: function(index, object) { profilesMenu.insertItem(index, object) }
|
||||
onObjectRemoved: function(object) { profilesMenu.removeItem(object) }
|
||||
}
|
||||
}
|
||||
Menu {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user