mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 19:58:13 +08:00
cd7e4c9bd3
* rotate general name when it becomes too long * remember x and y pos of window * config.language, and can change translations according to language * standard i18n (WIP) * client translation (WIP) * translation for standard cards * translate skill name and adjust UI
61 lines
1.2 KiB
QML
61 lines
1.2 KiB
QML
import QtQuick
|
|
import Qt5Compat.GraphicalEffects
|
|
|
|
Item {
|
|
id: root
|
|
property alias skill: skill.text
|
|
property string type: "active"
|
|
property string orig: ""
|
|
property bool pressed: false
|
|
|
|
onEnabledChanged: {
|
|
if (!enabled)
|
|
pressed = false;
|
|
}
|
|
|
|
width: type === "active" ? Math.max(80, skill.width + 8) : skill.width
|
|
height: type === "active" ? 36 : 24
|
|
|
|
Image {
|
|
x: -13 - 120 * 0.166
|
|
y: -6 - 55 * 0.166
|
|
scale: 0.66
|
|
source: type !== "active" ? ""
|
|
: AppPath + "/image/button/skill/active/"
|
|
+ (enabled ? (pressed ? "pressed" : "normal") : "disabled")
|
|
}
|
|
|
|
Text {
|
|
anchors.centerIn: parent
|
|
id: skill
|
|
font.family: fontLi2.name
|
|
font.pixelSize: Math.max(26 - text.length, 18)
|
|
visible: false
|
|
}
|
|
|
|
Glow {
|
|
id: glowItem
|
|
source: skill
|
|
anchors.fill: skill
|
|
radius: 6
|
|
//samples: 8
|
|
color: "grey"
|
|
}
|
|
|
|
LinearGradient {
|
|
anchors.fill: skill
|
|
source: skill
|
|
gradient: Gradient {
|
|
GradientStop { position: 0; color: "#FFE07C" }
|
|
GradientStop { position: 1; color: "#B79A5F" }
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
id: mouseArea
|
|
anchors.fill: parent
|
|
enabled: root.type === "active" && root.enabled
|
|
onClicked: parent.pressed = !parent.pressed;
|
|
}
|
|
}
|