Merge branch 'cutefishos:main' into main

pull/17/head
Maksym Titenko 4 years ago committed by GitHub
commit 7e296fbf48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,6 +7,18 @@ on:
branches: [ main ]
jobs:
archlinux:
name: ArchLinux
runs-on: ubuntu-latest
container: docker.io/library/archlinux:latest
steps:
- name: Checkout Source
uses: actions/checkout@v2
- name: dependencies
run: pacman -Sy; pacman -S --noconfirm fishui base-devel qt5-base qt5-svg cmake extra-cmake-modules qt5-tools
- name: Build
run: mkdir build; cd build; cmake .. ; make -j$(nproc);
debian:
name: Debian
runs-on: ubuntu-latest

@ -336,6 +336,7 @@ TerminalDisplay::TerminalDisplay(QQuickItem *parent)
, m_font("Monospace", 12)
, m_colorRole(QPalette::Background)
, m_full_cursor_height(false)
, m_backgroundOpacity(1.0)
{
// terminal applications are not designed with Right-To-Left in mind,
// so the layout is forced to Left-To-Right
@ -2843,6 +2844,32 @@ bool TerminalDisplay::handleShortcutOverrideEvent(QKeyEvent* keyEvent)
return false;
}
qreal TerminalDisplay::backgroundOpacity() const
{
return m_backgroundOpacity;
}
void TerminalDisplay::setBackgroundOpacity(const qreal &backgroundOpacity)
{
if (m_backgroundOpacity != backgroundOpacity) {
m_backgroundOpacity = backgroundOpacity;
const ColorScheme *cs;
if (!availableColorSchemes().contains(_colorScheme))
cs = ColorSchemeManager::instance()->defaultColorScheme();
else
cs = ColorSchemeManager::instance()->findColorScheme(_colorScheme);
if (cs) {
QColor color = cs->backgroundColor();
color.setAlphaF(m_backgroundOpacity);
setFillColor(color);
}
emit backgroundOpacityChanged();
}
}
bool TerminalDisplay::event(QEvent* event)
{
bool eventHandled = false;
@ -3259,7 +3286,9 @@ void TerminalDisplay::setColorScheme(const QString &name)
cs->getColorTable(table);
setColorTable(table);
setFillColor(cs->backgroundColor());
QColor bgColor = cs->backgroundColor();
bgColor.setAlphaF(m_backgroundOpacity);
setFillColor(bgColor);
_colorScheme = name;
emit colorSchemeChanged();
}

