From db89cb680f6e152d0ca4c8d95f07246b63c08cff Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Sun, 16 May 2021 17:18:08 +0200 Subject: [PATCH] Cross platform image copy system, icons for tabs. + Fixing issue with unreadable text color in the about dialog. --- qml/About.qml | 10 +++++----- qml/LogGraph.qml | 9 +++++++++ qml/ObjectLists.qml | 2 +- run.py | 8 ++++---- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/qml/About.qml b/qml/About.qml index d9c59f4..62202fb 100644 --- a/qml/About.qml +++ b/qml/About.qml @@ -40,7 +40,7 @@ D.Dialog { anchors.topMargin: 10 } - Text { + Label { id: appName anchors.top: logo.bottom anchors.left: parent.left @@ -52,7 +52,7 @@ D.Dialog { text: "Logarithmic Plotter v" + Helper.getVersion() } - Text { + Label { id: description anchors.top: appName.bottom anchors.left: parent.left @@ -64,7 +64,7 @@ D.Dialog { text: "Create graphs with logarithm scales." } - Text { + Label { id: debugInfos anchors.top: description.bottom anchors.left: parent.left @@ -76,7 +76,7 @@ D.Dialog { text: Helper.getDebugInfos() } - Text { + Label { id: copyrightInfos anchors.top: debugInfos.bottom anchors.horizontalCenter: parent.horizontalCenter @@ -85,7 +85,7 @@ D.Dialog { wrapMode: Text.WordWrap textFormat: Text.RichText font.pixelSize: 13 - text: "Copyright (C) 2021 Ad5001 <mail@ad5001.eu>
+ text: "Copyright © 2021 Ad5001 <mail@ad5001.eu>

This program 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.

diff --git a/qml/LogGraph.qml b/qml/LogGraph.qml index 6c0287a..5ac8c9a 100644 --- a/qml/LogGraph.qml +++ b/qml/LogGraph.qml @@ -57,12 +57,21 @@ ApplicationWindow { anchors.top: parent.top TabButton { text: qsTr("Objects") + icon.name: 'polygon-add-nodes' + icon.color: sysPalette.windowText + //height: 24 } TabButton { text: qsTr("Settings") + icon.name: 'preferences-system' + icon.color: sysPalette.windowText + //height: 24 } TabButton { text: qsTr("History") + icon.name: 'history' + icon.color: sysPalette.windowText + //height: 24 } } diff --git a/qml/ObjectLists.qml b/qml/ObjectLists.qml index 94d737d..d4a5e57 100644 --- a/qml/ObjectLists.qml +++ b/qml/ObjectLists.qml @@ -438,7 +438,7 @@ ListView { icon.name: modelData icon.width: 24 icon.height: 24 - icon.color: sysPalette.windowText + icon.color: 'white'//sysPalette.windowText onClicked: { var newObj = Objects.createNewRegisteredObject(modelData) diff --git a/run.py b/run.py index b5f832b..aff5bad 100644 --- a/run.py +++ b/run.py @@ -19,7 +19,7 @@ from PySide2.QtWidgets import QApplication, QFileDialog from PySide2.QtQml import QQmlApplicationEngine, qmlRegisterType from PySide2.QtCore import Qt, QObject, Signal, Slot, Property -from PySide2.QtGui import QIcon +from PySide2.QtGui import QIcon, QImage from PySide2 import __version__ as PySide2_version import os @@ -39,7 +39,7 @@ tempfile = tempfile.mkstemp(suffix='.png')[1] def get_linux_theme(): des = { - "KDE": "fusion", # org.kde.desktop resolves to universal in PySide2. + "KDE": "Flat", "gnome": "default", "lxqt": "fusion", "mate": "fusion", @@ -82,8 +82,8 @@ class Helper(QObject): @Slot() def copyImageToClipboard(self): global tempfile - # TODO: Better copy system - os.system("xclip -selection clipboard -t image/png -i " + tempfile) + clipboard = QApplication.clipboard() + clipboard.setImage(QImage(tempfile)) @Slot(result=str) def getVersion(self):