-
Notifications
You must be signed in to change notification settings - Fork 16
onscreen keyboard #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is it called Notification.qml ? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| import Quickshell | ||
| import Quickshell.Io | ||
| import QtQuick | ||
|
|
||
| ShellRoot { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're creating a new shell instead of a shell element. Take inspiration on the dashboard to see how to make panels.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for providing your valued guidance. I truly appreciate these remarks of yours. |
||
| // Get the directory where this QML file is located | ||
| readonly property string configDir: Qt.resolvedUrl(".").toString().replace("file://", "") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why asking where you currently are ? |
||
|
|
||
| PanelWindow { | ||
| id: buttonPanel | ||
|
|
||
| // **FIX:** Set the width and height of the PanelWindow | ||
| // to be exactly the same as its child (the pillButton). | ||
| // This stops the invisible PanelWindow from blocking clicks | ||
| // in a larger area than intended. | ||
| width: pillButton.width | ||
| height: pillButton.height | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok so if I understand, you did a shell above the shell to put a floating button to open the keyboard ? You should have made a RippleButton on the bar to call a PanelWindow. |
||
|
|
||
| // Position at top-left of current monitor | ||
| anchors { | ||
| top: true | ||
| left: true | ||
| } | ||
| margins { | ||
| top: -35 | ||
| left: 25 | ||
| } | ||
|
|
||
| // Make the panel itself transparent | ||
| color: "transparent" | ||
|
|
||
| Rectangle { | ||
| id: pillButton | ||
|
|
||
| // Position with margin inside the panel | ||
| anchors { | ||
| top: parent.top | ||
| left: parent.left | ||
| } | ||
|
|
||
| // Pill dimensions | ||
| width: 70 | ||
| height: 30 | ||
| radius: 30 | ||
|
|
||
| // Toggle between transparent and solid | ||
| color: isActive ? "#004F57" : "transparent" | ||
|
|
||
| // Track active state | ||
| property bool isActive: false | ||
|
|
||
| // The image inside | ||
| Image { | ||
| id: icon | ||
| anchors.centerIn: parent | ||
| source: configDir + "/icon.png" | ||
| width: 34 | ||
| height: 34 | ||
| } | ||
|
|
||
| // Click handler | ||
| MouseArea { | ||
| anchors.fill: parent | ||
| cursorShape: Qt.PointingHandCursor | ||
|
|
||
| onClicked: { | ||
| // Toggle the active state | ||
| pillButton.isActive = !pillButton.isActive | ||
| console.log("Button clicked! Active state:", pillButton.isActive) | ||
|
|
||
| // Always run close first | ||
| processRunner.shouldRunOpen = pillButton.isActive | ||
| processRunner.runClose() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Process runner | ||
| Item { | ||
| id: processRunner | ||
| property bool shouldRunOpen: false | ||
|
|
||
| function runClose() { | ||
| console.log("Running close...") | ||
| var closeProc = closeComponent.createObject(processRunner) | ||
| closeProc.running = true | ||
| } | ||
|
|
||
| function runOpen() { | ||
| console.log("Running open...") | ||
| var openProc = openComponent.createObject(processRunner) | ||
| openProc.running = true | ||
| } | ||
| } | ||
|
|
||
| // Close process component | ||
| Component { | ||
| id: closeComponent | ||
| Process { | ||
| command: ["sh", "-c", configDir + "/close"] | ||
|
|
||
| onExited: { | ||
| console.log("Close exited with code:", exitCode) | ||
|
|
||
| // If button is active, run open after close finishes | ||
| if (processRunner.shouldRunOpen) { | ||
| processRunner.runOpen() | ||
| } | ||
|
|
||
| destroy() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Open process component | ||
| Component { | ||
| id: openComponent | ||
| Process { | ||
| command: ["sh", "-c", configDir + "/open"] | ||
|
|
||
| onExited: { | ||
| console.log("Open exited with code:", exitCode) | ||
| destroy() | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a QS module, I don't understand why a script is necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize for my ignorance and naivete.
The shell script detects multiple monitors and executes "quickshell -q [QML FILE]" but I infer from your comment that it is not the proper way of doing things.
Thank you for making me aware, I will certainly work on it to make the necessary changes.