addet activate linux on clicking the 'linux' icon
This commit is contained in:
parent
fd04b21188
commit
2a2b769aa9
3 changed files with 76 additions and 75 deletions
|
@ -1,70 +0,0 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
|
||||
ShellRoot {
|
||||
// Add a property to control activation widget visibility
|
||||
property bool isActivationWidgetVisible: false
|
||||
|
||||
Variants {
|
||||
// Create the panel once on each monitor.
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
id: w
|
||||
|
||||
property var modelData
|
||||
screen: modelData
|
||||
|
||||
anchors {
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
margins {
|
||||
right: 50
|
||||
bottom: 50
|
||||
}
|
||||
|
||||
implicitWidth: content.width
|
||||
implicitHeight: content.height
|
||||
|
||||
color: "transparent"
|
||||
|
||||
// Give the window an empty click mask so all clicks pass through it.
|
||||
mask: Region {}
|
||||
|
||||
// Use the wlroots specific layer property to ensure it displays over
|
||||
// fullscreen windows.
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
// Only show when isActivationWidgetVisible is true
|
||||
visible: root.isActivationWidgetVisible
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
Text {
|
||||
text: "Activate Linux"
|
||||
color: "#50ffffff"
|
||||
font.pointSize: 22
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Go to Settings to activate Linux"
|
||||
color: "#50ffffff"
|
||||
font.pointSize: 14
|
||||
}
|
||||
}
|
||||
|
||||
// Add a click handler to close the widget
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
root.isActivationWidgetVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
68
modules/activation/ActivationWidget.qml
Normal file
68
modules/activation/ActivationWidget.qml
Normal file
|
@ -0,0 +1,68 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
required property ShellScreen screen
|
||||
|
||||
PanelWindow {
|
||||
id: window
|
||||
|
||||
anchors {
|
||||
right: true
|
||||
bottom: true
|
||||
}
|
||||
|
||||
margins {
|
||||
right: 50
|
||||
bottom: 50
|
||||
}
|
||||
|
||||
implicitWidth: content.width
|
||||
implicitHeight: content.height
|
||||
|
||||
color: "transparent"
|
||||
mask: Region {}
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
|
||||
visible: false
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
Text {
|
||||
text: "Activate Linux"
|
||||
color: "#50ffffff"
|
||||
font.pointSize: 22
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Go to Settings to activate Linux"
|
||||
color: "#50ffffff"
|
||||
font.pointSize: 14
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
window.visible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function show() {
|
||||
window.visible = true
|
||||
}
|
||||
|
||||
function hide() {
|
||||
window.visible = false
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
window.visible = !window.visible
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ import "root:/widgets"
|
|||
import "root:/services"
|
||||
import "root:/config"
|
||||
import "root:/modules/bar/popouts" as BarPopouts
|
||||
import "root:/modules/activation" as Activation
|
||||
import "components"
|
||||
import "components/workspaces"
|
||||
import Quickshell
|
||||
|
@ -13,6 +14,12 @@ Item {
|
|||
required property ShellScreen screen
|
||||
required property BarPopouts.Wrapper popouts
|
||||
|
||||
// Create an instance of the activation widget
|
||||
Activation.ActivationWidget {
|
||||
id: activationWidget
|
||||
screen: root.screen
|
||||
}
|
||||
|
||||
function checkPopout(y: real): void {
|
||||
const spacing = Appearance.spacing.small;
|
||||
const aw = activeWindow.child;
|
||||
|
@ -91,11 +98,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
// Toggle the activation widget visibility
|
||||
const v = Visibilities.screens[QsWindow.window.screen];
|
||||
if (v) {
|
||||
v.isActivationWidgetVisible = !v.isActivationWidgetVisible;
|
||||
}
|
||||
activationWidget.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue