reorganize repo: move shell sources into shell/, test scripts into test/
This commit is contained in:
parent
344c1f8512
commit
d6cd2f173a
60 changed files with 2 additions and 2 deletions
45
shell/modules/WindowTitle.qml
Normal file
45
shell/modules/WindowTitle.qml
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import "." as M
|
||||
|
||||
M.BarSection {
|
||||
id: root
|
||||
spacing: M.Theme.moduleSpacing
|
||||
tooltip: M.NiriIpc.focusedAppId ? M.NiriIpc.focusedAppId + "\n" + M.NiriIpc.focusedTitle : M.NiriIpc.focusedTitle
|
||||
|
||||
readonly property string _iconSource: {
|
||||
if (!M.NiriIpc.focusedAppId)
|
||||
return "";
|
||||
const entry = DesktopEntries.heuristicLookup(M.NiriIpc.focusedAppId);
|
||||
return entry ? Quickshell.iconPath(entry.icon) : "";
|
||||
}
|
||||
|
||||
readonly property real _iconOffset: _icon.visible ? _icon.width + root.spacing : 0
|
||||
|
||||
// Natural content width — Bar.qml uses this to cap the group width
|
||||
readonly property real naturalWidth: _iconOffset + _label.implicitWidth
|
||||
|
||||
IconImage {
|
||||
id: _icon
|
||||
visible: root._iconSource !== ""
|
||||
source: root._iconSource
|
||||
implicitSize: M.Theme.fontSize + 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
layer.enabled: true
|
||||
layer.effect: MultiEffect {
|
||||
colorization: 1.0
|
||||
colorizationColor: root.accentColor
|
||||
}
|
||||
}
|
||||
|
||||
M.BarLabel {
|
||||
id: _label
|
||||
label: M.NiriIpc.focusedTitle
|
||||
color: root.accentColor
|
||||
elide: Text.ElideRight
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: Math.min(implicitWidth, Math.max(0, root.width - root._iconOffset))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue