mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
162b3af505
* 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
70 lines
1.4 KiB
QML
70 lines
1.4 KiB
QML
import QtQuick
|
|
|
|
Item {
|
|
property bool enabled: true
|
|
property alias text: title.text
|
|
property alias textColor: title.color
|
|
property alias textFont: title.font
|
|
property alias backgroundColor: bg.color
|
|
property alias border: bg.border
|
|
property alias iconSource: icon.source
|
|
property int padding: 5
|
|
|
|
signal clicked
|
|
|
|
id: button
|
|
width: icon.width + title.implicitWidth + padding * 2
|
|
height: Math.max(icon.height, title.implicitHeight) + padding * 2
|
|
|
|
Rectangle {
|
|
id: bg
|
|
anchors.fill: parent
|
|
color: "black"
|
|
border.width: 2
|
|
border.color: "white"
|
|
opacity: 0.8
|
|
}
|
|
|
|
states: [
|
|
State {
|
|
name: "hovered"; when: mouse.containsMouse
|
|
PropertyChanges { target: bg; color: "white" }
|
|
PropertyChanges { target: title; color: "black" }
|
|
},
|
|
State {
|
|
name: "disabled"; when: !enabled
|
|
PropertyChanges { target: button; opacity: 0.2 }
|
|
}
|
|
]
|
|
|
|
MouseArea {
|
|
id: mouse
|
|
anchors.fill: parent
|
|
hoverEnabled: parent.enabled
|
|
onReleased: if (parent.enabled) parent.clicked()
|
|
}
|
|
|
|
Row {
|
|
x: padding
|
|
y: padding
|
|
anchors.centerIn: parent
|
|
spacing: 5
|
|
|
|
Image {
|
|
id: icon
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
fillMode: Image.PreserveAspectFit
|
|
}
|
|
|
|
Text {
|
|
id: title
|
|
font.pixelSize: 18
|
|
// font.family: "WenQuanYi Micro Hei"
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
text: ""
|
|
color: "white"
|
|
}
|
|
}
|
|
}
|
|
|