mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-19 00:15:21 +01:00
more updates
This commit is contained in:
parent
73962713b0
commit
a686115ca8
3 changed files with 91 additions and 46 deletions
|
@ -18,6 +18,18 @@ Popup {
|
||||||
padding: 0
|
padding: 0
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
|
||||||
|
// Define the colors
|
||||||
|
property color beigeColor: "#c4bebb"
|
||||||
|
property color maroonColor: "#800000"
|
||||||
|
property color yellowColor: "#fcad01"
|
||||||
|
|
||||||
|
// Placeholder for detecting the selected CFW
|
||||||
|
property string selectedCFW: "" // This should be set dynamically
|
||||||
|
|
||||||
|
// Set the color scheme based on the selected CFW
|
||||||
|
property color backgroundColor: selectedCFW.toLowerCase().indexOf("muos") !== -1 ? yellowColor : beigeColor
|
||||||
|
property color accentColor: selectedCFW.toLowerCase().indexOf("muos") !== -1 ? yellowColor : maroonColor
|
||||||
|
|
||||||
property alias title: msgpopupheader.text
|
property alias title: msgpopupheader.text
|
||||||
property alias text: msgpopupbody.text
|
property alias text: msgpopupbody.text
|
||||||
property bool continueButton: true
|
property bool continueButton: true
|
||||||
|
@ -29,7 +41,7 @@ Popup {
|
||||||
|
|
||||||
// background of title
|
// background of title
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "#f5f5f5"
|
color: accentColor
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
height: 35
|
height: 35
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
117
src/main.qml
117
src/main.qml
|
@ -20,20 +20,12 @@ ApplicationWindow {
|
||||||
property string selectedCFW: "" // This should be set dynamically
|
property string selectedCFW: "" // This should be set dynamically
|
||||||
|
|
||||||
// Set the color scheme based on the selected CFW
|
// Set the color scheme based on the selected CFW
|
||||||
property color backgroundColor: selectedCFW.toLowerCase().indexOf("muos") !== -1 ? yellowColor : beigeColor
|
property color backgroundColor: beigeColor
|
||||||
property color accentColor: selectedCFW.toLowerCase().indexOf("muos") !== -1 ? yellowColor : maroonColor
|
property color accentColor: maroonColor
|
||||||
|
|
||||||
id: window
|
id: window
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
// Define your colors
|
|
||||||
|
|
||||||
// Placeholder for detecting the selected CFW
|
|
||||||
|
|
||||||
// Set the color scheme based on the selected CFW
|
|
||||||
|
|
||||||
// Apply these colors to your existing UI components below
|
|
||||||
|
|
||||||
width: imageWriter.isEmbeddedMode() ? -1 : 680
|
width: imageWriter.isEmbeddedMode() ? -1 : 680
|
||||||
height: imageWriter.isEmbeddedMode() ? -1 : 450
|
height: imageWriter.isEmbeddedMode() ? -1 : 450
|
||||||
minimumWidth: imageWriter.isEmbeddedMode() ? -1 : 680
|
minimumWidth: imageWriter.isEmbeddedMode() ? -1 : 680
|
||||||
|
@ -75,6 +67,7 @@ ApplicationWindow {
|
||||||
id: bg
|
id: bg
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: logoContainer
|
id: logoContainer
|
||||||
color: accentColor
|
color: accentColor
|
||||||
|
@ -83,30 +76,21 @@ ApplicationWindow {
|
||||||
Image {
|
Image {
|
||||||
id: image
|
id: image
|
||||||
source: "icons/logo_sxs_imager.png"
|
source: "icons/logo_sxs_imager.png"
|
||||||
|
|
||||||
// Specify the maximum size of the image
|
|
||||||
width: window.width * 0.45
|
width: window.width * 0.45
|
||||||
height: window.height / 3
|
height: window.height / 3
|
||||||
|
|
||||||
// Within the image's specified size rectangle, resize the
|
|
||||||
// image to fit within the rectangle while keeping its aspect
|
|
||||||
// ratio the same. Preserving the aspect ratio implies some
|
|
||||||
// extra padding between the Image's extend and the actual
|
|
||||||
// image content: align left so all this padding is on the
|
|
||||||
// right.
|
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
horizontalAlignment: Image.AlignLeft
|
horizontalAlignment: Image.AlignLeft
|
||||||
|
smooth: true
|
||||||
|
antialiasing: true
|
||||||
|
|
||||||
// Keep the left side of the image 40 pixels from the left
|
anchors {
|
||||||
// edge
|
left: logoContainer.left
|
||||||
anchors.left: logoContainer.left
|
leftMargin: 40
|
||||||
anchors.leftMargin: 40
|
top: logoContainer.top
|
||||||
|
bottom: logoContainer.bottom
|
||||||
// Equal padding above and below the image
|
topMargin: window.height / 25
|
||||||
anchors.top: logoContainer.top
|
bottomMargin: window.height / 25
|
||||||
anchors.bottom: logoContainer.bottom
|
}
|
||||||
anchors.topMargin: window.height / 25
|
|
||||||
anchors.bottomMargin: window.height / 25
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,12 +203,37 @@ ApplicationWindow {
|
||||||
topPadding: 0
|
topPadding: 0
|
||||||
Layout.minimumHeight: 40
|
Layout.minimumHeight: 40
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
|
||||||
|
Accessible.description: qsTr("Select this button to change the custom firmware")
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: osbuttonMouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
onEntered: {
|
||||||
|
bgrect1.mouseOver = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onExited: {
|
||||||
|
bgrect1.mouseOver = false
|
||||||
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ospopup.open()
|
ospopup.open()
|
||||||
osswipeview.currentItem.forceActiveFocus()
|
osswipeview.currentItem.forceActiveFocus()
|
||||||
}
|
}
|
||||||
Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
|
}
|
||||||
Accessible.description: qsTr("Select this button to change the custom firmware")
|
|
||||||
|
Rectangle {
|
||||||
|
id: bgrect1
|
||||||
|
anchors.fill: parent
|
||||||
|
color: accentColor
|
||||||
|
visible: mouseOver
|
||||||
|
property bool mouseOver: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,13 +266,39 @@ ApplicationWindow {
|
||||||
Layout.minimumHeight: 40
|
Layout.minimumHeight: 40
|
||||||
Layout.preferredWidth: 200
|
Layout.preferredWidth: 200
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
|
||||||
|
Accessible.description: qsTr("Select this button to change the destination storage device")
|
||||||
|
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: dstbuttonMouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
onEntered: {
|
||||||
|
bgrect2.mouseOver = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onExited: {
|
||||||
|
bgrect2.mouseOver = false
|
||||||
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
imageWriter.startDriveListPolling()
|
imageWriter.startDriveListPolling()
|
||||||
dstpopup.open()
|
dstpopup.open()
|
||||||
dstlist.forceActiveFocus()
|
dstlist.forceActiveFocus()
|
||||||
}
|
}
|
||||||
Accessible.ignored: ospopup.visible || dstpopup.visible || hwpopup.visible
|
}
|
||||||
Accessible.description: qsTr("Select this button to change the destination storage device")
|
|
||||||
|
Rectangle {
|
||||||
|
id: bgrect2
|
||||||
|
anchors.fill: parent
|
||||||
|
color: accentColor
|
||||||
|
visible: mouseOver
|
||||||
|
property bool mouseOver: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,17 +852,9 @@ ApplicationWindow {
|
||||||
Text {
|
Text {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
font.family: roboto.name
|
font.family: roboto.name
|
||||||
text: description
|
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
color: accentColor
|
color: accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolTip {
|
|
||||||
visible: hwMouseArea.containsMouse && typeof(tooltip) == "string" && tooltip != ""
|
|
||||||
delay: 1000
|
|
||||||
text: tooltip ? tooltip : ""
|
|
||||||
clip: false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -838,7 +865,7 @@ text: tooltip ? tooltip : ""
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: window.width-100
|
width: window.width-100
|
||||||
height: contentLayout.implicitHeight + 24
|
height: Math.max(contentLayout.implicitHeight + 24, 50)
|
||||||
Accessible.name: name+".\n"+description
|
Accessible.name: name+".\n"+description
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
@ -849,10 +876,14 @@ text: tooltip ? tooltip : ""
|
||||||
|
|
||||||
onEntered: {
|
onEntered: {
|
||||||
bgrect.mouseOver = true
|
bgrect.mouseOver = true
|
||||||
|
mouseText.color = backgroundColor
|
||||||
|
mouseText2.color = backgroundColor
|
||||||
}
|
}
|
||||||
|
|
||||||
onExited: {
|
onExited: {
|
||||||
bgrect.mouseOver = false
|
bgrect.mouseOver = false
|
||||||
|
mouseText.color = accentColor
|
||||||
|
mouseText2.color = accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -931,6 +962,7 @@ text: tooltip ? tooltip : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
id:mouseText
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
color: accentColor
|
color: accentColor
|
||||||
|
@ -939,6 +971,7 @@ text: tooltip ? tooltip : ""
|
||||||
text: qsTr("Released: %1").arg(release_date)
|
text: qsTr("Released: %1").arg(release_date)
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
|
id:mouseText2
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
color: accentColor
|
color: accentColor
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue