mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Compositor: fix getFocusedWindowTitle. Since active workspace has been implemented.
+ autoformatting
This commit is contained in:
@@ -12,7 +12,7 @@ Rectangle {
|
||||
id: root
|
||||
property ShellScreen screen
|
||||
property real scaling: 1.0
|
||||
|
||||
|
||||
// Widget properties passed from Bar.qml for per-instance settings
|
||||
property string widgetId: ""
|
||||
property string section: ""
|
||||
@@ -22,7 +22,7 @@ Rectangle {
|
||||
readonly property bool isVerticalBar: Settings.data.bar.position === "left" || Settings.data.bar.position === "right"
|
||||
readonly property bool compact: (Settings.data.bar.density === "compact")
|
||||
readonly property real itemSize: compact ? Style.capsuleHeight * 0.9 * scaling : Style.capsuleHeight * 0.8 * scaling
|
||||
|
||||
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
property var widgetSettings: {
|
||||
if (section && sectionWidgetIndex >= 0) {
|
||||
@@ -62,9 +62,8 @@ Rectangle {
|
||||
delegate: Item {
|
||||
id: taskbarItem
|
||||
required property var modelData
|
||||
|
||||
visible: (!widgetSettings.onlySameOutput || modelData.output == screen.name)
|
||||
&& (!widgetSettings.onlyActiveWorkspaces || CompositorService.getActiveWorkspaces().map(ws => ws.id).includes(modelData.workspaceId))
|
||||
|
||||
visible: (!widgetSettings.onlySameOutput || modelData.output == screen.name) && (!widgetSettings.onlyActiveWorkspaces || CompositorService.getActiveWorkspaces().map(ws => ws.id).includes(modelData.workspaceId))
|
||||
|
||||
Layout.preferredWidth: root.itemSize
|
||||
Layout.preferredHeight: root.itemSize
|
||||
|
||||
@@ -302,7 +302,9 @@ NPanel {
|
||||
positionViewAtIndex(currentIndex, ListView.Contain)
|
||||
}
|
||||
}
|
||||
onModelChanged: {}
|
||||
onModelChanged: {
|
||||
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
id: entry
|
||||
@@ -313,11 +315,14 @@ NPanel {
|
||||
|
||||
// Pin helpers
|
||||
function togglePin(appId) {
|
||||
if (!appId) return
|
||||
if (!appId)
|
||||
return
|
||||
let arr = (Settings.data.dock.pinnedApps || []).slice()
|
||||
const idx = arr.indexOf(appId)
|
||||
if (idx >= 0) arr.splice(idx, 1)
|
||||
else arr.push(appId)
|
||||
if (idx >= 0)
|
||||
arr.splice(idx, 1)
|
||||
else
|
||||
arr.push(appId)
|
||||
Settings.data.dock.pinnedApps = arr
|
||||
}
|
||||
|
||||
@@ -506,13 +511,13 @@ NPanel {
|
||||
z: -1
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: (mouse) => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
selectedIndex = index
|
||||
ui.activate()
|
||||
mouse.accepted = true
|
||||
}
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
selectedIndex = index
|
||||
ui.activate()
|
||||
mouse.accepted = true
|
||||
}
|
||||
}
|
||||
acceptedButtons: Qt.LeftButton
|
||||
}
|
||||
}
|
||||
@@ -537,4 +542,4 @@ NPanel {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ Item {
|
||||
// Favorites first
|
||||
const aFav = favoriteApps.includes(getAppKey(a))
|
||||
const bFav = favoriteApps.includes(getAppKey(b))
|
||||
if (aFav !== bFav) return aFav ? -1 : 1
|
||||
if (aFav !== bFav)
|
||||
return aFav ? -1 : 1
|
||||
const ua = getUsageCount(a)
|
||||
const ub = getUsageCount(b)
|
||||
if (ub !== ua)
|
||||
@@ -87,7 +88,8 @@ Item {
|
||||
sorted = entries.slice().sort((a, b) => {
|
||||
const aFav = favoriteApps.includes(getAppKey(a))
|
||||
const bFav = favoriteApps.includes(getAppKey(b))
|
||||
if (aFav !== bFav) return aFav ? -1 : 1
|
||||
if (aFav !== bFav)
|
||||
return aFav ? -1 : 1
|
||||
return (a.name || "").toLowerCase().localeCompare((b.name || "").toLowerCase())
|
||||
})
|
||||
}
|
||||
@@ -108,8 +110,10 @@ Item {
|
||||
const nonFav = []
|
||||
for (const r of fuzzyResults) {
|
||||
const app = r.obj
|
||||
if (favoriteApps.includes(getAppKey(app))) fav.push(r)
|
||||
else nonFav.push(r)
|
||||
if (favoriteApps.includes(getAppKey(app)))
|
||||
fav.push(r)
|
||||
else
|
||||
nonFav.push(r)
|
||||
}
|
||||
return fav.concat(nonFav).map(result => createResultEntry(result.obj))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user