Cross platform image copy system, icons for tabs.

+ Fixing issue with unreadable text color in the about dialog.
This commit is contained in:
Ad5001 2021-05-16 17:18:08 +02:00
parent 9b03090d14
commit db89cb680f
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
4 changed files with 19 additions and 10 deletions

View file

@ -40,7 +40,7 @@ D.Dialog {
anchors.topMargin: 10 anchors.topMargin: 10
} }
Text { Label {
id: appName id: appName
anchors.top: logo.bottom anchors.top: logo.bottom
anchors.left: parent.left anchors.left: parent.left
@ -52,7 +52,7 @@ D.Dialog {
text: "Logarithmic Plotter v" + Helper.getVersion() text: "Logarithmic Plotter v" + Helper.getVersion()
} }
Text { Label {
id: description id: description
anchors.top: appName.bottom anchors.top: appName.bottom
anchors.left: parent.left anchors.left: parent.left
@ -64,7 +64,7 @@ D.Dialog {
text: "Create graphs with logarithm scales." text: "Create graphs with logarithm scales."
} }
Text { Label {
id: debugInfos id: debugInfos
anchors.top: description.bottom anchors.top: description.bottom
anchors.left: parent.left anchors.left: parent.left
@ -76,7 +76,7 @@ D.Dialog {
text: Helper.getDebugInfos() text: Helper.getDebugInfos()
} }
Text { Label {
id: copyrightInfos id: copyrightInfos
anchors.top: debugInfos.bottom anchors.top: debugInfos.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -85,7 +85,7 @@ D.Dialog {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
textFormat: Text.RichText textFormat: Text.RichText
font.pixelSize: 13 font.pixelSize: 13
text: "Copyright (C) 2021 Ad5001 &lt;mail@ad5001.eu&gt;<br> text: "Copyright © 2021 Ad5001 &lt;mail@ad5001.eu&gt;<br>
<br> <br>
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.<br> 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.<br>
<br> <br>

View file

@ -57,12 +57,21 @@ ApplicationWindow {
anchors.top: parent.top anchors.top: parent.top
TabButton { TabButton {
text: qsTr("Objects") text: qsTr("Objects")
icon.name: 'polygon-add-nodes'
icon.color: sysPalette.windowText
//height: 24
} }
TabButton { TabButton {
text: qsTr("Settings") text: qsTr("Settings")
icon.name: 'preferences-system'
icon.color: sysPalette.windowText
//height: 24
} }
TabButton { TabButton {
text: qsTr("History") text: qsTr("History")
icon.name: 'history'
icon.color: sysPalette.windowText
//height: 24
} }
} }

View file

@ -438,7 +438,7 @@ ListView {
icon.name: modelData icon.name: modelData
icon.width: 24 icon.width: 24
icon.height: 24 icon.height: 24
icon.color: sysPalette.windowText icon.color: 'white'//sysPalette.windowText
onClicked: { onClicked: {
var newObj = Objects.createNewRegisteredObject(modelData) var newObj = Objects.createNewRegisteredObject(modelData)

8
run.py
View file

@ -19,7 +19,7 @@
from PySide2.QtWidgets import QApplication, QFileDialog from PySide2.QtWidgets import QApplication, QFileDialog
from PySide2.QtQml import QQmlApplicationEngine, qmlRegisterType from PySide2.QtQml import QQmlApplicationEngine, qmlRegisterType
from PySide2.QtCore import Qt, QObject, Signal, Slot, Property 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 from PySide2 import __version__ as PySide2_version
import os import os
@ -39,7 +39,7 @@ tempfile = tempfile.mkstemp(suffix='.png')[1]
def get_linux_theme(): def get_linux_theme():
des = { des = {
"KDE": "fusion", # org.kde.desktop resolves to universal in PySide2. "KDE": "Flat",
"gnome": "default", "gnome": "default",
"lxqt": "fusion", "lxqt": "fusion",
"mate": "fusion", "mate": "fusion",
@ -82,8 +82,8 @@ class Helper(QObject):
@Slot() @Slot()
def copyImageToClipboard(self): def copyImageToClipboard(self):
global tempfile global tempfile
# TODO: Better copy system clipboard = QApplication.clipboard()
os.system("xclip -selection clipboard -t image/png -i " + tempfile) clipboard.setImage(QImage(tempfile))
@Slot(result=str) @Slot(result=str)
def getVersion(self): def getVersion(self):