Merge branch 'rebuild' of https://github.com/Ly-sec/Noctalia into rebuild
This commit is contained in:
commit
2629b4707d
3 changed files with 109 additions and 104 deletions
|
|
@ -74,23 +74,21 @@ Row {
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mouse area for hover detection
|
// Mouse area for hover detection
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: titleContainerMouseArea
|
id: titleContainerMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.IBeamCursor
|
cursorShape: Qt.IBeamCursor
|
||||||
onEntered: {
|
onEntered: {
|
||||||
titleText.text = getDisplayText()
|
titleText.text = getDisplayText()
|
||||||
}
|
|
||||||
onExited: {
|
|
||||||
titleText.text = getDisplayText()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
onExited: {
|
||||||
|
titleText.text = getDisplayText()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getDisplayText() {
|
function getDisplayText() {
|
||||||
// Check if Niri service is available
|
// Check if Niri service is available
|
||||||
if (typeof Niri === "undefined") {
|
if (typeof Niri === "undefined") {
|
||||||
|
|
@ -98,9 +96,8 @@ Row {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the focused window data
|
// Get the focused window data
|
||||||
const focusedWindow = Niri.focusedWindowIndex >= 0 && Niri.focusedWindowIndex < Niri.windows.length
|
const focusedWindow = Niri.focusedWindowIndex >= 0
|
||||||
? Niri.windows[Niri.focusedWindowIndex]
|
&& Niri.focusedWindowIndex < Niri.windows.length ? Niri.windows[Niri.focusedWindowIndex] : null
|
||||||
: null
|
|
||||||
|
|
||||||
if (!focusedWindow) {
|
if (!focusedWindow) {
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@ ColumnLayout {
|
||||||
var component = Qt.createComponent("SchemeFileView.qml")
|
var component = Qt.createComponent("SchemeFileView.qml")
|
||||||
if (component.status === Component.Ready) {
|
if (component.status === Component.Ready) {
|
||||||
var fileView = component.createObject(root, {
|
var fileView = component.createObject(root, {
|
||||||
"path": schemePath,
|
"path": schemePath,
|
||||||
"schemeName": schemeName
|
"schemeName": schemeName
|
||||||
})
|
})
|
||||||
fileViews.push(fileView)
|
fileViews.push(fileView)
|
||||||
} else {
|
} else {
|
||||||
// Fallback: create inline FileView
|
// Fallback: create inline FileView
|
||||||
|
|
@ -72,23 +72,23 @@ ColumnLayout {
|
||||||
|
|
||||||
function createInlineFileView(schemePath, schemeName) {
|
function createInlineFileView(schemePath, schemeName) {
|
||||||
var fileViewQml = `
|
var fileViewQml = `
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
property string schemeName: "${schemeName}"
|
property string schemeName: "${schemeName}"
|
||||||
path: "${schemePath}"
|
path: "${schemePath}"
|
||||||
blockLoading: true
|
blockLoading: true
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
try {
|
try {
|
||||||
var jsonData = JSON.parse(text())
|
var jsonData = JSON.parse(text())
|
||||||
root.schemeLoaded(schemeName, jsonData)
|
root.schemeLoaded(schemeName, jsonData)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Failed to parse JSON for scheme:", schemeName, e)
|
console.warn("Failed to parse JSON for scheme:", schemeName, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -116,13 +116,13 @@ ColumnLayout {
|
||||||
} else {
|
} else {
|
||||||
// Default colors
|
// Default colors
|
||||||
colors = {
|
colors = {
|
||||||
mPrimary: "#000000",
|
"mPrimary": "#000000",
|
||||||
mSecondary: "#000000",
|
"mSecondary": "#000000",
|
||||||
mTertiary: "#000000",
|
"mTertiary": "#000000",
|
||||||
mError: "#ff0000",
|
"mError": "#ff0000",
|
||||||
mSurface: "#ffffff",
|
"mSurface": "#ffffff",
|
||||||
mOnSurface: "#000000",
|
"mOnSurface": "#000000",
|
||||||
mOutline: "#666666"
|
"mOutline": "#666666"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -322,15 +322,22 @@ ColumnLayout {
|
||||||
|
|
||||||
// Smooth animations
|
// Smooth animations
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
NumberAnimation { duration: 200; easing.type: Easing.OutCubic }
|
NumberAnimation {
|
||||||
|
duration: 200
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.color {
|
Behavior on border.color {
|
||||||
ColorAnimation { duration: 300 }
|
ColorAnimation {
|
||||||
|
duration: 300
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.width {
|
Behavior on border.width {
|
||||||
NumberAnimation { duration: 200 }
|
NumberAnimation {
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ Singleton {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof Niri !== "undefined") {
|
if (typeof Niri !== "undefined") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue