refactor: adjust codestyle
This commit is contained in:
parent
9264306a36
commit
65601cb855
1 changed files with 7 additions and 10 deletions
|
|
@ -2,15 +2,17 @@ pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import qs.Commons
|
import qs.Commons
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
property var screen
|
property ShellScreen modelData
|
||||||
readonly property real scaling: screen ? ScalingService.scale(screen) : 1
|
readonly property real scaling: modelData ? ScalingService.scale(modelData) : 1
|
||||||
readonly property real itemSize: 32 * scaling
|
readonly property real itemSize: 32 * scaling
|
||||||
|
|
||||||
// Always visible when there are toplevels
|
// Always visible when there are toplevels
|
||||||
|
|
@ -44,12 +46,7 @@ Rectangle {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: root.itemSize * 0.75
|
width: root.itemSize * 0.75
|
||||||
height: root.itemSize * 0.75
|
height: root.itemSize * 0.75
|
||||||
color: {
|
color: taskbarItem.isActive ? Color.mPrimary : root.color
|
||||||
if (taskbarItem.isActive) {
|
|
||||||
return Color.mPrimary
|
|
||||||
}
|
|
||||||
return root.color
|
|
||||||
}
|
|
||||||
border.width: 0
|
border.width: 0
|
||||||
border.color: "transparent"
|
border.color: "transparent"
|
||||||
z: -1
|
z: -1
|
||||||
|
|
@ -78,13 +75,13 @@ Rectangle {
|
||||||
try {
|
try {
|
||||||
taskbarItem.modelData.activate()
|
taskbarItem.modelData.activate()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.log("Taskbar", "Failed to activate toplevel: " + error)
|
Logger.error("Taskbar", "Failed to activate toplevel: " + error)
|
||||||
}
|
}
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
try {
|
try {
|
||||||
taskbarItem.modelData.close()
|
taskbarItem.modelData.close()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.log("Taskbar", "Failed to close toplevel: " + error)
|
Logger.error("Taskbar", "Failed to close toplevel: " + error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue