style: create style with a simple button

This commit is contained in:
outfoxxed 2024-10-18 00:55:38 -07:00
parent bd99baf876
commit 614b9cac0c
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
4 changed files with 25 additions and 0 deletions

View file

@ -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
View file

@ -0,0 +1 @@
add_subdirectory(style)

15
src/style/Button.qml Normal file
View 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
View 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
)