progress
This commit is contained in:
parent
1a27b905bf
commit
334bca71fe
17 changed files with 733 additions and 117 deletions
49
services/Hover.qml
Normal file
49
services/Hover.qml
Normal file
|
@ -0,0 +1,49 @@
|
|||
import Quickshell
|
||||
import QtQuick
|
||||
import "../config"
|
||||
|
||||
MouseArea {
|
||||
id: root
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
required property ShellScreen screen
|
||||
// required property Panels panels
|
||||
required property Item bar
|
||||
|
||||
property bool showVolumeMenu: false
|
||||
property bool isInRightPanel: false
|
||||
|
||||
// function withinPanelHeight(panel: Item, x: real, y: real): bool {
|
||||
// const panelY = Config.border.thickness + panel.y;
|
||||
// return y >= panelY - Config.border.rounding && y <= panelY + panel.height + Config.border.rounding;
|
||||
// }
|
||||
|
||||
// function inLeftBorder(x: real, y: real): bool {
|
||||
// return x <= Config.border.thickness;
|
||||
// }
|
||||
|
||||
function inRightPanel(x: real, y: real): bool {
|
||||
// Cursor is in middle veritcal third of screen
|
||||
// Cursor is in the right border
|
||||
return y >= root.screen.height / 3 && y <= (root.screen.height / 3) * 2 && x >= root.screen.width - Config.border.thickness;
|
||||
}
|
||||
|
||||
// Update on mouse cursor movement
|
||||
onPositionChanged: event => {
|
||||
const x = event.x;
|
||||
const y = event.y;
|
||||
|
||||
root.isInRightPanel = inRightPanel(x, y);
|
||||
|
||||
console.log("In right panel: " + root.isInRightPanel);
|
||||
|
||||
console.log("x:" + x + " y: " + y);
|
||||
}
|
||||
onContainsMouseChanged: {
|
||||
if (!containsMouse) {
|
||||
root.isInRightPanel = false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,42 +1,20 @@
|
|||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Services.Notifications
|
||||
|
||||
/**
|
||||
* Provides extra features not in Quickshell.Services.Notifications:
|
||||
* - Persistent storage
|
||||
* - Popup notifications, with timeout
|
||||
* - Notification groups by app
|
||||
*/
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property list<Notif> list: []
|
||||
readonly property list<Notif> popups: list.filter(n => n.popup)
|
||||
|
||||
NotificationServer {
|
||||
id: server
|
||||
|
||||
keepOnReload: false
|
||||
|
||||
onNotification: notif => {
|
||||
notif.tracked = true;
|
||||
|
||||
root.list.push(notifComp.createObject(root, {
|
||||
popup: true,
|
||||
notification: notif
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
component Notif: QtObject {
|
||||
property bool popup
|
||||
readonly property date time: new Date()
|
||||
|
||||
required property Notification notification
|
||||
readonly property string summary: notification.summary
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notifComp
|
||||
|
||||
Notif {}
|
||||
}
|
||||
id: root
|
||||
NotificationServer {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ Singleton {
|
|||
var event = JSON.parse(data);
|
||||
let workspaces = [];
|
||||
if (event.WorkspacesChanged) {
|
||||
root.workspaces = event.WorkspacesChanged.workspaces.filter(w => w.name);
|
||||
root.workspaces = event.WorkspacesChanged.workspaces;
|
||||
root.workspaces = root.workspaces.sort((a, b) => a.id - b.id);
|
||||
root.activeWorkspaceIndex = root.workspaces.findIndex(w => w.is_focused);
|
||||
if (root.activeWorkspaceIndex < 0) {
|
||||
|
@ -68,6 +68,15 @@ Singleton {
|
|||
}
|
||||
}
|
||||
}
|
||||
// component Workspace: QtObject {
|
||||
// required property int id
|
||||
// property int idx
|
||||
// property string name: "VOID"
|
||||
// required property string output
|
||||
// property bool is_active
|
||||
// property bool is_focused
|
||||
// property int active_window_id
|
||||
// }
|
||||
}
|
||||
|
||||
// {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue