46 lines
1.2 KiB
QML
46 lines
1.2 KiB
QML
import QtQuick
|
|
import QtQuick.Effects
|
|
import QtQuick.Controls
|
|
import QtQuick.Controls.Material
|
|
|
|
Rectangle {
|
|
id: settings_rect
|
|
signal open;
|
|
property color accent_color: "#00000000"
|
|
property int font_enlarged_text_size: 20
|
|
Behavior on color {
|
|
ColorAnimation {
|
|
duration: 200
|
|
}
|
|
}
|
|
Text {
|
|
id: settings_text
|
|
text: "⚙"
|
|
anchors.centerIn: parent
|
|
color: settings_rect.accent_color
|
|
font.pointSize: settings_rect.font_enlarged_text_size
|
|
}
|
|
|
|
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 = settings_rect.color
|
|
settings_rect.color = "#5A1F1F1F"
|
|
}
|
|
onExited: {
|
|
settings_rect.color = settings_rect_entered_prev
|
|
}
|
|
onPressed: {
|
|
settings_rect_pressed_prev = settings_rect.color
|
|
settings_rect.color = "#5A1F4F1F"
|
|
settings_rect.open();
|
|
}
|
|
onReleased: {
|
|
settings_rect.color = settings_rect_pressed_prev
|
|
}
|
|
}
|
|
}
|