GlosSIConfig: QML: change shortcut Icon

pull/192/head
Peter Repukat 2 years ago
parent b568418891
commit 01efd8d02d

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,1,0,2033009290000
PRODUCTVERSION 0,1,0,2033009290000
FILEVERSION 0,1,0,2034000568418
PRODUCTVERSION 0,1,0,2034000568418
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Peter Repukat - FlatspotSoftware"
VALUE "FileDescription", "GlosSI - Config"
VALUE "FileVersion", "0.1.0.2-33-g929abfe"
VALUE "FileVersion", "0.1.0.2-34-gb568418"
VALUE "InternalName", "GlosSIConfig"
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
VALUE "OriginalFilename", "GlosSIConfig.exe"
VALUE "ProductName", "GlosSI"
VALUE "ProductVersion", "0.1.0.2-33-g929abfe"
VALUE "ProductVersion", "0.1.0.2-34-gb568418"
END
END
BLOCK "VarFileInfo"

@ -23,5 +23,6 @@
<file>qml/GlobalConf.qml</file>
<file>svg/settings_fill_white_24dp.svg</file>
<file>qml/EGSSelectDialog.qml</file>
<file>svg/add_photo_alternate_white_24dp.svg</file>
</qresource>
</RCC>

@ -215,10 +215,9 @@ GridView {
? modelData.icon.endsWith(".exe")
? "image://exe/" + modelData.icon
: "file:///" + modelData.icon
: null
: 'qrc:/svg/add_photo_alternate_white_24dp.svg'
width: 48
height: 48
visible: !!modelData.icon
}
Label {

@ -53,6 +53,14 @@ Item {
if (advancedTargetSettings) { // advanced settings (collapsible container)
advancedTargetSettings.shortcutInfo = shortcutInfo;
}
if (maybeIcon) {
console.log("meh");
maybeIcon.source = shortcutInfo.icon
? shortcutInfo.icon.endsWith(".exe")
? "image://exe/" + shortcutInfo.icon
: "file:///" + shortcutInfo.icon
: 'qrc:/svg/add_photo_alternate_white_24dp.svg';
}
}
Flickable {
@ -153,24 +161,27 @@ Item {
spacing: 4
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 32
anchors.rightMargin: 32
Image {
id: maybeIcon
source: shortcutInfo.icon
? shortcutInfo.icon.endsWith(".exe")
? "image://exe/" + shortcutInfo.icon
: "file:///" + shortcutInfo.icon
: ''
Layout.preferredWidth: 48
Layout.preferredHeight: 48
visible: shortcutInfo.icon
anchors.leftMargin: 8
anchors.rightMargin: 16
Button {
id: iconButton
Layout.preferredWidth: 56
Layout.preferredHeight: 64
Layout.alignment: Qt.AlignVCenter
flat: true
contentItem: Image {
id: maybeIcon
source: shortcutInfo.icon
? shortcutInfo.icon.endsWith(".exe")
? "image://exe/" + shortcutInfo.icon
: "file:///" + shortcutInfo.icon
: 'qrc:/svg/add_photo_alternate_white_24dp.svg'
}
onClicked: iconFileDialog.open()
}
Item {
Layout.preferredWidth: 8
Layout.preferredHeight: 8
visible: shortcutInfo.icon
}
Item {
Layout.preferredWidth: parent.width / 2
@ -296,6 +307,21 @@ Item {
}
}
FileDialog {
id: iconFileDialog
title: qsTr("Please choose an icon")
nameFilters: uiModel.isWindows ? ["Image/Executable (*.exe *.png *.ico *.jpg)"] : ["Image (*.png *.ico *.jpg)"]
onAccepted: {
if (iconFileDialog.selectedFile != null) {
shortcutInfo.icon = iconFileDialog.selectedFile.toString().replace("file:///", "")
shortcutInfo = shortcutInfo;
}
}
onRejected: {
}
}
UWPSelectDialog {
id: uwpSelectDialog

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="48" width="48" fill="#FFFFFF"><path d="M29.45 6v3H9v30h30V18.6h3V39q0 1.2-.9 2.1-.9.9-2.1.9H9q-1.2 0-2.1-.9Q6 40.2 6 39V9q0-1.2.9-2.1Q7.8 6 9 6ZM38 6v4.05h4.05v3H38v4.05h-3v-4.05h-4.05v-3H35V6ZM12 33.9h24l-7.2-9.6-6.35 8.35-4.7-6.2ZM9 9v30V9Z"/></svg>

After

Width:  |  Height:  |  Size: 299 B

Loading…
Cancel
Save