Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(src): Modify the icons of window button & Change Blur radius and add ToolButton #17

Merged
merged 24 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e036f40
fix(example): Fix import path setting
elysia-best Dec 25, 2024
59f3eb5
feat: Add new LingmoStyle
elysia-best Dec 25, 2024
317dd61
feat(LingmoStyle): Added some new style.
elysia-best Dec 25, 2024
5c38bf3
feat(UI): Add CheckBox
elysia-best Dec 25, 2024
40794fa
feat(LingmoStyle): Add CheckBox
elysia-best Dec 26, 2024
fbfbf8b
feat(LingmoStyle): Add CheckDelegate
elysia-best Dec 26, 2024
1dc6b1e
feat(src): Added LingmoTextBox
elysia-best Dec 28, 2024
26f23b7
Merge remote-tracking branch 'origin/main' into fix-import-path
elysia-best Dec 28, 2024
ce540db
feat(src): Move the radius defines to LingmoUnits file.
elysia-best Dec 28, 2024
73964b8
feat(src): Modified the round corner for LIngmoControlBackground
elysia-best Dec 28, 2024
7e08e5c
feat(LingmoStyle): Update ComboBox
elysia-best Dec 28, 2024
8af555c
feat: Update ApplicationWindow
elysia-best Dec 28, 2024
33bad91
Remove ApplicationWindow
elysia-best Dec 28, 2024
5290ff6
feat: Fix
elysia-best Dec 28, 2024
0d008d3
feat: Added DelayButton
elysia-best Dec 28, 2024
d0384a7
feat(LingmoStyle): Added Dial
elysia-best Dec 31, 2024
247d8a2
feat(src): Added LingmoCustomDialog
elysia-best Dec 31, 2024
7c4b90c
feat(LingmoStyle): Update Dialog and DialogButtonBox
elysia-best Jan 2, 2025
00c4f56
feat(LingmoStyle): Add Dialog and Drawer
elysia-best Jan 3, 2025
d639e33
feat(example): Delete unused lines
elysia-best Jan 3, 2025
25979d9
fix(build): Fix the CMakeLists.txt file.
elysia-best Jan 3, 2025
9aca14d
feat(LingmoAppBar): Modify the icons of window button
elysia-best Jan 4, 2025
2dcbaa6
Merge remote-tracking branch 'origin/main' into fix-import-path
elysia-best Jan 4, 2025
b97a479
feat: Change Blur radius and add ToolButton
elysia-best Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LingmoStyle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ endforeach (filepath)
# Set Qt6 QMl Plugins
qt_add_qml_module(${MODULE_NAME}
PLUGIN_TARGET ${MODULE_NAME}
OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/QtQuick/Controls/LingmoStyle
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/temp/QtQuick/Controls/LingmoStyle
VERSION ${MODULE_VERSION}
URI "QtQuick.Controls.LingmoStyle"
TYPEINFO "plugins.qmltypes"
Expand All @@ -50,5 +50,5 @@ qt_add_qml_module(${MODULE_NAME}
RESOURCE_PREFIX "/style"
)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/QtQuick/Controls/LingmoStyle DESTINATION ${INSTALL_QMLDIR}/QtQuick/Controls)
install(DIRECTORY ${CMAKE_BINARY_DIR}/temp/QtQuick/Controls/LingmoStyle DESTINATION ${INSTALL_QMLDIR}/QtQuick/Controls)
install(TARGETS ${MODULE_NAME} DESTINATION ${INSTALL_QMLDIR}/QtQuick/Controls/${MODULE_NAME})
82 changes: 68 additions & 14 deletions LingmoStyle/ToolButton.qml
Original file line number Diff line number Diff line change
@@ -1,12 +1,63 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
/*
* SPDX-FileCopyrightText: 2024 Elysia <[email protected]>
*
* SPDX-License-Identifier: GPL-3.0
*/

import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls.impl
import QtQuick.Controls.Universal
import LingmoUI

T.ToolButton {
property bool disabled: !enabled
property string contentDescription: ""
property color normalColor: LingmoTheme.dark ? Qt.rgba(
62 / 255, 62 / 255,
62 / 255,
1) : Qt.rgba(254 / 255, 254 / 255, 254 / 255, 1)
property color hoverColor: LingmoTheme.dark ? Qt.rgba(
68 / 255, 68 / 255,
68 / 255,
1) : Qt.rgba(246 / 255, 246 / 255, 246 / 255, 1)
property color disableColor: LingmoTheme.dark ? Qt.rgba(
59 / 255, 59 / 255,
59 / 255,
1) : Qt.rgba(251 / 255, 251
/ 255, 251 / 255, 1)
property color dividerColor: LingmoTheme.dark ? Qt.rgba(
80 / 255, 80 / 255,
80 / 255,
1) : Qt.rgba(233 / 255, 233
/ 255, 233 / 255, 1)
property color textColor: {
if (LingmoTheme.dark) {
if (!enabled) {
return Qt.rgba(131 / 255, 131 / 255, 131 / 255, 1)
}
if (pressed) {
return Qt.rgba(162 / 255, 162 / 255, 162 / 255, 1)
}
return Qt.rgba(1, 1, 1, 1)
} else {
if (!enabled) {
return Qt.rgba(160 / 255, 160 / 255, 160 / 255, 1)
}
if (pressed) {
return Qt.rgba(96 / 255, 96 / 255, 96 / 255, 1)
}
return Qt.rgba(0, 0, 0, 1)
}
}
Accessible.role: Accessible.Button
Accessible.name: control.text
Accessible.description: contentDescription
Accessible.onPressAction: control.clicked()
verticalPadding: 0
horizontalPadding: 12
font: LingmoTextStyle.Body
focusPolicy: Qt.TabFocus

id: control

implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
Expand All @@ -31,20 +82,23 @@ T.ToolButton {
icon: control.icon
text: control.text
font: control.font
color: Color.transparent(control.Universal.foreground, enabled ? 1.0 : 0.2)
color: control.textColor
}

background: Rectangle {
background: LingmoControlBackground {
implicitWidth: 68
implicitHeight: 48 // AppBarThemeCompactHeight

color: control.enabled && (control.highlighted || control.checked) ? control.Universal.accent : "transparent"

Rectangle {
width: parent.width
height: parent.height
visible: enabled && (control.down || control.hovered)
color: control.down ? control.Universal.listMediumColor : control.Universal.listLowColor
implicitHeight: 48
radius: LingmoUnits.smallRadius
color: {
if (!enabled) {
return disableColor
}
return hovered ? hoverColor : normalColor
}
shadow: !pressed && enabled
LingmoFocusRectangle {
visible: control.activeFocus
radius: LingmoUnits.smallRadius
}
}
}
1 change: 1 addition & 0 deletions example/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ LingmoObject {
Component.onCompleted: {
LingmoApp.init(root, Qt.locale("zh_CN"));
LingmoTheme.animationEnabled = true;
LingmoTheme.blurBehindWindowEnabled = true;
LingmoTheme.darkMode = LingmoThemeType.Dark;

LingmoRouter.routes = {
Expand Down
6 changes: 6 additions & 0 deletions example/qml/windows/MainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import LingmoUI
import QtQuick.Controls.LingmoStyle as QQCL

LingmoWindow {
id: window
Expand Down Expand Up @@ -85,5 +86,10 @@ LingmoWindow {
console.log("成功点击!")
}
}

QQCL.ToolButton {
Layout.alignment: Qt.AlignHCenter
text: "I'm an Button"
}
}
}
8 changes: 4 additions & 4 deletions src/Controls/LingmoAppBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ Rectangle {
padding: 0
verticalPadding: 0
horizontalPadding: 0
iconSource: LingmoIcons.ChromeMinimize
iconSource: LingmoIcons.ChevronDown
Layout.alignment: Qt.AlignVCenter
iconSize: 11
iconSize: 16
text: minimizeText
radius: LingmoUnits.windowRadius
visible: !isMac && showMinimize
Expand All @@ -231,7 +231,7 @@ Rectangle {
padding: 0
verticalPadding: 0
horizontalPadding: 0
iconSource: d.isRestore ? LingmoIcons.ChromeRestore : LingmoIcons.ChromeMaximize
iconSource: d.isRestore ? LingmoIcons.BackToWindow : LingmoIcons.FullScreen
color: {
if (down) {
return maximizePressColor
Expand All @@ -243,7 +243,7 @@ Rectangle {
radius: LingmoUnits.windowRadius
iconColor: control.textColor
text: d.isRestore ? restoreText : maximizeText
iconSize: 11
iconSize: 12
onClicked: maxClickListener()
}
LingmoIconButton {
Expand Down
2 changes: 1 addition & 1 deletion src/Controls/LingmoWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Window {
property Component loadingItem: com_loading
property bool fitsAppBarWindows: false
property var tintOpacity: LingmoTheme.dark ? 0.80 : 0.75
property int blurRadius: 60
property int blurRadius: 80
// Do not change this in other place!
property var windowVisibility: window.visibility
property alias effect: frameless.effect
Expand Down
Loading