|
|
|
@ -32,8 +32,8 @@ import FishUI 1.0 as FishUI
|
|
|
|
ControlCenterDialog {
|
|
|
|
ControlCenterDialog {
|
|
|
|
id: control
|
|
|
|
id: control
|
|
|
|
|
|
|
|
|
|
|
|
width: 420
|
|
|
|
width: 450
|
|
|
|
height: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2.5
|
|
|
|
height: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2
|
|
|
|
|
|
|
|
|
|
|
|
property var margin: 4 * Screen.devicePixelRatio
|
|
|
|
property var margin: 4 * Screen.devicePixelRatio
|
|
|
|
property point position: Qt.point(0, 0)
|
|
|
|
property point position: Qt.point(0, 0)
|
|
|
|
@ -132,8 +132,8 @@ ControlCenterDialog {
|
|
|
|
id: _background
|
|
|
|
id: _background
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
radius: windowHelper.compositing ? FishUI.Theme.bigRadius * 1.5 : 0
|
|
|
|
radius: windowHelper.compositing ? FishUI.Theme.bigRadius * 1.5 : 0
|
|
|
|
color: FishUI.Theme.darkMode ? "#4D4D4D" : "#FFFFFF"
|
|
|
|
color: FishUI.Theme.darkMode ? "#4D4D4D" : "#F0F0F0"
|
|
|
|
opacity: windowHelper.compositing ? FishUI.Theme.darkMode ? 0.5 : 0.7 : 1.0
|
|
|
|
opacity: windowHelper.compositing ? FishUI.Theme.darkMode ? 0.6 : 0.8 : 1.0
|
|
|
|
antialiasing: true
|
|
|
|
antialiasing: true
|
|
|
|
border.width: 1 / Screen.devicePixelRatio
|
|
|
|
border.width: 1 / Screen.devicePixelRatio
|
|
|
|
border.pixelAligned: Screen.devicePixelRatio > 1 ? false : true
|
|
|
|
border.pixelAligned: Screen.devicePixelRatio > 1 ? false : true
|
|
|
|
@ -150,54 +150,26 @@ ControlCenterDialog {
|
|
|
|
ColumnLayout {
|
|
|
|
ColumnLayout {
|
|
|
|
id: _mainLayout
|
|
|
|
id: _mainLayout
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: FishUI.Units.largeSpacing * 1.5
|
|
|
|
anchors.margins: FishUI.Units.largeSpacing
|
|
|
|
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
|
|
|
|
|
|
|
|
anchors.topMargin: FishUI.Units.largeSpacing * 1.5
|
|
|
|
|
|
|
|
anchors.bottomMargin: FishUI.Units.largeSpacing
|
|
|
|
|
|
|
|
spacing: FishUI.Units.largeSpacing
|
|
|
|
spacing: FishUI.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Item {
|
|
|
|
id: topItem
|
|
|
|
id: topItem
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
height: 36
|
|
|
|
height: 32
|
|
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
RowLayout {
|
|
|
|
id: topItemLayout
|
|
|
|
id: topItemLayout
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
anchors.rightMargin: FishUI.Units.largeSpacing
|
|
|
|
spacing: FishUI.Units.largeSpacing
|
|
|
|
spacing: FishUI.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
|
|
Image {
|
|
|
|
|
|
|
|
id: userIcon
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property int iconSize: 36
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Layout.preferredHeight: iconSize
|
|
|
|
|
|
|
|
Layout.preferredWidth: iconSize
|
|
|
|
|
|
|
|
sourceSize: String(source) === "image://icontheme/default-user" ? Qt.size(iconSize, iconSize) : undefined
|
|
|
|
|
|
|
|
source: currentUser.iconFileName ? "file:///" + currentUser.iconFileName : "image://icontheme/default-user"
|
|
|
|
|
|
|
|
antialiasing: true
|
|
|
|
|
|
|
|
smooth: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
layer.enabled: true
|
|
|
|
|
|
|
|
layer.effect: OpacityMask {
|
|
|
|
|
|
|
|
maskSource: Item {
|
|
|
|
|
|
|
|
width: userIcon.width
|
|
|
|
|
|
|
|
height: userIcon.height
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
radius: parent.height / 2
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
Label {
|
|
|
|
id: userLabel
|
|
|
|
leftPadding: FishUI.Units.largeSpacing
|
|
|
|
text: currentUser.userName
|
|
|
|
text: qsTr("Control Center")
|
|
|
|
Layout.fillHeight: true
|
|
|
|
font.bold: true
|
|
|
|
|
|
|
|
font.pointSize: 14
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
elide: Label.ElideRight
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IconButton {
|
|
|
|
IconButton {
|
|
|
|
@ -229,12 +201,17 @@ ControlCenterDialog {
|
|
|
|
Item {
|
|
|
|
Item {
|
|
|
|
id: cardItems
|
|
|
|
id: cardItems
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
height: 100
|
|
|
|
height: 110
|
|
|
|
visible: wirelessItem.visible || bluetoothItem.visible
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Rectangle {
|
|
|
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
color: FishUI.Theme.darkMode ? "#AEAEAE" : "white"
|
|
|
|
|
|
|
|
radius: FishUI.Theme.bigRadius
|
|
|
|
|
|
|
|
opacity: 0.8
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: FishUI.Units.largeSpacing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CardItem {
|
|
|
|
CardItem {
|
|
|
|
id: wirelessItem
|
|
|
|
id: wirelessItem
|
|
|
|
@ -244,10 +221,7 @@ ControlCenterDialog {
|
|
|
|
: "qrc:/images/light/network-wireless-connected-100.svg"
|
|
|
|
: "qrc:/images/light/network-wireless-connected-100.svg"
|
|
|
|
visible: enabledConnections.wirelessHwEnabled
|
|
|
|
visible: enabledConnections.wirelessHwEnabled
|
|
|
|
checked: enabledConnections.wirelessEnabled
|
|
|
|
checked: enabledConnections.wirelessEnabled
|
|
|
|
label: qsTr("Wi-Fi")
|
|
|
|
label: activeConnection.wirelessName ? activeConnection.wirelessName : qsTr("Wi-Fi")
|
|
|
|
text: enabledConnections.wirelessEnabled ? activeConnection.wirelessName ?
|
|
|
|
|
|
|
|
activeConnection.wirelessName :
|
|
|
|
|
|
|
|
qsTr("On") : qsTr("Off")
|
|
|
|
|
|
|
|
onClicked: nmHandler.enableWireless(!checked)
|
|
|
|
onClicked: nmHandler.enableWireless(!checked)
|
|
|
|
onPressAndHold: {
|
|
|
|
onPressAndHold: {
|
|
|
|
control.visible = false
|
|
|
|
control.visible = false
|
|
|
|
@ -263,7 +237,6 @@ ControlCenterDialog {
|
|
|
|
: "qrc:/images/light/bluetooth-symbolic.svg"
|
|
|
|
: "qrc:/images/light/bluetooth-symbolic.svg"
|
|
|
|
checked: !control.bluetoothDisConnected
|
|
|
|
checked: !control.bluetoothDisConnected
|
|
|
|
label: qsTr("Bluetooth")
|
|
|
|
label: qsTr("Bluetooth")
|
|
|
|
text: checked ? qsTr("On") : qsTr("Off")
|
|
|
|
|
|
|
|
visible: Bluez.Manager.adapters.length
|
|
|
|
visible: Bluez.Manager.adapters.length
|
|
|
|
onClicked: control.toggleBluetooth()
|
|
|
|
onClicked: control.toggleBluetooth()
|
|
|
|
onPressAndHold: {
|
|
|
|
onPressAndHold: {
|
|
|
|
@ -280,13 +253,8 @@ ControlCenterDialog {
|
|
|
|
: "qrc:/images/light/dark-mode.svg"
|
|
|
|
: "qrc:/images/light/dark-mode.svg"
|
|
|
|
checked: FishUI.Theme.darkMode
|
|
|
|
checked: FishUI.Theme.darkMode
|
|
|
|
label: qsTr("Dark Mode")
|
|
|
|
label: qsTr("Dark Mode")
|
|
|
|
text: FishUI.Theme.darkMode ? qsTr("On") : qsTr("Off")
|
|
|
|
|
|
|
|
onClicked: appearance.switchDarkMode(!FishUI.Theme.darkMode)
|
|
|
|
onClicked: appearance.switchDarkMode(!FishUI.Theme.darkMode)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -304,9 +272,9 @@ ControlCenterDialog {
|
|
|
|
Rectangle {
|
|
|
|
Rectangle {
|
|
|
|
id: brightnessItemBg
|
|
|
|
id: brightnessItemBg
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
color: FishUI.Theme.darkMode ? "#AEAEAE" : "white"
|
|
|
|
radius: FishUI.Theme.bigRadius
|
|
|
|
radius: FishUI.Theme.bigRadius
|
|
|
|
color: FishUI.Theme.darkMode ? Qt.rgba(255, 255, 255, 0.1)
|
|
|
|
opacity: 0.8
|
|
|
|
: Qt.rgba(0, 0, 0, 0.05)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
RowLayout {
|
|
|
|
@ -344,11 +312,11 @@ ControlCenterDialog {
|
|
|
|
onMoved: brightnessTimer.start()
|
|
|
|
onMoved: brightnessTimer.start()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
// Label {
|
|
|
|
text: brightnessSlider.value + "%"
|
|
|
|
// text: brightnessSlider.value + "%"
|
|
|
|
color: FishUI.Theme.disabledTextColor
|
|
|
|
// color: FishUI.Theme.disabledTextColor
|
|
|
|
Layout.preferredWidth: _fontMetrics.advanceWidth("100%")
|
|
|
|
// Layout.preferredWidth: _fontMetrics.advanceWidth("100%")
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -361,9 +329,9 @@ ControlCenterDialog {
|
|
|
|
Rectangle {
|
|
|
|
Rectangle {
|
|
|
|
id: volumeItemBg
|
|
|
|
id: volumeItemBg
|
|
|
|
anchors.fill: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
color: FishUI.Theme.darkMode ? "#AEAEAE" : "white"
|
|
|
|
radius: FishUI.Theme.bigRadius
|
|
|
|
radius: FishUI.Theme.bigRadius
|
|
|
|
color: FishUI.Theme.darkMode ? Qt.rgba(255, 255, 255, 0.1)
|
|
|
|
opacity: 0.8
|
|
|
|
: Qt.rgba(0, 0, 0, 0.05)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
RowLayout {
|
|
|
|
@ -405,11 +373,11 @@ ControlCenterDialog {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
// Label {
|
|
|
|
text: parseInt(volumeSlider.value / PulseAudio.NormalVolume * 100.0) + "%"
|
|
|
|
// text: parseInt(volumeSlider.value / PulseAudio.NormalVolume * 100.0) + "%"
|
|
|
|
Layout.preferredWidth: _fontMetrics.advanceWidth("100%")
|
|
|
|
// Layout.preferredWidth: _fontMetrics.advanceWidth("100%")
|
|
|
|
color: FishUI.Theme.disabledTextColor
|
|
|
|
// color: FishUI.Theme.disabledTextColor
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -477,4 +445,15 @@ ControlCenterDialog {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function calcExtraSpacing(cellSize, containerSize) {
|
|
|
|
|
|
|
|
var availableColumns = Math.floor(containerSize / cellSize)
|
|
|
|
|
|
|
|
var extraSpacing = 0
|
|
|
|
|
|
|
|
if (availableColumns > 0) {
|
|
|
|
|
|
|
|
var allColumnSize = availableColumns * cellSize
|
|
|
|
|
|
|
|
var extraSpace = Math.max(containerSize - allColumnSize, 0)
|
|
|
|
|
|
|
|
extraSpacing = extraSpace / availableColumns
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return Math.floor(extraSpacing)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|