Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
115 changes: 85 additions & 30 deletions panels/notification/osd/audio/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import org.deepin.ds 1.0
import org.deepin.dtk 1.0 as D

AppletItem {
id: control
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
implicitWidth: 338
implicitHeight: 60

readonly property bool singleView: true

function update(osdType)
{
Expand All @@ -39,59 +40,113 @@ AppletItem {
]

RowLayout {
anchors.leftMargin: 68
anchors.rightMargin: 26
spacing: 0
width: parent.width
anchors.verticalCenter: parent.verticalCenter
anchors.topMargin: 2

D.DciIcon {
width: 32
height: 32
sourceSize {
width: 32
height: 32
}
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: 14
name: Applet.iconName
theme: D.DTK.themeType
palette: D.DTK.makeIconPalette(control.palette)
}

ColumnLayout {
spacing: 5
Layout.alignment: Qt.AlignVCenter
Loader {
visible: active
active: Applet.increaseVolume
sourceComponent: scaleCom
x: progressBar.visualPosition * 1.5 * progressBar.width
spacing: 0
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: 14
Layout.preferredWidth: 220
Layout.fillHeight: true

ScaleCom {
visible: Applet.increaseVolume
Layout.bottomMargin: 2
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: progressBar.width / 1.5
}

D.ProgressBar {
id: progressBar
Layout.preferredWidth: 200
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 4
Layout.preferredWidth: 220
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
from: 0
value: Applet.volumeValue / (Applet.increaseVolume ? 1.5 : 1.0)
to: 1

property D.Palette contentColor: D.Palette {
normal: Qt.rgba(0, 0, 0, 1)
normalDark: Qt.rgba(1, 1, 1, 1)
}
property D.Palette backgroundColor: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.1)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}
contentItem: Item {
width: progressBar.visualPosition * parent.width
height: parent.height
Rectangle {
anchors.fill: parent
radius: 2
color: progressBar.D.ColorSelector.contentColor
}
Behavior on width {
NumberAnimation { duration: 150; easing.type: Easing.OutCubic }
}
}
background: Rectangle {
color: progressBar.D.ColorSelector.backgroundColor
radius: 2
}
}

Loader {
visible: active
active: Applet.increaseVolume
sourceComponent: scaleCom
x: progressBar.visualPosition * 1.5 * progressBar.width
ScaleCom {
visible: Applet.increaseVolume
Layout.topMargin: 2
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: progressBar.width / 1.5
}
}

Item {
Layout.fillWidth: true
}

Text {
Layout.alignment: Qt.AlignVCenter
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
font: D.DTK.fontManager.t4
text: Number(Applet.volumeValue * 100).toFixed(0) + "%"
text: Number(Applet.volumeValue * 100).toFixed(0)
color: palette.windowText
}
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.topMargin: height / 2
Layout.rightMargin: 14
font: D.DTK.fontManager.t10
color: palette.windowText
text: "%"
}
}

Component {
id: scaleCom
Rectangle {
height: 6
width: 2
color: "gray"
component ScaleCom: Control {
id: scaleControl
property D.Palette scaleColor: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.3)
normalDark: Qt.rgba(1, 1, 1, 0.3)
}

contentItem: Rectangle {
implicitHeight: 6
implicitWidth: 2
color: scaleControl.D.ColorSelector.scaleColor
}
}
}
70 changes: 59 additions & 11 deletions panels/notification/osd/brightness/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import org.deepin.ds 1.0
import org.deepin.dtk 1.0 as D

AppletItem {
id: control
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
implicitWidth: 338
implicitHeight: 60

property bool singleView: true

function update(osdType)
{
Expand All @@ -37,29 +38,76 @@ AppletItem {
]

RowLayout {
anchors.leftMargin: 68
anchors.rightMargin: 26
spacing: 0
width: parent.width
anchors.verticalCenter: parent.verticalCenter
anchors.topMargin: 2

D.DciIcon {
sourceSize {
width: 32
height: 32
}
Layout.alignment: Qt.AlignLeft
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: 14
name: Applet.iconName
theme: D.DTK.themeType
palette: D.DTK.makeIconPalette(control.palette)
}

D.ProgressBar {
Layout.preferredWidth: 200
id: progressBar
Layout.preferredHeight: 4
Layout.preferredWidth: 220
Layout.leftMargin: 14
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
from: 0
value: Applet.brightness
to: 1

property D.Palette contentColor: D.Palette {
normal: Qt.rgba(0, 0, 0, 1)
normalDark: Qt.rgba(1, 1, 1, 1)
}
property D.Palette backgroundColor: D.Palette {
normal: Qt.rgba(0, 0, 0, 0.1)
normalDark: Qt.rgba(1, 1, 1, 0.1)
}
contentItem: Item {
width: progressBar.visualPosition * parent.width
height: parent.height
Rectangle {
anchors.fill: parent
radius: 2
color: progressBar.D.ColorSelector.contentColor
}
Behavior on width {
NumberAnimation { duration: 150; easing.type: Easing.OutCubic }
}
}
background: Rectangle {
color: progressBar.D.ColorSelector.backgroundColor
radius: 2
}
}

Item {
Layout.fillWidth: true
}

Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
font: D.DTK.fontManager.t4
text: Number(Applet.brightness * 100).toFixed(0) + "%"
text: Number(Applet.brightness * 100).toFixed(0)
color: palette.windowText
}
Text {
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.topMargin: height / 2
Layout.rightMargin: 14
font: D.DTK.fontManager.t10
color: palette.windowText
text: "%"
}
}
}
30 changes: 19 additions & 11 deletions panels/notification/osd/default/package/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import org.deepin.ds 1.0
import org.deepin.dtk 1.0 as D

AppletItem {
id: control
implicitWidth: childrenRect.width
implicitHeight: childrenRect.height
implicitHeight: 60

readonly property bool singleView: true

function update(osdType)
{
Expand Down Expand Up @@ -74,27 +75,34 @@ AppletItem {
}

RowLayout {
anchors.leftMargin: 68
anchors.rightMargin: 26
spacing: 0
anchors.verticalCenter: parent.verticalCenter
anchors.topMargin: 2

D.DciIcon {
sourceSize {
width: 32
height: 32
}
Layout.alignment: Qt.AlignLeft
Layout.leftMargin: 14
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.leftMargin: 20
visible: control.iconName
name: control.iconName
theme: D.DTK.themeType
palette: D.DTK.makeIconPalette(control.palette)
}
Item {
Layout.fillWidth: true
}

Text {
Layout.fillWidth: true
Layout.leftMargin: 20
Layout.rightMargin: 20
font: D.DTK.fontManager.t4
Layout.alignment: Qt.AlignVCenter
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.rightMargin: 20
visible: control.text
color: palette.windowText
text: control.text
}
}
Expand Down
Loading