mirror of
https://github.com/hyprwm/hyprland-qt-support.git
synced 2025-05-12 21:20:35 +01:00
style: create style with a simple button
This commit is contained in:
parent
bd99baf876
commit
614b9cac0c
4 changed files with 25 additions and 0 deletions
|
@ -14,3 +14,5 @@ find_package(Qt6 6.6 REQUIRED COMPONENTS Qml Quick QuickControls2)
|
|||
|
||||
qt_standard_project_setup(REQUIRES 6.6)
|
||||
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
|
1
src/CMakeLists.txt
Normal file
1
src/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
|||
add_subdirectory(style)
|
15
src/style/Button.qml
Normal file
15
src/style/Button.qml
Normal file
|
@ -0,0 +1,15 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls.Basic as T
|
||||
|
||||
T.Button {
|
||||
id: control
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 50
|
||||
implicitHeight: 30
|
||||
color: control.down ? Qt.tint(control.palette.button, Qt.alpha(control.palette.highlight, 0.4)) : control.palette.button
|
||||
radius: 10
|
||||
border.color: control.hovered ? control.palette.highlight : control.palette.light
|
||||
border.width: 1
|
||||
}
|
||||
}
|
7
src/style/CMakeLists.txt
Normal file
7
src/style/CMakeLists.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
qt_add_qml_module(hyprland-quick-style
|
||||
URI org.hyprland.style
|
||||
VERSION 0.1
|
||||
IMPORTS QtQuick.Controls.Basic
|
||||
QML_FILES
|
||||
Button.qml
|
||||
)
|
Loading…
Reference in a new issue