55 lines
1.4 KiB
QML
55 lines
1.4 KiB
QML
import QtQuick
|
|
import QtQuick.Effects
|
|
import QtQuick.Controls
|
|
import QtQuick.Controls.Material
|
|
|
|
Rectangle {
|
|
id: root
|
|
property color accent_color: "#00000000"
|
|
property color font_color: "#00000000"
|
|
property int font_enlarged_text_size: 20
|
|
property int font_normal_text_size: 16
|
|
property string text: "Connect"
|
|
signal connect;
|
|
layer.enabled: true
|
|
layer.effect: MultiEffect {
|
|
shadowEnabled: true
|
|
}
|
|
|
|
Text {
|
|
anchors.centerIn: parent
|
|
font.pointSize: root.font_enlarged_text_size
|
|
color: root.font_color
|
|
text: root.text
|
|
horizontalAlignment: Text.AlignHCenter
|
|
}
|
|
|
|
radius: 5
|
|
border {
|
|
color: root.accent_color
|
|
width: 0.5
|
|
}
|
|
MouseArea {
|
|
id: settings_button_area
|
|
anchors.fill: parent
|
|
hoverEnabled: true
|
|
property color settings_rect_pressed_prev: "#00000000"
|
|
property color settings_rect_entered_prev: "#00000000"
|
|
onEntered: {
|
|
settings_rect_entered_prev = root.color
|
|
root.color = "#5A1F1F1F"
|
|
}
|
|
onExited: {
|
|
root.color = settings_rect_entered_prev
|
|
}
|
|
onPressed: {
|
|
settings_rect_pressed_prev = root.color
|
|
root.color = "#5A1F4F1F"
|
|
root.connect();
|
|
}
|
|
onReleased: {
|
|
root.color = settings_rect_pressed_prev
|
|
}
|
|
}
|
|
|
|
}
|