mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-03 02:52:07 -04:00
Compare commits
4 Commits
da14d75a3b
...
d60e70f9cc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d60e70f9cc | ||
|
|
cdb70fadb3 | ||
|
|
7867deef60 | ||
|
|
a77c1adb32 |
@@ -268,7 +268,7 @@ func buildOnce(opts *Options) error {
|
||||
refreshQt6ct()
|
||||
}
|
||||
|
||||
signalTerminals()
|
||||
signalTerminals(opts)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -692,11 +692,15 @@ func refreshQt6ct() {
|
||||
}
|
||||
}
|
||||
|
||||
func signalTerminals() {
|
||||
signalByName("kitty", syscall.SIGUSR1)
|
||||
signalByName("ghostty", syscall.SIGUSR2)
|
||||
signalByName(".kitty-wrapped", syscall.SIGUSR1)
|
||||
signalByName(".ghostty-wrappe", syscall.SIGUSR2)
|
||||
func signalTerminals(opts *Options) {
|
||||
if !opts.ShouldSkipTemplate("kitty") && appExists(opts.AppChecker, []string{"kitty"}, nil) {
|
||||
signalByName("kitty", syscall.SIGUSR1)
|
||||
signalByName(".kitty-wrapped", syscall.SIGUSR1)
|
||||
}
|
||||
if !opts.ShouldSkipTemplate("ghostty") && appExists(opts.AppChecker, []string{"ghostty"}, nil) {
|
||||
signalByName("ghostty", syscall.SIGUSR2)
|
||||
signalByName(".ghostty-wrappe", syscall.SIGUSR2)
|
||||
}
|
||||
}
|
||||
|
||||
func signalByName(name string, sig syscall.Signal) {
|
||||
|
||||
@@ -130,9 +130,25 @@ Item {
|
||||
if (!entry || entry.isHeader)
|
||||
return;
|
||||
var rowIndex = _flatIndexToRowMap[index];
|
||||
if (rowIndex === undefined)
|
||||
if (rowIndex === undefined || rowIndex >= _cumulativeHeights.length)
|
||||
return;
|
||||
mainListView.positionViewAtIndex(rowIndex, ListView.Contain);
|
||||
var row = _visualRows[rowIndex];
|
||||
if (!row)
|
||||
return;
|
||||
|
||||
var rowY = _cumulativeHeights[rowIndex];
|
||||
var rowHeight = row.height;
|
||||
var scrollY = mainListView.contentY - mainListView.originY;
|
||||
var viewHeight = mainListView.height;
|
||||
var headerH = stickyHeader.height;
|
||||
|
||||
if (rowY < scrollY + headerH) {
|
||||
mainListView.contentY = Math.max(mainListView.originY, rowY - headerH + mainListView.originY);
|
||||
return;
|
||||
}
|
||||
if (rowY + rowHeight > scrollY + viewHeight) {
|
||||
mainListView.contentY = rowY + rowHeight - viewHeight + mainListView.originY;
|
||||
}
|
||||
}
|
||||
|
||||
function getSelectedItemPosition() {
|
||||
|
||||
@@ -136,6 +136,19 @@ BasePill {
|
||||
}
|
||||
readonly property int windowCount: _groupByApp ? (groupedWindows?.length || 0) : (sortedToplevels?.length || 0)
|
||||
readonly property real iconCellSize: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.noBackground) + 6
|
||||
|
||||
readonly property string focusedAppId: {
|
||||
const toplevels = CompositorService.sortedToplevels;
|
||||
if (!toplevels)
|
||||
return "";
|
||||
let result = "";
|
||||
for (let i = 0; i < toplevels.length; i++) {
|
||||
if (toplevels[i].activated)
|
||||
result = toplevels[i].appId || "";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
visible: windowCount > 0
|
||||
|
||||
property real scrollAccumulator: 0
|
||||
@@ -227,21 +240,7 @@ BasePill {
|
||||
property bool isGrouped: root._groupByApp
|
||||
property var groupData: isGrouped ? modelData : null
|
||||
property var toplevelData: isGrouped ? (modelData.windows.length > 0 ? modelData.windows[0].toplevel : null) : modelData
|
||||
property bool isFocused: {
|
||||
if (!isGrouped)
|
||||
return toplevelData ? toplevelData.activated : false;
|
||||
const toplevels = CompositorService.sortedToplevels;
|
||||
if (!toplevels)
|
||||
return false;
|
||||
let result = false;
|
||||
for (let i = 0; i < toplevels.length; i++) {
|
||||
if ((toplevels[i].appId || "") !== appId)
|
||||
continue;
|
||||
if (toplevels[i].activated)
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
property bool isFocused: isGrouped ? (root.focusedAppId === appId) : (toplevelData ? toplevelData.activated : false)
|
||||
property string appId: isGrouped ? modelData.appId : (modelData.appId || "")
|
||||
property string windowTitle: toplevelData ? (toplevelData.title || "(Unnamed)") : "(Unnamed)"
|
||||
property var toplevelObject: toplevelData
|
||||
@@ -496,21 +495,7 @@ BasePill {
|
||||
property bool isGrouped: root._groupByApp
|
||||
property var groupData: isGrouped ? modelData : null
|
||||
property var toplevelData: isGrouped ? (modelData.windows.length > 0 ? modelData.windows[0].toplevel : null) : modelData
|
||||
property bool isFocused: {
|
||||
if (!isGrouped)
|
||||
return toplevelData ? toplevelData.activated : false;
|
||||
const toplevels = CompositorService.sortedToplevels;
|
||||
if (!toplevels)
|
||||
return false;
|
||||
let result = false;
|
||||
for (let i = 0; i < toplevels.length; i++) {
|
||||
if ((toplevels[i].appId || "") !== appId)
|
||||
continue;
|
||||
if (toplevels[i].activated)
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
property bool isFocused: isGrouped ? (root.focusedAppId === appId) : (toplevelData ? toplevelData.activated : false)
|
||||
property string appId: isGrouped ? modelData.appId : (modelData.appId || "")
|
||||
property string windowTitle: toplevelData ? (toplevelData.title || "(Unnamed)") : "(Unnamed)"
|
||||
property var toplevelObject: toplevelData
|
||||
|
||||
@@ -341,9 +341,7 @@ Rectangle {
|
||||
Repeater {
|
||||
id: notificationRepeater
|
||||
objectName: "notificationRepeater"
|
||||
model: ScriptModel {
|
||||
values: notificationGroup?.notifications?.slice(0, 10) || []
|
||||
}
|
||||
model: notificationGroup?.notifications?.slice(0, 10) || []
|
||||
|
||||
delegate: Rectangle {
|
||||
required property var modelData
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Modals.FileBrowser
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import qs.Modules.Settings.Widgets
|
||||
@@ -7,6 +8,15 @@ import qs.Modules.Settings.Widgets
|
||||
Item {
|
||||
id: root
|
||||
|
||||
FileBrowserModal {
|
||||
id: dockLogoFileBrowser
|
||||
browserTitle: I18n.tr("Select Dock Launcher Logo")
|
||||
browserIcon: "image"
|
||||
browserType: "generic"
|
||||
filterExtensions: ["*.svg", "*.png", "*.jpg", "*.jpeg", "*.webp"]
|
||||
onFileSelected: path => SettingsData.set("dockLauncherLogoCustomPath", path.replace("file://", ""))
|
||||
}
|
||||
|
||||
DankFlickable {
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
@@ -298,6 +308,40 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
visible: SettingsData.dockLauncherLogoMode === "custom"
|
||||
spacing: Theme.spacingM
|
||||
|
||||
StyledRect {
|
||||
width: parent.width - selectButton.width - Theme.spacingM
|
||||
height: 36
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.9)
|
||||
border.color: Theme.outlineStrong
|
||||
border.width: 1
|
||||
|
||||
StyledText {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: SettingsData.dockLauncherLogoCustomPath || I18n.tr("Select an image file...")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: SettingsData.dockLauncherLogoCustomPath ? Theme.surfaceText : Theme.outlineButton
|
||||
width: parent.width - Theme.spacingM * 2
|
||||
elide: Text.ElideMiddle
|
||||
}
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
id: selectButton
|
||||
iconName: "folder_open"
|
||||
width: 36
|
||||
height: 36
|
||||
onClicked: dockLogoFileBrowser.open()
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingL
|
||||
|
||||
Reference in New Issue
Block a user