FreeKill/qml/Pages/RoomElement/SkillButton.qml
notify 162b3af505 Use skill (#25)
* distance & snatch

* distance & snatch - clean

* fix: client.alive_players

* room:askForCardChosen(todo: snatch)

* add skill to players(uncomplete)

* ui of skill btn

* expand pile(not completed)

* Use card2 (#23)

* snatch (todo: owner_map)

* owner_map

* remove too many snatch

* update

* call active skill's functions

* use zhiheng

* Qt6 (#24)

* use qt6

* android compiling

* remove version number of qml import

* correct anti-sql injection; update deprecated code

* add fkparse as submodule

* link fkparse, and write simple functions

* adjust ui

* adjust layout for photos; fix qml warning

* android problem fix (partially)

* move ico

* update copy_assets

* update logic for ok/cancel btn
2022-09-14 13:01:10 +08:00

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" ? 120 * 0.66 : 72 * 0.66
height: type === "active" ? 55 * 0.66 : 36 * 0.66
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: 36 * 0.66
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;
}
}