mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Change advanced settings button
- Change image to button - Add option to randomize OS list entries
This commit is contained in:
parent
ef7106932e
commit
ba5a27d154
4 changed files with 55 additions and 11 deletions
|
@ -1 +0,0 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><style>.cls-1{fill:#f2c5c5;}.cls-2{fill:none;stroke:#f2c5c5;stroke-miterlimit:10;stroke-width:3px;}</style></defs><path class="cls-1" d="M20,16a4,4,0,1,1-4,4,4.00455,4.00455,0,0,1,4-4m0-2a6,6,0,1,0,6,6,6,6,0,0,0-6-6Z"/><path class="cls-2" d="M18.41429,7.42824,15.25814,3.11A17.506,17.506,0,0,0,7.742,7.45608l2.17348,4.88276a12.31422,12.31422,0,0,0-1.59722,2.75283l-5.29836.57179a17.50582,17.50582,0,0,0,.00577,8.68221l5.31534.5591a12.34163,12.34163,0,0,0,1.58374,2.75854L7.76287,32.55559a17.50588,17.50588,0,0,0,7.52189,4.33611L18.42662,32.568a12.34585,12.34585,0,0,0,3.18078.00781l3.15589,4.31881a17.506,17.506,0,0,0,7.51614-4.3461L30.106,27.66578a12.34511,12.34511,0,0,0,1.59709-2.7506l5.31778-.57412a17.50593,17.50593,0,0,0-.00576-8.68221l-5.31534-.5591a12.32179,12.32179,0,0,0-1.59627-2.77415l2.15518-4.87708a17.50589,17.50589,0,0,0-7.5219-4.33612L21.59487,7.43607A12.36027,12.36027,0,0,0,18.41429,7.42824Z"/></svg>
|
Before Width: | Height: | Size: 1,018 B |
13
icons/ic_cog_red.svg
Normal file
13
icons/ic_cog_red.svg
Normal file
|
@ -0,0 +1,13 @@
|
|||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
fill: #d4345c;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g>
|
||||
<circle class="cls-1" cx="19.98571" cy="19.99838" r="3.54172"/>
|
||||
<path class="cls-1" d="M22.82883,33.28812l-2.30957-3.16065a10.06051,10.06051,0,0,1-1.04395-.00195l-2.29785,3.16113-.83691-.23437a13.55788,13.55788,0,0,1-5.81348-3.35206L9.907,29.09427l1.582-3.58008a10.05149,10.05149,0,0,1-.5205-.90576l-3.88575-.40918-.21582-.84278a13.56663,13.56663,0,0,1-.0039-6.71093l.21582-.83936,3.877-.418a9.698,9.698,0,0,1,.52441-.90576L9.89035,10.91214l.62207-.60791A13.564,13.564,0,0,1,16.322,6.94583l.835-.23389.51074.69971c0,.00049,1.15918,1.58594,1.79883,2.46094a9.30717,9.30717,0,0,1,1.044.00146l2.29785-3.16113.83691.23438a13.56687,13.56687,0,0,1,5.81446,3.35205l.62011.606-1.57714,3.56836a9.75012,9.75012,0,0,1,.52832.918l3.88671.40869.21582.84278a13.578,13.578,0,0,1,.00391,6.71093l-.21484.83985-.86231.09277s-1.95117.21045-3.02929.32715a9.88078,9.88078,0,0,1-.52442.90332l1.58985,3.5708-.62207.60791a13.5765,13.5765,0,0,1-5.81055,3.3584Zm-1.1416-5.79981,2.11621,2.896a11.07679,11.07679,0,0,0,3.28711-1.90137l-1.459-3.27881.45313-.59033a7.3582,7.3582,0,0,0,.875-1.459c.09179-.84179.68164-.90576,2.96777-1.15234l.9668-.10449a11.06623,11.06623,0,0,0-.00293-3.79688L27.321,17.72562l-.28417-.689a7.3525,7.3525,0,0,0-.957-1.66455l-.44726-.5874,1.44531-3.271a11.08228,11.08228,0,0,0-3.29-1.896l-2.11035,2.9038-.73828-.09814A7.45705,7.45705,0,0,0,19.03,12.419l-.15625.00977c-.58887,0-.63184,0-2.69141-2.813a11.08259,11.08259,0,0,0-3.28613,1.90088l1.459,3.27881-.45312.58984a7.39276,7.39276,0,0,0-.958,1.65284l-.28515.68066-3.55372.3833a11.06321,11.06321,0,0,0,.00391,3.79639l3.56836.376.28418.688a7.43476,7.43476,0,0,0,.95117,1.65625l.44629.58692-1.45019,3.28076A11.08667,11.08667,0,0,0,16.198,30.38187l2.11035-2.90381.73828.09814a7.46494,7.46494,0,0,0,1.91016.0044Z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
51
main.qml
51
main.qml
|
@ -255,16 +255,22 @@ ApplicationWindow {
|
|||
font.family: roboto.name
|
||||
Accessible.onPressAction: clicked()
|
||||
}
|
||||
Image {
|
||||
id: customizebutton
|
||||
source: "icons/ic_cog_40px.svg"
|
||||
visible: false
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
optionspopup.openPopup()
|
||||
}
|
||||
Button {
|
||||
Layout.bottomMargin: 25
|
||||
padding: 5
|
||||
id: customizebutton
|
||||
onClicked: {
|
||||
optionspopup.openPopup()
|
||||
}
|
||||
Material.background: "#ffffff"
|
||||
visible: false
|
||||
Accessible.description: qsTr("Select this button to access advanced settings")
|
||||
Accessible.onPressAction: clicked()
|
||||
|
||||
contentItem: Image {
|
||||
source: "icons/ic_cog_red.svg"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1051,6 +1057,29 @@ ApplicationWindow {
|
|||
progressText.text = qsTr("Finalizing...")
|
||||
}
|
||||
|
||||
function shuffle(arr) {
|
||||
for (var i = 0; i < arr.length - 1; i++) {
|
||||
var j = i + Math.floor(Math.random() * (arr.length - i));
|
||||
|
||||
var t = arr[j];
|
||||
arr[j] = arr[i];
|
||||
arr[i] = t;
|
||||
}
|
||||
}
|
||||
|
||||
function checkForRandom(list) {
|
||||
for (var i in list) {
|
||||
var entry = list[i]
|
||||
|
||||
if ("subitems" in entry) {
|
||||
checkForRandom(entry["subitems"])
|
||||
if ("random" in entry && entry["random"]) {
|
||||
shuffle(entry["subitems"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function oslistFromJson(o) {
|
||||
var lang_country = Qt.locale().name
|
||||
if ("os_list_"+lang_country in o) {
|
||||
|
@ -1068,7 +1097,9 @@ ApplicationWindow {
|
|||
return false
|
||||
}
|
||||
|
||||
return o["os_list"]
|
||||
var oslist = o["os_list"]
|
||||
checkForRandom(oslist)
|
||||
return oslist
|
||||
}
|
||||
|
||||
function selectNamedOS(name, collection)
|
||||
|
|
1
qml.qrc
1
qml.qrc
|
@ -30,5 +30,6 @@
|
|||
<file>icons/ic_info_12px.png</file>
|
||||
<file>icons/ic_cog_40px.svg</file>
|
||||
<file>keymap-layouts.txt</file>
|
||||
<file>icons/ic_cog_red.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue