mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-21 20:39:00 +00:00
Added selections copy and paste!
This commit is contained in:
parent
883520a9c6
commit
5d6040e45d
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
|
import QtQuick.Controls 1.0
|
||||||
|
|
||||||
import org.kde.konsole 0.1
|
import org.kde.konsole 0.1
|
||||||
|
|
||||||
@ -82,11 +83,63 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Menu{
|
||||||
|
id: contextmenu
|
||||||
|
MenuItem{
|
||||||
|
text: qsTr("Copy")
|
||||||
|
onTriggered: kterminal.item.copyClipboard()
|
||||||
|
}
|
||||||
|
MenuItem{
|
||||||
|
text: qsTr("Paste")
|
||||||
|
onTriggered: kterminal.item.pasteClipboard()
|
||||||
|
}
|
||||||
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
acceptedButtons: Qt.NoButton
|
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onWheel:
|
onWheel:
|
||||||
wheel.angleDelta.y > 0 ? kterminal.item.scrollUp() : kterminal.item.scrollDown()
|
wheel.angleDelta.y > 0 ? kterminal.item.scrollUp() : kterminal.item.scrollDown()
|
||||||
|
onClicked: {
|
||||||
|
console.log(correctDistortion(0,0))
|
||||||
|
if (mouse.button == Qt.RightButton){
|
||||||
|
contextmenu.popup();
|
||||||
|
} else if (mouse.button == Qt.MiddleButton){
|
||||||
|
kterminal.item.pasteSelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onDoubleClicked: {
|
||||||
|
if (mouse.button == Qt.LeftButton){
|
||||||
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
|
kterminal.item.mouseDoubleClick(coord.width, coord.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onPositionChanged: {
|
||||||
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
|
kterminal.item.mouseMove(coord.width, coord.height);
|
||||||
|
}
|
||||||
|
onPressed: {
|
||||||
|
if (mouse.button == Qt.LeftButton){
|
||||||
|
var coord = correctDistortion(mouse.x, mouse.y);
|
||||||
|
kterminal.item.mousePress(coord.width, coord.height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onReleased: {
|
||||||
|
if (mouse.button == Qt.LeftButton){
|
||||||
|
kterminal.item.mouseRelease(mouse.x, mouse.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function correctDistortion(x, y){
|
||||||
|
x = x / width;
|
||||||
|
y = y / height;
|
||||||
|
|
||||||
|
var cc = Qt.size(0.5 - x, 0.5 - y);
|
||||||
|
var distortion = (cc.height * cc.height + cc.width * cc.width) * shadersettings.screen_distortion;
|
||||||
|
|
||||||
|
return Qt.size((x - cc.width * (1+distortion) * distortion) * width,
|
||||||
|
(y - cc.height * (1+distortion) * distortion) * height)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ShaderEffectSource{
|
ShaderEffectSource{
|
||||||
id: source
|
id: source
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 3.0.1, 2014-04-06T17:39:45. -->
|
<!-- Written by QtCreator 3.0.1, 2014-04-16T10:55:04. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
@ -73,40 +73,6 @@
|
|||||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
|
||||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
|
||||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
|
||||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
|
||||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
|
||||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
|
||||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
|
||||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
|
||||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
|
||||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
|
||||||
<value type="int">0</value>
|
|
||||||
<value type="int">1</value>
|
|
||||||
<value type="int">2</value>
|
|
||||||
<value type="int">3</value>
|
|
||||||
<value type="int">4</value>
|
|
||||||
<value type="int">5</value>
|
|
||||||
<value type="int">6</value>
|
|
||||||
<value type="int">7</value>
|
|
||||||
<value type="int">8</value>
|
|
||||||
<value type="int">9</value>
|
|
||||||
<value type="int">10</value>
|
|
||||||
<value type="int">11</value>
|
|
||||||
<value type="int">12</value>
|
|
||||||
<value type="int">13</value>
|
|
||||||
<value type="int">14</value>
|
|
||||||
</valuelist>
|
|
||||||
<value type="int" key="PE.EnvironmentAspect.Base">0</value>
|
<value type="int" key="PE.EnvironmentAspect.Base">0</value>
|
||||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
|
||||||
|
@ -106,8 +106,11 @@ ApplicationWindow{
|
|||||||
}
|
}
|
||||||
Terminal{
|
Terminal{
|
||||||
id: terminal
|
id: terminal
|
||||||
width: parent.width * shadersettings.terminal_scaling
|
anchors.centerIn: parent
|
||||||
height: parent.height * shadersettings.terminal_scaling
|
property int frameOffsetX: frame.item.addedWidth - frame.item.borderLeft - frame.item.borderRight
|
||||||
|
property int frameOffsetY: frame.item.addedHeight -frame.item.borderTop - frame.item.borderBottom
|
||||||
|
width: (parent.width + frameOffsetX) * shadersettings.terminal_scaling
|
||||||
|
height: (parent.height + frameOffsetY) * shadersettings.terminal_scaling
|
||||||
}
|
}
|
||||||
ShaderEffectSource{
|
ShaderEffectSource{
|
||||||
id: theSource
|
id: theSource
|
||||||
|
@ -5484,35 +5484,35 @@ compiler_clean: compiler_moc_header_clean
|
|||||||
####### Install
|
####### Install
|
||||||
|
|
||||||
install_target: first FORCE
|
install_target: first FORCE
|
||||||
@test -d $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole || mkdir -p $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole
|
@test -d $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole || mkdir -p $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole
|
||||||
-$(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/tmp/cool/imports/org/kde/konsole/$(TARGET)"
|
-$(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/imports/org/kde/konsole/$(TARGET)"
|
||||||
-$(STRIP) --strip-unneeded "$(INSTALL_ROOT)/tmp/cool/imports/org/kde/konsole/$(TARGET)"
|
-$(STRIP) --strip-unneeded "$(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/imports/org/kde/konsole/$(TARGET)"
|
||||||
|
|
||||||
uninstall_target: FORCE
|
uninstall_target: FORCE
|
||||||
-$(DEL_FILE) "$(INSTALL_ROOT)/tmp/cool/imports/org/kde/konsole/$(TARGET)"
|
-$(DEL_FILE) "$(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/imports/org/kde/konsole/$(TARGET)"
|
||||||
-$(DEL_DIR) $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/
|
-$(DEL_DIR) $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/
|
||||||
|
|
||||||
|
|
||||||
install_qmldir: first FORCE
|
install_qmldir: first FORCE
|
||||||
@test -d $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole || mkdir -p $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole
|
@test -d $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole || mkdir -p $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole
|
||||||
-$(INSTALL_FILE) /tmp/cool/konsole-qml-plugin/src/qmldir $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/
|
-$(INSTALL_FILE) /home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/src/qmldir $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/
|
||||||
-$(INSTALL_FILE) /tmp/cool/konsole-qml-plugin/src/plugins.qmltypes $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/
|
-$(INSTALL_FILE) /home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/src/plugins.qmltypes $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/
|
||||||
|
|
||||||
uninstall_qmldir: FORCE
|
uninstall_qmldir: FORCE
|
||||||
-$(DEL_FILE) -r $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/plugins.qmltypes
|
-$(DEL_FILE) -r $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/plugins.qmltypes
|
||||||
-$(DEL_FILE) -r $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/qmldir
|
-$(DEL_FILE) -r $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/qmldir
|
||||||
-$(DEL_DIR) $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/
|
-$(DEL_DIR) $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/
|
||||||
|
|
||||||
|
|
||||||
install_assets: first FORCE
|
install_assets: first FORCE
|
||||||
@test -d $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole || mkdir -p $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole
|
@test -d $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole || mkdir -p $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole
|
||||||
-$(INSTALL_DIR) /tmp/cool/konsole-qml-plugin/assets/color-schemes $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/
|
-$(INSTALL_DIR) /home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/assets/color-schemes $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/
|
||||||
-$(INSTALL_DIR) /tmp/cool/konsole-qml-plugin/assets/kb-layouts $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/
|
-$(INSTALL_DIR) /home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/assets/kb-layouts $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/
|
||||||
|
|
||||||
uninstall_assets: FORCE
|
uninstall_assets: FORCE
|
||||||
-$(DEL_FILE) -r $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/kb-layouts
|
-$(DEL_FILE) -r $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/kb-layouts
|
||||||
-$(DEL_FILE) -r $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/color-schemes
|
-$(DEL_FILE) -r $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/color-schemes
|
||||||
-$(DEL_DIR) $(INSTALL_ROOT)/tmp/cool/konsole-qml-plugin/../imports/org/kde/konsole/
|
-$(DEL_DIR) $(INSTALL_ROOT)/home/swordfish/workspaces/qt5/cool-old-term/konsole-qml-plugin/../imports/org/kde/konsole/
|
||||||
|
|
||||||
|
|
||||||
install: install_target install_qmldir install_assets FORCE
|
install: install_target install_qmldir install_assets FORCE
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -304,7 +304,10 @@ public slots:
|
|||||||
void setColorScheme(const QString &name);
|
void setColorScheme(const QString &name);
|
||||||
QStringList availableColorSchemes();
|
QStringList availableColorSchemes();
|
||||||
|
|
||||||
void click(qreal x, qreal y);
|
void mousePress(qreal x, qreal y);
|
||||||
|
void mouseMove(qreal x, qreal y);
|
||||||
|
void mouseDoubleClick(qreal x, qreal y);
|
||||||
|
void mouseRelease(qreal x, qreal y);
|
||||||
|
|
||||||
bool autoFocus() { return m_focusOnClick; }
|
bool autoFocus() { return m_focusOnClick; }
|
||||||
void setAutoFocus(bool au);
|
void setAutoFocus(bool au);
|
||||||
@ -456,9 +459,9 @@ protected:
|
|||||||
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
|
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
|
||||||
QRect geometryRound(const QRectF &r) const;
|
QRect geometryRound(const QRectF &r) const;
|
||||||
|
|
||||||
void mousePressEvent(QMouseEvent*ev);
|
//void mousePressEvent(QMouseEvent*ev);
|
||||||
// void mouseReleaseEvent( QMouseEvent* );
|
//void mouseReleaseEvent( QMouseEvent* );
|
||||||
// void mouseMoveEvent( QMouseEvent* );
|
//void mouseMoveEvent( QMouseEvent* );
|
||||||
|
|
||||||
void focusInEvent(QFocusEvent* event);
|
void focusInEvent(QFocusEvent* event);
|
||||||
void focusOutEvent(QFocusEvent* event);
|
void focusOutEvent(QFocusEvent* event);
|
||||||
@ -677,7 +680,6 @@ private:
|
|||||||
// color of the character under the cursor is used
|
// color of the character under the cursor is used
|
||||||
QColor _cursorColor;
|
QColor _cursorColor;
|
||||||
|
|
||||||
|
|
||||||
struct InputMethodData
|
struct InputMethodData
|
||||||
{
|
{
|
||||||
QString preeditString;
|
QString preeditString;
|
||||||
@ -701,20 +703,20 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class AutoScrollHandler : public QObject
|
//class AutoScrollHandler : public QObject
|
||||||
{
|
//{
|
||||||
Q_OBJECT
|
// Q_OBJECT
|
||||||
|
|
||||||
public:
|
//public:
|
||||||
AutoScrollHandler(QQuickItem* parent);
|
// AutoScrollHandler(QQuickItem* parent);
|
||||||
|
|
||||||
protected:
|
//protected:
|
||||||
virtual void timerEvent(QTimerEvent* event);
|
// virtual void timerEvent(QTimerEvent* event);
|
||||||
virtual bool eventFilter(QObject* watched,QEvent* event);
|
// virtual bool eventFilter(QObject* watched,QEvent* event);
|
||||||
|
|
||||||
private:
|
//private:
|
||||||
QQuickItem* widget() const { return static_cast<QQuickItem*>(parent()); }
|
// QQuickItem* widget() const { return static_cast<QQuickItem*>(parent()); }
|
||||||
int _timerId;
|
// int _timerId;
|
||||||
};
|
//};
|
||||||
|
|
||||||
#endif // TERMINALDISPLAY_H
|
#endif // TERMINALDISPLAY_H
|
||||||
|
@ -118,7 +118,22 @@ Module {
|
|||||||
}
|
}
|
||||||
Method { name: "availableColorSchemes"; type: "QStringList" }
|
Method { name: "availableColorSchemes"; type: "QStringList" }
|
||||||
Method {
|
Method {
|
||||||
name: "click"
|
name: "mousePress"
|
||||||
|
Parameter { name: "x"; type: "double" }
|
||||||
|
Parameter { name: "y"; type: "double" }
|
||||||
|
}
|
||||||
|
Method {
|
||||||
|
name: "mouseMove"
|
||||||
|
Parameter { name: "x"; type: "double" }
|
||||||
|
Parameter { name: "y"; type: "double" }
|
||||||
|
}
|
||||||
|
Method {
|
||||||
|
name: "mouseRelease"
|
||||||
|
Parameter { name: "x"; type: "double" }
|
||||||
|
Parameter { name: "y"; type: "double" }
|
||||||
|
}
|
||||||
|
Method {
|
||||||
|
name: "mouseDoubleClick"
|
||||||
Parameter { name: "x"; type: "double" }
|
Parameter { name: "x"; type: "double" }
|
||||||
Parameter { name: "y"; type: "double" }
|
Parameter { name: "y"; type: "double" }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user