mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 21:45:38 -05:00
make screen to popouts for positioning data
This commit is contained in:
@@ -17,7 +17,8 @@ PanelWindow {
|
|||||||
property real triggerX: Theme.spacingL
|
property real triggerX: Theme.spacingL
|
||||||
property real triggerY: Theme.barHeight + Theme.spacingXS
|
property real triggerY: Theme.barHeight + Theme.spacingXS
|
||||||
property real triggerWidth: 40
|
property real triggerWidth: 40
|
||||||
property string triggerSection: "left" // "left", "center", "right"
|
property string triggerSection: "left"
|
||||||
|
property var triggerScreen: null
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
appDrawerPopout.isVisible = true;
|
appDrawerPopout.isVisible = true;
|
||||||
@@ -35,11 +36,12 @@ PanelWindow {
|
|||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section) {
|
function setTriggerPosition(x, y, width, section, screen) {
|
||||||
triggerX = x;
|
triggerX = x;
|
||||||
triggerY = y;
|
triggerY = y;
|
||||||
triggerWidth = width;
|
triggerWidth = width;
|
||||||
triggerSection = section;
|
triggerSection = section;
|
||||||
|
triggerScreen = screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
@@ -48,6 +50,7 @@ PanelWindow {
|
|||||||
WlrLayershell.namespace: "quickshell-launcher"
|
WlrLayershell.namespace: "quickshell-launcher"
|
||||||
visible: isVisible
|
visible: isVisible
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
screen: triggerScreen || Screen
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: true
|
||||||
@@ -83,10 +86,11 @@ PanelWindow {
|
|||||||
|
|
||||||
readonly property real popupWidth: 520
|
readonly property real popupWidth: 520
|
||||||
readonly property real popupHeight: 600
|
readonly property real popupHeight: 600
|
||||||
readonly property real screenWidth: Screen.width
|
readonly property real screenWidth: appDrawerPopout.screen ? appDrawerPopout.screen.width : Screen.width
|
||||||
readonly property real screenHeight: Screen.height
|
readonly property real screenHeight: appDrawerPopout.screen ? appDrawerPopout.screen.height : Screen.height
|
||||||
readonly property real calculatedX: {
|
readonly property real calculatedX: {
|
||||||
var centerX = appDrawerPopout.triggerX + (appDrawerPopout.triggerWidth / 2) - (popupWidth / 2);
|
var centerX = appDrawerPopout.triggerX + (appDrawerPopout.triggerWidth / 2) - (popupWidth / 2);
|
||||||
|
|
||||||
if (centerX >= Theme.spacingM && centerX + popupWidth <= screenWidth - Theme.spacingM)
|
if (centerX >= Theme.spacingM && centerX + popupWidth <= screenWidth - Theme.spacingM)
|
||||||
return centerX;
|
return centerX;
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,18 @@ PanelWindow {
|
|||||||
property real triggerY: Theme.barHeight + 4
|
property real triggerY: Theme.barHeight + 4
|
||||||
property real triggerWidth: 80
|
property real triggerWidth: 80
|
||||||
property string triggerSection: "center"
|
property string triggerSection: "center"
|
||||||
|
property var triggerScreen: null
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section) {
|
function setTriggerPosition(x, y, width, section, screen) {
|
||||||
triggerX = x;
|
triggerX = x;
|
||||||
triggerY = y;
|
triggerY = y;
|
||||||
triggerWidth = width;
|
triggerWidth = width;
|
||||||
triggerSection = section;
|
triggerSection = section;
|
||||||
|
triggerScreen = screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: internalVisible
|
visible: internalVisible
|
||||||
|
screen: triggerScreen || Screen
|
||||||
onCalendarVisibleChanged: {
|
onCalendarVisibleChanged: {
|
||||||
if (calendarVisible) {
|
if (calendarVisible) {
|
||||||
internalVisible = true;
|
internalVisible = true;
|
||||||
@@ -61,7 +64,7 @@ PanelWindow {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: mainContainer
|
id: mainContainer
|
||||||
|
|
||||||
readonly property real targetWidth: Math.min(Screen.width * 0.9, 600)
|
readonly property real targetWidth: Math.min((root.screen ? root.screen.width : Screen.width) * 0.9, 600)
|
||||||
|
|
||||||
function calculateWidth() {
|
function calculateWidth() {
|
||||||
let baseWidth = 320;
|
let baseWidth = 320;
|
||||||
@@ -89,15 +92,14 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property real calculatedX: {
|
readonly property real calculatedX: {
|
||||||
// For center widgets, always center the popup on screen
|
var screenWidth = root.screen ? root.screen.width : Screen.width;
|
||||||
if (root.triggerSection === "center") {
|
if (root.triggerSection === "center") {
|
||||||
return (Screen.width - targetWidth) / 2;
|
return (screenWidth - targetWidth) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For non-center widgets, use the original logic
|
|
||||||
var centerX = root.triggerX + (root.triggerWidth / 2) - (targetWidth / 2);
|
var centerX = root.triggerX + (root.triggerWidth / 2) - (targetWidth / 2);
|
||||||
|
|
||||||
if (centerX >= Theme.spacingM && centerX + targetWidth <= Screen.width - Theme.spacingM) {
|
if (centerX >= Theme.spacingM && centerX + targetWidth <= screenWidth - Theme.spacingM) {
|
||||||
return centerX;
|
return centerX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,8 +107,8 @@ PanelWindow {
|
|||||||
return Theme.spacingM;
|
return Theme.spacingM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (centerX + targetWidth > Screen.width - Theme.spacingM) {
|
if (centerX + targetWidth > screenWidth - Theme.spacingM) {
|
||||||
return Screen.width - targetWidth - Theme.spacingM;
|
return screenWidth - targetWidth - Theme.spacingM;
|
||||||
}
|
}
|
||||||
|
|
||||||
return centerX;
|
return centerX;
|
||||||
|
|||||||
@@ -15,13 +15,15 @@ PanelWindow {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool controlCenterVisible: false
|
property bool controlCenterVisible: false
|
||||||
property string currentTab: "network" // "network", "audio", "bluetooth", "display"
|
property string currentTab: "network"
|
||||||
property bool powerOptionsExpanded: false
|
property bool powerOptionsExpanded: false
|
||||||
|
property var triggerScreen: null
|
||||||
|
|
||||||
signal powerActionRequested(string action, string title, string message)
|
signal powerActionRequested(string action, string title, string message)
|
||||||
signal lockRequested()
|
signal lockRequested()
|
||||||
|
|
||||||
visible: controlCenterVisible
|
visible: controlCenterVisible
|
||||||
|
screen: triggerScreen || Screen
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
NetworkService.autoRefreshEnabled = visible && NetworkService.wifiEnabled;
|
NetworkService.autoRefreshEnabled = visible && NetworkService.wifiEnabled;
|
||||||
if (!visible && BluetoothService.adapter && BluetoothService.adapter.discovering)
|
if (!visible && BluetoothService.adapter && BluetoothService.adapter.discovering)
|
||||||
@@ -48,14 +50,14 @@ PanelWindow {
|
|||||||
Loader {
|
Loader {
|
||||||
id: contentLoader
|
id: contentLoader
|
||||||
|
|
||||||
readonly property real targetWidth: Math.min(600, Screen.width - Theme.spacingL * 2)
|
readonly property real targetWidth: Math.min(600, (root.screen ? root.screen.width : Screen.width) - Theme.spacingL * 2)
|
||||||
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
active: controlCenterVisible
|
active: controlCenterVisible
|
||||||
width: targetWidth
|
width: targetWidth
|
||||||
height: root.powerOptionsExpanded ? 570 : 500
|
height: root.powerOptionsExpanded ? 570 : 500
|
||||||
y: Theme.barHeight + Theme.spacingXS
|
y: Theme.barHeight + Theme.spacingXS
|
||||||
x: Math.max(Theme.spacingL, Screen.width - targetWidth - Theme.spacingL)
|
x: Math.max(Theme.spacingL, (root.screen ? root.screen.width : Screen.width) - targetWidth - Theme.spacingL)
|
||||||
opacity: controlCenterVisible ? 1 : 0
|
opacity: controlCenterVisible ? 1 : 0
|
||||||
scale: controlCenterVisible ? 1 : 0.9
|
scale: controlCenterVisible ? 1 : 0.9
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,14 @@ PanelWindow {
|
|||||||
property real triggerY: Theme.barHeight + Theme.spacingXS
|
property real triggerY: Theme.barHeight + Theme.spacingXS
|
||||||
property real triggerWidth: 55
|
property real triggerWidth: 55
|
||||||
property string triggerSection: "right"
|
property string triggerSection: "right"
|
||||||
|
property var triggerScreen: null
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section) {
|
function setTriggerPosition(x, y, width, section, screen) {
|
||||||
triggerX = x;
|
triggerX = x;
|
||||||
triggerY = y;
|
triggerY = y;
|
||||||
triggerWidth = width;
|
triggerWidth = width;
|
||||||
triggerSection = section;
|
triggerSection = section;
|
||||||
|
triggerScreen = screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide() {
|
function hide() {
|
||||||
@@ -47,6 +49,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
visible: isVisible
|
visible: isVisible
|
||||||
|
screen: triggerScreen || Screen
|
||||||
implicitWidth: 600
|
implicitWidth: 600
|
||||||
implicitHeight: 600
|
implicitHeight: 600
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
@@ -78,12 +81,14 @@ PanelWindow {
|
|||||||
Loader {
|
Loader {
|
||||||
id: contentLoader
|
id: contentLoader
|
||||||
|
|
||||||
readonly property real targetWidth: Math.min(600, Screen.width - Theme.spacingL * 2)
|
readonly property real screenWidth: processListPopout.screen ? processListPopout.screen.width : Screen.width
|
||||||
readonly property real targetHeight: Math.min(600, Screen.height - Theme.barHeight - Theme.spacingS * 2)
|
readonly property real screenHeight: processListPopout.screen ? processListPopout.screen.height : Screen.height
|
||||||
|
readonly property real targetWidth: Math.min(600, screenWidth - Theme.spacingL * 2)
|
||||||
|
readonly property real targetHeight: Math.min(600, screenHeight - Theme.barHeight - Theme.spacingS * 2)
|
||||||
readonly property real calculatedX: {
|
readonly property real calculatedX: {
|
||||||
var centerX = processListPopout.triggerX + (processListPopout.triggerWidth / 2) - (targetWidth / 2);
|
var centerX = processListPopout.triggerX + (processListPopout.triggerWidth / 2) - (targetWidth / 2);
|
||||||
|
|
||||||
if (centerX >= Theme.spacingM && centerX + targetWidth <= Screen.width - Theme.spacingM) {
|
if (centerX >= Theme.spacingM && centerX + targetWidth <= screenWidth - Theme.spacingM) {
|
||||||
return centerX;
|
return centerX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,8 +96,8 @@ PanelWindow {
|
|||||||
return Theme.spacingM;
|
return Theme.spacingM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (centerX + targetWidth > Screen.width - Theme.spacingM) {
|
if (centerX + targetWidth > screenWidth - Theme.spacingM) {
|
||||||
return Screen.width - targetWidth - Theme.spacingM;
|
return screenWidth - targetWidth - Theme.spacingM;
|
||||||
}
|
}
|
||||||
|
|
||||||
return centerX;
|
return centerX;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Rectangle {
|
|||||||
property bool batteryPopupVisible: false
|
property bool batteryPopupVisible: false
|
||||||
property string section: "right"
|
property string section: "right"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
|
property var parentScreen: null
|
||||||
|
|
||||||
signal toggleBatteryPopup()
|
signal toggleBatteryPopup()
|
||||||
|
|
||||||
@@ -96,8 +97,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (popupTarget && popupTarget.setTriggerPosition) {
|
if (popupTarget && popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = parentScreen || Screen;
|
||||||
popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, width, section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
|
||||||
}
|
}
|
||||||
toggleBatteryPopup();
|
toggleBatteryPopup();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,12 +16,14 @@ PanelWindow {
|
|||||||
property real triggerY: Theme.barHeight + Theme.spacingS
|
property real triggerY: Theme.barHeight + Theme.spacingS
|
||||||
property real triggerWidth: 70
|
property real triggerWidth: 70
|
||||||
property string triggerSection: "right"
|
property string triggerSection: "right"
|
||||||
|
property var triggerScreen: null
|
||||||
|
|
||||||
function setTriggerPosition(x, y, width, section) {
|
function setTriggerPosition(x, y, width, section, screen) {
|
||||||
triggerX = x;
|
triggerX = x;
|
||||||
triggerY = y;
|
triggerY = y;
|
||||||
triggerWidth = width;
|
triggerWidth = width;
|
||||||
triggerSection = section;
|
triggerSection = section;
|
||||||
|
triggerScreen = screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isActiveProfile(profile) {
|
function isActiveProfile(profile) {
|
||||||
@@ -43,6 +45,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
visible: batteryPopupVisible
|
visible: batteryPopupVisible
|
||||||
|
screen: triggerScreen || Screen
|
||||||
implicitWidth: 400
|
implicitWidth: 400
|
||||||
implicitHeight: 300
|
implicitHeight: 300
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
@@ -70,12 +73,14 @@ PanelWindow {
|
|||||||
Loader {
|
Loader {
|
||||||
id: contentLoader
|
id: contentLoader
|
||||||
|
|
||||||
readonly property real targetWidth: Math.min(380, Screen.width - Theme.spacingL * 2)
|
readonly property real screenWidth: root.screen ? root.screen.width : Screen.width
|
||||||
readonly property real targetHeight: Math.min(450, Screen.height - Theme.barHeight - Theme.spacingS * 2)
|
readonly property real screenHeight: root.screen ? root.screen.height : Screen.height
|
||||||
|
readonly property real targetWidth: Math.min(380, screenWidth - Theme.spacingL * 2)
|
||||||
|
readonly property real targetHeight: Math.min(450, screenHeight - Theme.barHeight - Theme.spacingS * 2)
|
||||||
readonly property real calculatedX: {
|
readonly property real calculatedX: {
|
||||||
var centerX = root.triggerX + (root.triggerWidth / 2) - (targetWidth / 2);
|
var centerX = root.triggerX + (root.triggerWidth / 2) - (targetWidth / 2);
|
||||||
|
|
||||||
if (centerX >= Theme.spacingM && centerX + targetWidth <= Screen.width - Theme.spacingM) {
|
if (centerX >= Theme.spacingM && centerX + targetWidth <= screenWidth - Theme.spacingM) {
|
||||||
return centerX;
|
return centerX;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,8 +88,8 @@ PanelWindow {
|
|||||||
return Theme.spacingM;
|
return Theme.spacingM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (centerX + targetWidth > Screen.width - Theme.spacingM) {
|
if (centerX + targetWidth > screenWidth - Theme.spacingM) {
|
||||||
return Screen.width - targetWidth - Theme.spacingM;
|
return screenWidth - targetWidth - Theme.spacingM;
|
||||||
}
|
}
|
||||||
|
|
||||||
return centerX;
|
return centerX;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Rectangle {
|
|||||||
property bool compactMode: false
|
property bool compactMode: false
|
||||||
property string section: "center"
|
property string section: "center"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
|
property var parentScreen: null
|
||||||
|
|
||||||
signal clockClicked()
|
signal clockClicked()
|
||||||
|
|
||||||
@@ -71,8 +72,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (popupTarget && popupTarget.setTriggerPosition) {
|
if (popupTarget && popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = parentScreen || Screen;
|
||||||
popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, width, section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clockClicked();
|
root.clockClicked();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Rectangle {
|
|||||||
property var toggleProcessList
|
property var toggleProcessList
|
||||||
property string section: "right"
|
property string section: "right"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
|
property var parentScreen: null
|
||||||
|
|
||||||
width: 55
|
width: 55
|
||||||
height: 30
|
height: 30
|
||||||
@@ -36,8 +37,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (popupTarget && popupTarget.setTriggerPosition) {
|
if (popupTarget && popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = parentScreen || Screen;
|
||||||
popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, width, section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
|
||||||
}
|
}
|
||||||
SysMonitorService.setSortBy("cpu");
|
SysMonitorService.setSortBy("cpu");
|
||||||
if (root.toggleProcessList)
|
if (root.toggleProcessList)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Rectangle {
|
|||||||
property bool isActive: false
|
property bool isActive: false
|
||||||
property string section: "left" // Which section this button is in
|
property string section: "left" // Which section this button is in
|
||||||
property var popupTarget: null // Reference to the popup to position
|
property var popupTarget: null // Reference to the popup to position
|
||||||
|
property var parentScreen: null // The screen this button is on
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
@@ -47,8 +48,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (popupTarget && popupTarget.setTriggerPosition) {
|
if (popupTarget && popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = parentScreen || Screen;
|
||||||
popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, width, section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ Rectangle {
|
|||||||
readonly property int compactContentWidth: Math.min(120, baseContentWidth)
|
readonly property int compactContentWidth: Math.min(120, baseContentWidth)
|
||||||
property string section: "center"
|
property string section: "center"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
|
property var parentScreen: null
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
@@ -132,8 +133,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.popupTarget && root.popupTarget.setTriggerPosition) {
|
if (root.popupTarget && root.popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = root.parentScreen || Screen;
|
||||||
root.popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, root.width, root.section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
root.popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, root.width, root.section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Rectangle {
|
|||||||
property bool isActive: false
|
property bool isActive: false
|
||||||
property string section: "right"
|
property string section: "right"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
|
property var parentScreen: null
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
@@ -48,8 +49,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (popupTarget && popupTarget.setTriggerPosition) {
|
if (popupTarget && popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = parentScreen || Screen;
|
||||||
popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, width, section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Rectangle {
|
|||||||
property var toggleProcessList
|
property var toggleProcessList
|
||||||
property string section: "right"
|
property string section: "right"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
|
property var parentScreen: null
|
||||||
|
|
||||||
width: 55
|
width: 55
|
||||||
height: 30
|
height: 30
|
||||||
@@ -36,8 +37,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (popupTarget && popupTarget.setTriggerPosition) {
|
if (popupTarget && popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = parentScreen || Screen;
|
||||||
popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, width, section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
|
||||||
}
|
}
|
||||||
SysMonitorService.setSortBy("memory");
|
SysMonitorService.setSortBy("memory");
|
||||||
if (root.toggleProcessList)
|
if (root.toggleProcessList)
|
||||||
|
|||||||
@@ -447,6 +447,7 @@ PanelWindow {
|
|||||||
return "left"; // default fallback
|
return "left"; // default fallback
|
||||||
}
|
}
|
||||||
popupTarget: appDrawerPopout
|
popupTarget: appDrawerPopout
|
||||||
|
parentScreen: root.screen
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (appDrawerPopout)
|
if (appDrawerPopout)
|
||||||
appDrawerPopout.toggle();
|
appDrawerPopout.toggle();
|
||||||
@@ -486,6 +487,7 @@ PanelWindow {
|
|||||||
return "center";
|
return "center";
|
||||||
}
|
}
|
||||||
popupTarget: centcomPopout
|
popupTarget: centcomPopout
|
||||||
|
parentScreen: root.screen
|
||||||
onClockClicked: {
|
onClockClicked: {
|
||||||
centcomPopout.calendarVisible = !centcomPopout.calendarVisible;
|
centcomPopout.calendarVisible = !centcomPopout.calendarVisible;
|
||||||
}
|
}
|
||||||
@@ -505,6 +507,7 @@ PanelWindow {
|
|||||||
return "center";
|
return "center";
|
||||||
}
|
}
|
||||||
popupTarget: centcomPopout
|
popupTarget: centcomPopout
|
||||||
|
parentScreen: root.screen
|
||||||
onClicked: {
|
onClicked: {
|
||||||
centcomPopout.calendarVisible = !centcomPopout.calendarVisible;
|
centcomPopout.calendarVisible = !centcomPopout.calendarVisible;
|
||||||
}
|
}
|
||||||
@@ -523,6 +526,7 @@ PanelWindow {
|
|||||||
return "center";
|
return "center";
|
||||||
}
|
}
|
||||||
popupTarget: centcomPopout
|
popupTarget: centcomPopout
|
||||||
|
parentScreen: root.screen
|
||||||
onClicked: {
|
onClicked: {
|
||||||
centcomPopout.calendarVisible = !centcomPopout.calendarVisible;
|
centcomPopout.calendarVisible = !centcomPopout.calendarVisible;
|
||||||
}
|
}
|
||||||
@@ -604,6 +608,7 @@ PanelWindow {
|
|||||||
return "right";
|
return "right";
|
||||||
}
|
}
|
||||||
popupTarget: processListPopout
|
popupTarget: processListPopout
|
||||||
|
parentScreen: root.screen
|
||||||
toggleProcessList: () => {
|
toggleProcessList: () => {
|
||||||
return processListPopout.toggle();
|
return processListPopout.toggle();
|
||||||
}
|
}
|
||||||
@@ -617,6 +622,7 @@ PanelWindow {
|
|||||||
return "right";
|
return "right";
|
||||||
}
|
}
|
||||||
popupTarget: processListPopout
|
popupTarget: processListPopout
|
||||||
|
parentScreen: root.screen
|
||||||
toggleProcessList: () => {
|
toggleProcessList: () => {
|
||||||
return processListPopout.toggle();
|
return processListPopout.toggle();
|
||||||
}
|
}
|
||||||
@@ -639,6 +645,7 @@ PanelWindow {
|
|||||||
return "right";
|
return "right";
|
||||||
}
|
}
|
||||||
popupTarget: notificationCenter
|
popupTarget: notificationCenter
|
||||||
|
parentScreen: root.screen
|
||||||
onClicked: {
|
onClicked: {
|
||||||
notificationCenter.notificationHistoryVisible = !notificationCenter.notificationHistoryVisible;
|
notificationCenter.notificationHistoryVisible = !notificationCenter.notificationHistoryVisible;
|
||||||
}
|
}
|
||||||
@@ -658,6 +665,7 @@ PanelWindow {
|
|||||||
return "right";
|
return "right";
|
||||||
}
|
}
|
||||||
popupTarget: batteryPopout
|
popupTarget: batteryPopout
|
||||||
|
parentScreen: root.screen
|
||||||
onToggleBatteryPopup: {
|
onToggleBatteryPopup: {
|
||||||
batteryPopout.batteryPopupVisible = !batteryPopout.batteryPopupVisible;
|
batteryPopout.batteryPopupVisible = !batteryPopout.batteryPopupVisible;
|
||||||
}
|
}
|
||||||
@@ -671,6 +679,7 @@ PanelWindow {
|
|||||||
ControlCenterButton {
|
ControlCenterButton {
|
||||||
isActive: controlCenterPopout.controlCenterVisible
|
isActive: controlCenterPopout.controlCenterVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
controlCenterPopout.triggerScreen = root.screen;
|
||||||
controlCenterPopout.controlCenterVisible = !controlCenterPopout.controlCenterVisible;
|
controlCenterPopout.controlCenterVisible = !controlCenterPopout.controlCenterVisible;
|
||||||
if (controlCenterPopout.controlCenterVisible) {
|
if (controlCenterPopout.controlCenterVisible) {
|
||||||
if (NetworkService.wifiEnabled)
|
if (NetworkService.wifiEnabled)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Rectangle {
|
|||||||
|
|
||||||
property string section: "center"
|
property string section: "center"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
|
property var parentScreen: null
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
@@ -55,8 +56,10 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if (popupTarget && popupTarget.setTriggerPosition) {
|
if (popupTarget && popupTarget.setTriggerPosition) {
|
||||||
var globalPos = mapToGlobal(0, 0);
|
var globalPos = mapToGlobal(0, 0);
|
||||||
var screenRelativeX = globalPos.x >= Screen.width ? globalPos.x % Screen.width : globalPos.x;
|
var currentScreen = parentScreen || Screen;
|
||||||
popupTarget.setTriggerPosition(screenRelativeX, Theme.barHeight + Theme.spacingXS, width, section);
|
var screenX = currentScreen.x || 0;
|
||||||
|
var relativeX = globalPos.x - screenX;
|
||||||
|
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user