More UI work

main
Peter Repukat 3 years ago
parent cc266d921d
commit f1baf98078

@ -6,5 +6,8 @@
<file>qml/ShortcutCards.qml</file>
<file>qml/ShortcutProps.qml</file>
<file>qml/FluentTextInput.qml</file>
<file>svg/delete_white_24dp.svg</file>
<file>svg/edit_white_24dp.svg</file>
<file>svg/steam.svg</file>
</qresource>
</RCC>

@ -77,23 +77,25 @@ Dialog {
highlighted: true
onClicked: function(){
close()
confirmed("uwp")
confirmed("man")
}
}
Button {
text: qsTr("Win32 Program")
text: uiModel.isWindows ? qsTr("Win32 Program") : qsTr("Launch Program")
highlighted: true
onClicked: function(){
close()
confirmed("uwp")
confirmed("launch")
}
}
Button {
visible: uiModel.isWindows
text: qsTr("UWP App")
highlighted: true
onClicked: function(){
close()
confirmed("uwp")
const wtf = uiModel.uwpList;
}
}
}

@ -17,6 +17,7 @@ import QtQuick 6.2
import QtQuick.Layouts 6.2
import QtQuick.Controls 6.2
import QtQuick.Controls.Material 6.2
import Qt5Compat.GraphicalEffects
GridView {
id: shortcutgrid
@ -27,42 +28,142 @@ GridView {
visible: model.length > 0
signal editClicked(var index, var shortcutInfo)
property real margins: 16
cellWidth: 242 + 8
cellHeight: 149 + 8
cellWidth: 292 + 16
cellHeight: 190 + 16
readonly property real displayedItems: Math.floor((parent.width - margins*2) / cellWidth)
width: displayedItems * cellWidth
model: uiModel.targetList;
GridView.delayRemove: true
// TODO: animations only properly work with abstractListModel... grrr...
addDisplaced: Transition {
NumberAnimation { properties: "x,y"; duration: 300 }
}
add: Transition {
ParallelAnimation {
NumberAnimation { property: "opacity"; from: 0; duration: 300; easing.type: Easing.OutQuad }
NumberAnimation { properties: "x,y"; from: height; duration: 300; easing.type: Easing.OutQuad }
}
}
populate: Transition {
ParallelAnimation {
NumberAnimation { property: "opacity"; from: 0; duration: 300; easing.type: Easing.OutQuad }
NumberAnimation { properties: "x,y"; duration: 300; easing.type: Easing.OutQuad }
}
}
remove: Transition {
NumberAnimation { property: "opacity"; to: 0; duration: 300; easing.type: Easing.InQuad }
}
removeDisplaced: Transition {
NumberAnimation { properties: "x,y"; duration: 300; easing.type: Easing.InQuad }
}
delegate: RPane {
color: Qt.lighter(Material.background, 1.6)
bgOpacity: 0.3
radius: 8
width: 242
height: 149
width: 292
height: 190
Material.elevation: 4
clip: true
Label {
id: label
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
text: modelData.name
font.bold: true
font.pixelSize: 16
}
Column {
anchors.top: label.bottom
anchors.left: parent.left
anchors.bottom: row.top
anchors.margins: 12
spacing: 4
Row {
spacing: 8
visible: modelData.launchPath && modelData.launchPath.length > 0
Label {
text: uiModel.isWindows && modelData.launchPath
? modelData.launchPath.replace(/^.{1,3}:/, "").length < modelData.launchPath.length
? "Win32"
: "UWP"
: qsTr("Launch")
font.bold: true
}
Label {
property string te: modelData.launchPath
? modelData.launchPath.replace(/.*(\\|\/)/gm, "")
: ""
text: uiModel.isWindows ? te : te.replace(/\..{3}$/, "")
}
}
}
Button {
anchors.left: parent.left
anchors.bottom: parent.bottom
width: 72
onClicked: console.log("TODO") // TODO
Row {
anchors.centerIn: parent
spacing: 8
Label {
anchors.verticalCenter: parent.verticalCenter
text: "+"
font.bold: true
font.pixelSize: 24
}
Image {
anchors.verticalCenter: parent.verticalCenter
source: "qrc:/svg/steam.svg"
width: 22
height: 22
smooth: true
mipmap: true
ColorOverlay {
anchors.fill: parent
source: parent
color: "white"
}
}
}
}
Row {
id: row
anchors.right: parent.right
anchors.bottom: parent.bottom
spacing: 4
Button {
text: qsTr("Add to Steam") // TODO
onClicked: console.log("TODO") // TODO
RoundButton {
onClicked: uiModel.deleteTarget(index)
highlighted: true
Material.accent: Material.color(Material.Red, Material.Shade900)
Image {
anchors.centerIn: parent
source: "qrc:/svg/delete_white_24dp.svg"
width: 16
height: 16
}
}
Button {
text: qsTr("Edit")
RoundButton {
onClicked: editClicked(index, modelData)
highlighted: true
Image {
anchors.centerIn: parent
source: "qrc:/svg/edit_white_24dp.svg"
width: 16
height: 16
}
}
}

@ -24,6 +24,7 @@ Item {
id: propsContent
anchors.fill: parent
property alias fileDialog: fileDialog
signal cancel()
signal done(var shortcut)
@ -92,6 +93,7 @@ Item {
placeholderText: qsTr("...")
text: shortcutInfo.name
onTextChanged: shortcutInfo.name = text
validator: RegularExpressionValidator { regularExpression: /([0-z]|\s|.)+/gm }
}
}
Item {
@ -251,6 +253,7 @@ Item {
Button {
text: qsTr("Done")
highlighted: true
enabled: nameInput.acceptableInput
onClicked: function() {
done(shortcutInfo)
}

@ -29,7 +29,7 @@ Window {
title: qsTr("GlosSI - Config")
color: uiModel.hasAcrlyicEffect ? colorAlpha(Qt.darker(Material.background, 2), 0.7) : colorAlpha(Qt.darker(Material.background, 1.5), 0.98)
color: uiModel.hasAcrlyicEffect ? colorAlpha(Qt.darker(Material.background, 2), 0.65) : colorAlpha(Qt.darker(Material.background, 1.5), 0.98)
function toggleMaximized() {
if (window.visibility === Window.Maximized || window.visibility === Window.FullScreen) {
@ -219,9 +219,14 @@ Window {
onConfirmed: function(param) {
shortcutProps.opacity = 1;
homeContent.opacity = 0;
// TODO Which dialog
props.resetInfo()
windowContent.editedIndex = -1
if (param == "launch") {
props.fileDialog.open();
}
if (param == "uwp") {
// props.fileDIalog.open();
}
}
}

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>

After

Width:  |  Height:  |  Size: 234 B

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>

After

Width:  |  Height:  |  Size: 306 B

@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="steam" class="svg-inline--fa fa-steam fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M496 256c0 137-111.2 248-248.4 248-113.8 0-209.6-76.3-239-180.4l95.2 39.3c6.4 32.1 34.9 56.4 68.9 56.4 39.2 0 71.9-32.4 70.2-73.5l84.5-60.2c52.1 1.3 95.8-40.9 95.8-93.5 0-51.6-42-93.5-93.7-93.5s-93.7 42-93.7 93.5v1.2L176.6 279c-15.5-.9-30.7 3.4-43.5 12.1L0 236.1C10.2 108.4 117.1 8 247.6 8 384.8 8 496 119 496 256zM155.7 384.3l-30.5-12.6a52.79 52.79 0 0 0 27.2 25.8c26.9 11.2 57.8-1.6 69-28.4 5.4-13 5.5-27.3.1-40.3-5.4-13-15.5-23.2-28.5-28.6-12.9-5.4-26.7-5.2-38.9-.6l31.5 13c19.8 8.2 29.2 30.9 20.9 50.7-8.3 19.9-31 29.2-50.8 21zm173.8-129.9c-34.4 0-62.4-28-62.4-62.3s28-62.3 62.4-62.3 62.4 28 62.4 62.3-27.9 62.3-62.4 62.3zm.1-15.6c25.9 0 46.9-21 46.9-46.8 0-25.9-21-46.8-46.9-46.8s-46.9 21-46.9 46.8c.1 25.8 21.1 46.8 46.9 46.8z"></path></svg>

After

Width:  |  Height:  |  Size: 962 B

Loading…
Cancel
Save