@ -97,6 +97,8 @@ class TerminalDisplay : public QQuickPaintedItem
Q_PROPERTY(bool selectedText READ selectedText CONSTANT)
Q_PROPERTY(qreal backgroundOpacity READ backgroundOpacity WRITE setBackgroundOpacity NOTIFY backgroundOpacityChanged)
public:
/** Constructs a new terminal display widget with the specified parent. */
explicit TerminalDisplay(QQuickItem *parent = nullptr);
@ -120,6 +122,9 @@ public:
/** Sets the opacity of the terminal display. */
void setOpacity(qreal opacity);
qreal backgroundOpacity() const;
void setBackgroundOpacity(const qreal &backgroundOpacity);
/**
* This enum describes the location where the scroll bar is positioned in the display widget.
*/
@ -553,6 +558,7 @@ public slots:
void simulateMouseDoubleClick(int x, int y, int button, int buttons, int modifiers);
signals:
void backgroundOpacityChanged();
/**
* Emitted when the user presses a key whilst the terminal widget has focus.
@ -888,6 +894,8 @@ private:
KSession *m_session;
bool m_full_cursor_height;
qreal m_backgroundOpacity;
QFont font() const { return m_font; }
const QPalette palette() { return m_palette; }

@ -25,4 +25,7 @@ Settings {
property int height: 500
property int fontPointSize: 10
property bool blinkingCursor: true
property real opacity: 1.0
property bool blur: false
}

@ -0,0 +1,102 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12
import FishUI 1.0 as FishUI
FishUI.Window {
id: control
width: 400
height: 400
maximumHeight: 400
maximumWidth: 400
minimumWidth: 400
minimumHeight: 400
visible: false
ColumnLayout {
id: _mainLayout
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing
Item {
Layout.fillWidth: true
Layout.preferredHeight: 45
Rectangle {
anchors.fill: parent
color: FishUI.Theme.secondBackgroundColor
radius: FishUI.Theme.smallRadius
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
Label {
text: qsTr("Transparency")
}
Item {
width: FishUI.Units.largeSpacing
}
Slider {
id: transparencySlider
Layout.fillHeight: true
Layout.fillWidth: true
from: 0.1
to: 1.0
stepSize: 0.05
Component.onCompleted: {
transparencySlider.value = settings.opacity
}
onValueChanged: settings.opacity = transparencySlider.value
}
}
}
Item {
Layout.fillWidth: true
Layout.preferredHeight: 45
Rectangle {
anchors.fill: parent
color: FishUI.Theme.secondBackgroundColor
radius: FishUI.Theme.smallRadius
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.smallSpacing
Label {
text: qsTr("Window Blur")
}
Item {
Layout.fillWidth: true
}
Switch {
Layout.fillHeight: true
checked: settings.blur
onCheckedChanged: settings.blur = checked
}
}
}
Item {
Layout.fillHeight: true
}
}
}

@ -33,7 +33,12 @@ Page {
focus: true
// Drop effect
opacity: _dropArea.containsDrag ? 0.8 : 1
// opacity: _dropArea.containsDrag ? 0.8 : 1
// opacity: 0.5
background: Rectangle {
color: "transparent"
}
signal urlsDropped(var urls)
signal keyPressed(var event)
@ -106,6 +111,7 @@ Page {
font.pointSize: settings.fontPointSize
blinkingCursor: settings.blinkingCursor
fullCursorHeight: true
backgroundOpacity: 0
Keys.enabled: true
Keys.onPressed: control.keyPressed(event)
@ -202,6 +208,14 @@ Page {
text: qsTr("Open File Manager")
onTriggered: Process.openFileManager(_session.currentDir)
}
MenuItem {
text: qsTr("Settings")
onTriggered: {
settingsDialog.show()
settingsDialog.raise()
}
}
}
ScrollBar {

@ -34,7 +34,8 @@ FishUI.Window {
height: settings.height
title: currentItem && currentItem.terminal ? currentItem.terminal.session.title : ""
background.color: FishUI.Theme.secondBackgroundColor
background.color: FishUI.Theme.backgroundColor
background.opacity: settings.opacity
header.height: 45
property int currentIndex: -1
@ -49,6 +50,17 @@ FishUI.Window {
onOkBtnClicked: Qt.quit()
}
SettingsDialog {
id: settingsDialog
}
FishUI.WindowBlur {
view: root
geometry: Qt.rect(root.x, root.y, root.width, root.height)
windowRadius: root.background.radius
enabled: settings.blur
}
onClosing: {
if (!root.isMaximized) {
settings.width = root.width
@ -92,7 +104,7 @@ FishUI.Window {
highlight: Rectangle {
color: FishUI.Theme.highlightColor
opacity: FishUI.Theme.darkMode ? 0.2 : 0.1
opacity: 1
border.width: 0
radius: FishUI.Theme.smallRadius
}
@ -136,7 +148,7 @@ FishUI.Window {
elide: Label.ElideRight
font.pointSize: 9
font.family: "Noto Sans Mono"
color: isCurrent ? FishUI.Theme.highlightColor : FishUI.Theme.textColor
color: isCurrent ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor
}
Item {
@ -147,7 +159,7 @@ FishUI.Window {
Layout.preferredHeight: 24
Layout.preferredWidth: 24
size: 24
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark/" : "light/") + "close.svg"
source: "qrc:/images/" + (FishUI.Theme.darkMode || isCurrent ? "dark/" : "light/") + "close.svg"
onClicked: closeTab(index)
}
}

@ -9,5 +9,6 @@
<file>images/dark/close.svg</file>
<file>qml/ImageButton.qml</file>
<file>qml/ExitPromptDialog.qml</file>
<file>qml/SettingsDialog.qml</file>
</qresource>
</RCC>

@ -19,28 +19,46 @@
<translation>Cancel</translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="../src/qml/SettingsDialog.qml" line="43"/>
<source>Transparency</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/SettingsDialog.qml" line="83"/>
<source>Window Blur</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Terminal</name>
<message>
<location filename="../src/qml/Terminal.qml" line="171"/>
<location filename="../src/qml/Terminal.qml" line="177"/>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="177"/>
<location filename="../src/qml/Terminal.qml" line="191"/>
<location filename="../src/qml/Terminal.qml" line="183"/>
<location filename="../src/qml/Terminal.qml" line="197"/>
<source>Paste</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="197"/>
<location filename="../src/qml/Terminal.qml" line="203"/>
<source>Select All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="202"/>
<location filename="../src/qml/Terminal.qml" line="208"/>
<source>Open File Manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="213"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

@ -19,28 +19,46 @@
<translation></translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="../src/qml/SettingsDialog.qml" line="43"/>
<source>Transparency</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/SettingsDialog.qml" line="83"/>
<source>Window Blur</source>
<translation></translation>
</message>
</context>
<context>
<name>Terminal</name>
<message>
<location filename="../src/qml/Terminal.qml" line="171"/>
<location filename="../src/qml/Terminal.qml" line="177"/>
<source>Copy</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="177"/>
<location filename="../src/qml/Terminal.qml" line="191"/>
<location filename="../src/qml/Terminal.qml" line="183"/>
<location filename="../src/qml/Terminal.qml" line="197"/>
<source>Paste</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="197"/>
<location filename="../src/qml/Terminal.qml" line="203"/>
<source>Select All</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="202"/>
<location filename="../src/qml/Terminal.qml" line="208"/>
<source>Open File Manager</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="213"/>
<source>Settings</source>
<translation></translation>
</message>
</context>
</TS>

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ts_ZA">
<context>
<name>ExitPromptDialog</name>
<message>
<location filename="../src/qml/ExitPromptDialog.qml" line="49"/>
<source>Process is running, are you sure you want to quit?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/ExitPromptDialog.qml" line="57"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/ExitPromptDialog.qml" line="63"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsDialog</name>
<message>
<location filename="../src/qml/SettingsDialog.qml" line="43"/>
<source>Transparency</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/SettingsDialog.qml" line="83"/>
<source>Window Blur</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Terminal</name>
<message>
<location filename="../src/qml/Terminal.qml" line="177"/>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="183"/>
<location filename="../src/qml/Terminal.qml" line="197"/>
<source>Paste</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="203"/>
<source>Select All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="208"/>
<source>Open File Manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Terminal.qml" line="213"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Loading…
Cancel
Save