refractor: DeltaruneQuickshell -> Shell
75
Shell/Topbar/Topbar.qml
Normal file
@@ -0,0 +1,75 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
|
||||
import "topbar"
|
||||
|
||||
Item {
|
||||
id: topbar
|
||||
implicitWidth: 1312
|
||||
implicitHeight: 182
|
||||
anchors.centerIn: parent
|
||||
|
||||
property var iconSources: ["item.png", "equip.png", "power.png", "config.png"]
|
||||
property int iconCount: iconSources.length
|
||||
property int selectedIndex: 0
|
||||
|
||||
function moveSelection(delta) {
|
||||
if (iconCount <= 0)
|
||||
return;
|
||||
selectedIndex = (selectedIndex + delta + iconCount) % iconCount;
|
||||
}
|
||||
|
||||
onIconCountChanged: {
|
||||
if (iconCount <= 0) {
|
||||
selectedIndex = 0;
|
||||
} else if (selectedIndex >= iconCount) {
|
||||
selectedIndex = iconCount - 1;
|
||||
}
|
||||
}
|
||||
|
||||
DarkDollarsDisplay {}
|
||||
|
||||
Image {
|
||||
source: "./topbar/setting_names/" + topbar.iconSources[topbar.selectedIndex]
|
||||
}
|
||||
|
||||
FocusScope {
|
||||
id: focusScope
|
||||
focus: true
|
||||
anchors.fill: parent
|
||||
Keys.onLeftPressed: topbar.moveSelection(-1)
|
||||
Keys.onRightPressed: topbar.moveSelection(1)
|
||||
Component.onCompleted: forceActiveFocus()
|
||||
|
||||
Row {
|
||||
id: iconRow
|
||||
spacing: 76
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 45
|
||||
|
||||
Repeater {
|
||||
model: topbar.iconSources
|
||||
|
||||
delegate: Item {
|
||||
id: repeatitem
|
||||
required property int index
|
||||
width: 149
|
||||
height: 108
|
||||
|
||||
TopbarSettingIcon {
|
||||
anchors.centerIn: parent
|
||||
selected: topbar.selectedIndex == repeatitem.index
|
||||
iconSource: topbar.iconSources[repeatitem.index]
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
topbar.selectedIndex = repeatitem.index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Shell/Topbar/topbar/DarkDollarsDisplay.qml
Normal file
@@ -0,0 +1,28 @@
|
||||
import QtQuick
|
||||
|
||||
// import Quickshell
|
||||
|
||||
Item {
|
||||
Text {
|
||||
x: 1064 + 117
|
||||
y: 37 + 9
|
||||
color: "#ffffff"
|
||||
text: "D$ 4294"
|
||||
font.pixelSize: 64
|
||||
font.family: "8bitoperator JVE"
|
||||
}
|
||||
|
||||
// SystemClock {
|
||||
// id: clock
|
||||
// precision: SystemClock.Minutes
|
||||
// }
|
||||
|
||||
// Text {
|
||||
// x: 1064 + 117
|
||||
// y: 37 + 9 + 64
|
||||
// color: "#777777"
|
||||
// text: Qt.formatDateTime(clock.date, "dd/MM - hh:mm")
|
||||
// font.pixelSize: 32
|
||||
// font.family: "8bitoperator JVE"
|
||||
// }
|
||||
}
|
||||
34
Shell/Topbar/topbar/TopbarSettingIcon.qml
Normal file
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
Item {
|
||||
id: item
|
||||
implicitWidth: 149
|
||||
implicitHeight: 108
|
||||
property url iconSource: "settings.png"
|
||||
property bool selected: false
|
||||
property bool showSoul: true
|
||||
readonly property color selectedColor: "#ffc90e"
|
||||
readonly property color unselectedColor: "#614e6b"
|
||||
state: selected ? "selected" : ""
|
||||
|
||||
Image {
|
||||
id: originalImage
|
||||
source: "./setting_icons/" + item.iconSource
|
||||
}
|
||||
|
||||
ColorOverlay {
|
||||
id: colorOverlay
|
||||
anchors.fill: originalImage
|
||||
source: originalImage
|
||||
color: item.selected ? item.selectedColor : item.unselectedColor
|
||||
}
|
||||
|
||||
Image {
|
||||
id: soul
|
||||
source: "./soul_small.png"
|
||||
x: 19
|
||||
y: 42
|
||||
visible: item.showSoul && item.selected
|
||||
}
|
||||
}
|
||||
BIN
Shell/Topbar/topbar/setting_icons/config.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
Shell/Topbar/topbar/setting_icons/equip.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
Shell/Topbar/topbar/setting_icons/item.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
Shell/Topbar/topbar/setting_icons/power.png
Normal file
|
After Width: | Height: | Size: 63 KiB |
BIN
Shell/Topbar/topbar/setting_names/config.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
Shell/Topbar/topbar/setting_names/equip.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
Shell/Topbar/topbar/setting_names/item.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
Shell/Topbar/topbar/setting_names/power.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
Shell/Topbar/topbar/soul_small.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |