Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c3ee209
chore: add animation for menu
Jul 17, 2024
b690abd
chore: add ControlGroup
Jul 18, 2024
d750dda
chore: add the animation for FloatingMessage
Jul 23, 2024
c0395f2
chore: dci icon contorl support animation
kegechen Jul 18, 2024
607f80c
chore: button group animation support
kegechen Jul 24, 2024
e0d00ae
chore: toolbutton hovered background tweak
kegechen Aug 5, 2024
4e936dd
fix: icon too small when devicePixelRatio > 1.0
kegechen Aug 6, 2024
2d39461
chore: add the animation for ProgressBar
Jul 30, 2024
ffc4f6c
fix: column layout fills the space available
Aug 7, 2024
0599e74
chore: add the animation for ProgressBar
Jul 30, 2024
b1abe9b
feat: add ListView to support hover animations
kegechen Jul 30, 2024
98d7e22
feat: CheckDelegate animation
kegechen Jul 31, 2024
703a8c2
feat: dnd multi selected item
kegechen Aug 2, 2024
0b6272d
chore: adjust the animation for menu
Jul 25, 2024
0a2f37d
chore: switch animation tweak
kegechen Aug 9, 2024
bd5bb68
chore: ListView hover background color tweak
kegechen Aug 9, 2024
968cee9
chore: avoid warnning
kegechen Aug 9, 2024
deb2cb4
fix: drag item image pixelated
kegechen Aug 9, 2024
dbbbf56
chore: adjust the handleGradientColor
Aug 15, 2024
2331c1c
fix: the display size of dci icon is exceptional
Aug 14, 2024
8734934
fix: icon size changed on paletteChanged
kegechen Aug 15, 2024
43ad706
fix: crashed on floatingmessage closed
kegechen Aug 15, 2024
bf25063
fix: cashed on onTextureChanged
kegechen Aug 15, 2024
2aec399
chore: modify message animation
Aug 20, 2024
d5f1e02
chore: animation tweak
kegechen Aug 20, 2024
2ce63ba
chore: tweak the menu animation
Aug 21, 2024
54c3239
chore: button style tweak
kegechen Aug 22, 2024
b873507
chore: listview hover background color tweak
kegechen Aug 22, 2024
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
1 change: 1 addition & 0 deletions chameleon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set(QML_FILES
Frame.qml
GroupBox.qml
ItemDelegate.qml
ListView.qml
MenuItem.qml
Menu.qml
MenuSeparator.qml
Expand Down
9 changes: 9 additions & 0 deletions chameleon/ListView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import org.deepin.dtk 1.0 as D

D.ListView {

}
52 changes: 52 additions & 0 deletions examples/exhibition/ControlGroup.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import QtQuick 2.0
import QtQuick.Window 2.11
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0
import ".."

ControlGroup {
title: "磁盘"
ControlGroupItem {
Label {
visible: true
text: "test0111111111111"
}
Label {
visible: true
text: "test13333333333"
}
}
ControlGroupItem {
Rectangle {
width: 100
height: 100
color: "red"
border.color: "black"
border.width: 5
radius: 10
}
Switch {
checked: true
Layout.alignment: Qt.AlignHCenter
}
}
ControlGroupItem {
Rectangle {
width: 100
height: 100
color: "green"
border.color: "black"
border.width: 5
radius: 10
}
Button {
width: 100
height: 100
Layout.alignment: Qt.AlignHCenter
}
}
}
1 change: 1 addition & 0 deletions examples/exhibition/qml-qt6.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
<file>ToolBar.qml</file>
<file>Dialog.qml</file>
<file>ProgressBar.qml</file>
<file>ControlGroup.qml</file>
</qresource>
</RCC>
3 changes: 3 additions & 0 deletions qt6/src/dtkdeclarative_qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<file>qml/private/ButtonPanel.qml</file>
<file>qml/ActionButton.qml</file>
<file>qml/ItemDelegate.qml</file>
<file>qml/ListView.qml</file>
<file>qml/CheckDelegate.qml</file>
<file>qml/TipsSlider.qml</file>
<file>qml/SliderTipItem.qml</file>
Expand Down Expand Up @@ -109,6 +110,8 @@
<file>qml/ButtonIndicator.qml</file>
<file>qml/EmbeddedProgressBar.qml</file>
<file>qml/WaterProgressBar.qml</file>
<file>qml/ControlGroup.qml</file>
<file>qml/ControlGroupItem.qml</file>
<file>qml/private/ProgressBarImpl.qml</file>
<file>qml/private/ProgressBarPanel.qml</file>
<file>qml/PlaceholderText.qml</file>
Expand Down
4 changes: 4 additions & 0 deletions qt6/src/qml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ set(QML_DTK_CONTROLS
"qml/ComboBox.qml"
"qml/ActionButton.qml"
"qml/ItemDelegate.qml"
"qml/ListView.qml"
"qml/CheckDelegate.qml"
"qml/TipsSlider.qml"
"qml/SliderTipItem.qml"
Expand Down Expand Up @@ -96,6 +97,9 @@ set(QML_DTK_CONTROLS
"qml/EmbeddedProgressBar.qml"
"qml/WaterProgressBar.qml"
"qml/PlaceholderText.qml"
"qml/ControlGroup.qml"
"qml/ControlGroupItem.qml"
"qml/DragItemsImage.qml"
)

foreach(QML_FILE ${QML_DTK_CONTROLS})
Expand Down
1 change: 1 addition & 0 deletions qt6/src/qml/ArrowListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import QtQuick 2.11
import QtQuick.Window 2.11
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0 as D
import org.deepin.dtk.style 1.0 as DS
import org.deepin.dtk.private 1.0 as P

Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/BoxPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Item {
property int innerShadowOffsetY1: -1
// Background color changes with hover state if `backgroundFlowingHovered` is `true`.
property bool backgroundFlowsHovered: true
property bool enableBoxShadow: control.D.ColorSelector.family === D.Palette.CommonColor

Loader {
anchors.fill: backgroundRect
active: control.D.ColorSelector.family === D.Palette.CommonColor
active: enableBoxShadow
sourceComponent: BoxShadow {
shadowBlur: control.boxShadowBlur
shadowOffsetY: control.boxShadowOffsetY
Expand Down
25 changes: 21 additions & 4 deletions qt6/src/qml/ButtonBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import QtQuick 2.11
import QtQuick.Layouts 1.11
import org.deepin.dtk 1.0 as D
import org.deepin.dtk.style 1.0 as DS
import org.deepin.dtk.private 1.0 as P

Control {
id: control
Expand All @@ -24,11 +25,27 @@ Control {
children: control.buttons
}

background: BoxPanel {
implicitWidth: DS.Style.buttonBox.width
implicitHeight: DS.Style.buttonBox.height
backgroundFlowsHovered: D.ColorSelector.family === D.Palette.CrystalColor

ParallelAnimation {
running: btnGroup.checkedButton && (btnGroup.checkedButton.x !== backgroundPanel.x || btnGroup.checkedButton.y !== backgroundPanel.y)
NumberAnimation { target: backgroundPanel; property: "x"; to: btnGroup.checkedButton ? btnGroup.checkedButton.x : backgroundPanel.x; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "y"; to: btnGroup.checkedButton ? btnGroup.checkedButton.y : backgroundPanel.y; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "width"; to: btnGroup.checkedButton ? btnGroup.checkedButton.width : backgroundPanel.width; duration: 200 }
NumberAnimation { target: backgroundPanel; property: "height"; to: btnGroup.checkedButton ? btnGroup.checkedButton.height : backgroundPanel.height; duration: 200 }
}

P.ButtonPanel {
id: backgroundPanel
visible: btnGroup.checkedButton
implicitWidth: visible ? btnGroup.checkedButton.width : 0
implicitHeight: visible ? btnGroup.checkedButton.height : 0
button: control
outsideBorderColor: null
color1: D.Palette {
normal {
common: Qt.rgba(0, 0, 0, 0.2)
}
}
color2: color1
}
}
25 changes: 21 additions & 4 deletions qt6/src/qml/CheckDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ T.CheckDelegate {
id: control
property Component content
property D.Palette backgroundColor: DS.Style.itemDelegate.checkBackgroundColor
property string indicatorIcon: control.checkState === Qt.Unchecked ? "item_unchecked" : "item_checked"
property bool indicatorVisible: control.checked

implicitWidth: DS.Style.control.implicitWidth(control)
implicitHeight: DS.Style.control.implicitHeight(control)
Expand All @@ -26,15 +28,22 @@ T.CheckDelegate {
indicator: Loader {
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
active: control.checked
active: indicatorVisible

sourceComponent: D.DciIcon {
palette: control.D.DTK.makeIconPalette(control.palette)
mode: control.D.ColorSelector.controlState
theme: control.D.ColorSelector.controlTheme
name: "menu_select"
name: indicatorIcon
sourceSize: Qt.size(DS.Style.itemDelegate.checkIndicatorIconSize, DS.Style.itemDelegate.checkIndicatorIconSize)
fallbackToQIcon: false
onNameChanged: {
play(D.DTK.NormalState);
}
Component.onCompleted: {
if (indicatorVisible)
play(D.DTK.NormalState);
}
}
}

Expand All @@ -58,12 +67,12 @@ T.CheckDelegate {
}
}

background: Item {
background: Control {
implicitWidth: DS.Style.itemDelegate.width
implicitHeight: DS.Style.itemDelegate.height
Rectangle {
anchors.fill: parent
visible: !checked
visible: !checked && !control.ListView.view
color: control.D.ColorSelector.backgroundColor
radius: DS.Style.control.radius
}
Expand All @@ -74,4 +83,12 @@ T.CheckDelegate {
radius: DS.Style.control.radius
}
}

onHoveredChanged: {
if (checked || !ListView.view)
return

if (ListView.view)
ListView.view.setHoverItem(control.hovered ? control : null)
}
}
Loading