mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-16 01:02:46 -04:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac0a8f3449 | |||
| 8e4a63db67 | |||
| c02c63806f | |||
| 42e5d7f6e9 | |||
| d8cf1af422 | |||
| 9723661c80 | |||
| 81cba7ad97 | |||
| c23f58de40 | |||
| 2cf67ca7da | |||
| 392bd850ea |
@@ -100,7 +100,7 @@ windowrule = float on, match:class ^(blueman-manager)$
|
|||||||
windowrule = float on, match:class ^(org\.gnome\.Nautilus)$
|
windowrule = float on, match:class ^(org\.gnome\.Nautilus)$
|
||||||
windowrule = float on, match:class ^(xdg-desktop-portal)$
|
windowrule = float on, match:class ^(xdg-desktop-portal)$
|
||||||
|
|
||||||
windowrule = noinitialfocus on, match:class ^(steam)$, match:title ^(notificationtoasts)
|
windowrule = no_initial_focus on, match:class ^(steam)$, match:title ^(notificationtoasts)
|
||||||
windowrule = pin on, match:class ^(steam)$, match:title ^(notificationtoasts)
|
windowrule = pin on, match:class ^(steam)$, match:title ^(notificationtoasts)
|
||||||
|
|
||||||
windowrule = float on, match:class ^(firefox)$, match:title ^(Picture-in-Picture)$
|
windowrule = float on, match:class ^(firefox)$, match:title ^(Picture-in-Picture)$
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ func (i *ExtWorkspaceManagerV1) Dispatch(opcode uint32, fd int, data []byte) {
|
|||||||
l := 0
|
l := 0
|
||||||
objectID := client.Uint32(data[l : l+4])
|
objectID := client.Uint32(data[l : l+4])
|
||||||
proxy := i.Context().GetProxy(objectID)
|
proxy := i.Context().GetProxy(objectID)
|
||||||
if proxy != nil {
|
if proxy != nil && !proxy.IsZombie() {
|
||||||
e.WorkspaceGroup = proxy.(*ExtWorkspaceGroupHandleV1)
|
e.WorkspaceGroup = proxy.(*ExtWorkspaceGroupHandleV1)
|
||||||
} else {
|
} else {
|
||||||
groupHandle := &ExtWorkspaceGroupHandleV1{}
|
groupHandle := &ExtWorkspaceGroupHandleV1{}
|
||||||
@@ -278,7 +278,7 @@ func (i *ExtWorkspaceManagerV1) Dispatch(opcode uint32, fd int, data []byte) {
|
|||||||
l := 0
|
l := 0
|
||||||
objectID := client.Uint32(data[l : l+4])
|
objectID := client.Uint32(data[l : l+4])
|
||||||
proxy := i.Context().GetProxy(objectID)
|
proxy := i.Context().GetProxy(objectID)
|
||||||
if proxy != nil {
|
if proxy != nil && !proxy.IsZombie() {
|
||||||
e.Workspace = proxy.(*ExtWorkspaceHandleV1)
|
e.Workspace = proxy.(*ExtWorkspaceHandleV1)
|
||||||
} else {
|
} else {
|
||||||
wsHandle := &ExtWorkspaceHandleV1{}
|
wsHandle := &ExtWorkspaceHandleV1{}
|
||||||
|
|||||||
@@ -859,6 +859,70 @@ Item {
|
|||||||
return success ? `WIDGET_TOGGLE_SUCCESS: ${widgetId}` : `WIDGET_TOGGLE_FAILED: ${widgetId}`;
|
return success ? `WIDGET_TOGGLE_SUCCESS: ${widgetId}` : `WIDGET_TOGGLE_FAILED: ${widgetId}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openWith(widgetId: string, mode: string): string {
|
||||||
|
if (!widgetId)
|
||||||
|
return "ERROR: No widget ID specified";
|
||||||
|
if (!BarWidgetService.hasWidget(widgetId))
|
||||||
|
return `WIDGET_NOT_FOUND: ${widgetId}`;
|
||||||
|
|
||||||
|
const widget = BarWidgetService.getWidgetOnFocusedScreen(widgetId);
|
||||||
|
if (!widget)
|
||||||
|
return `WIDGET_NOT_AVAILABLE: ${widgetId}`;
|
||||||
|
if (typeof widget.openWithMode !== "function")
|
||||||
|
return `WIDGET_OPEN_WITH_NOT_SUPPORTED: ${widgetId}`;
|
||||||
|
|
||||||
|
widget.openWithMode(mode || "all");
|
||||||
|
return `WIDGET_OPEN_WITH_SUCCESS: ${widgetId} ${mode}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleWith(widgetId: string, mode: string): string {
|
||||||
|
if (!widgetId)
|
||||||
|
return "ERROR: No widget ID specified";
|
||||||
|
if (!BarWidgetService.hasWidget(widgetId))
|
||||||
|
return `WIDGET_NOT_FOUND: ${widgetId}`;
|
||||||
|
|
||||||
|
const widget = BarWidgetService.getWidgetOnFocusedScreen(widgetId);
|
||||||
|
if (!widget)
|
||||||
|
return `WIDGET_NOT_AVAILABLE: ${widgetId}`;
|
||||||
|
if (typeof widget.toggleWithMode !== "function")
|
||||||
|
return `WIDGET_TOGGLE_WITH_NOT_SUPPORTED: ${widgetId}`;
|
||||||
|
|
||||||
|
widget.toggleWithMode(mode || "all");
|
||||||
|
return `WIDGET_TOGGLE_WITH_SUCCESS: ${widgetId} ${mode}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openQuery(widgetId: string, query: string): string {
|
||||||
|
if (!widgetId)
|
||||||
|
return "ERROR: No widget ID specified";
|
||||||
|
if (!BarWidgetService.hasWidget(widgetId))
|
||||||
|
return `WIDGET_NOT_FOUND: ${widgetId}`;
|
||||||
|
|
||||||
|
const widget = BarWidgetService.getWidgetOnFocusedScreen(widgetId);
|
||||||
|
if (!widget)
|
||||||
|
return `WIDGET_NOT_AVAILABLE: ${widgetId}`;
|
||||||
|
if (typeof widget.openWithQuery !== "function")
|
||||||
|
return `WIDGET_OPEN_QUERY_NOT_SUPPORTED: ${widgetId}`;
|
||||||
|
|
||||||
|
widget.openWithQuery(query || "");
|
||||||
|
return `WIDGET_OPEN_QUERY_SUCCESS: ${widgetId}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleQuery(widgetId: string, query: string): string {
|
||||||
|
if (!widgetId)
|
||||||
|
return "ERROR: No widget ID specified";
|
||||||
|
if (!BarWidgetService.hasWidget(widgetId))
|
||||||
|
return `WIDGET_NOT_FOUND: ${widgetId}`;
|
||||||
|
|
||||||
|
const widget = BarWidgetService.getWidgetOnFocusedScreen(widgetId);
|
||||||
|
if (!widget)
|
||||||
|
return `WIDGET_NOT_AVAILABLE: ${widgetId}`;
|
||||||
|
if (typeof widget.toggleWithQuery !== "function")
|
||||||
|
return `WIDGET_TOGGLE_QUERY_NOT_SUPPORTED: ${widgetId}`;
|
||||||
|
|
||||||
|
widget.toggleWithQuery(query || "");
|
||||||
|
return `WIDGET_TOGGLE_QUERY_SUCCESS: ${widgetId}`;
|
||||||
|
}
|
||||||
|
|
||||||
function list(): string {
|
function list(): string {
|
||||||
const widgets = BarWidgetService.getRegisteredWidgetIds();
|
const widgets = BarWidgetService.getRegisteredWidgetIds();
|
||||||
if (widgets.length === 0)
|
if (widgets.length === 0)
|
||||||
|
|||||||
@@ -125,13 +125,6 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property var sectionDefinitions: [
|
readonly property var sectionDefinitions: [
|
||||||
{
|
|
||||||
id: "calculator",
|
|
||||||
title: I18n.tr("Calculator"),
|
|
||||||
icon: "calculate",
|
|
||||||
priority: 0,
|
|
||||||
defaultViewMode: "list"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: "favorites",
|
id: "favorites",
|
||||||
title: I18n.tr("Pinned"),
|
title: I18n.tr("Pinned"),
|
||||||
@@ -681,12 +674,6 @@ Item {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var calculatorResult = evaluateCalculator(searchQuery);
|
|
||||||
if (calculatorResult) {
|
|
||||||
calculatorResult._preScored = 12000;
|
|
||||||
allItems.push(calculatorResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
var apps = searchApps(searchQuery);
|
var apps = searchApps(searchQuery);
|
||||||
for (var i = 0; i < apps.length; i++) {
|
for (var i = 0; i < apps.length; i++) {
|
||||||
if (searchQuery)
|
if (searchQuery)
|
||||||
@@ -931,13 +918,6 @@ Item {
|
|||||||
return Transform.transformFileResult(file, I18n.tr("Open"), I18n.tr("Open folder"), I18n.tr("Copy path"));
|
return Transform.transformFileResult(file, I18n.tr("Open"), I18n.tr("Open folder"), I18n.tr("Copy path"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function evaluateCalculator(query) {
|
|
||||||
var calc = Utils.evaluateCalculator(query);
|
|
||||||
if (!calc)
|
|
||||||
return null;
|
|
||||||
return Transform.createCalculatorItem(calc, query, I18n.tr("Copy"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function detectTrigger(query) {
|
function detectTrigger(query) {
|
||||||
if (!query || query.length === 0)
|
if (!query || query.length === 0)
|
||||||
return {
|
return {
|
||||||
@@ -1559,9 +1539,6 @@ Item {
|
|||||||
case "file":
|
case "file":
|
||||||
openFile(item.data?.path);
|
openFile(item.data?.path);
|
||||||
break;
|
break;
|
||||||
case "calculator":
|
|
||||||
copyToClipboard(item.name);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,35 +101,6 @@ function detectIconType(iconName) {
|
|||||||
return "material";
|
return "material";
|
||||||
}
|
}
|
||||||
|
|
||||||
function evaluateCalculator(query) {
|
|
||||||
if (!query || query.length === 0)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var mathExpr = query.replace(/[^0-9+\-*/().%\s^]/g, "");
|
|
||||||
if (mathExpr.length < 2)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
var hasMath = /[+\-*/^%]/.test(query) && /\d/.test(query);
|
|
||||||
if (!hasMath)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
var sanitized = mathExpr.replace(/\^/g, "**");
|
|
||||||
var result = Function('"use strict"; return (' + sanitized + ')')();
|
|
||||||
|
|
||||||
if (typeof result === "number" && isFinite(result)) {
|
|
||||||
var displayResult = Number.isInteger(result) ? result.toString() : result.toFixed(6).replace(/\.?0+$/, "");
|
|
||||||
return {
|
|
||||||
expression: query,
|
|
||||||
result: result,
|
|
||||||
displayResult: displayResult
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} catch (e) { }
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function sortPluginIdsByOrder(pluginIds, order) {
|
function sortPluginIdsByOrder(pluginIds, order) {
|
||||||
if (!order || order.length === 0)
|
if (!order || order.length === 0)
|
||||||
return pluginIds;
|
return pluginIds;
|
||||||
|
|||||||
@@ -190,32 +190,6 @@ function transformPluginItem(item, pluginId, selectLabel) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCalculatorItem(calc, query, copyLabel) {
|
|
||||||
return {
|
|
||||||
id: "calculator_result",
|
|
||||||
type: "calculator",
|
|
||||||
name: calc.displayResult,
|
|
||||||
subtitle: query + " =",
|
|
||||||
icon: "calculate",
|
|
||||||
iconType: "material",
|
|
||||||
section: "calculator",
|
|
||||||
data: {
|
|
||||||
expression: calc.expression,
|
|
||||||
result: calc.result
|
|
||||||
},
|
|
||||||
actions: [],
|
|
||||||
primaryAction: {
|
|
||||||
name: copyLabel,
|
|
||||||
icon: "content_copy",
|
|
||||||
action: "copy"
|
|
||||||
},
|
|
||||||
_hName: "",
|
|
||||||
_hSub: "",
|
|
||||||
_hRich: false,
|
|
||||||
_preScored: undefined
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function createPluginBrowseItem(pluginId, plugin, trigger, isBuiltIn, isAllowed, browseLabel, triggerLabel, noTriggerLabel) {
|
function createPluginBrowseItem(pluginId, plugin, trigger, isBuiltIn, isAllowed, browseLabel, triggerLabel, noTriggerLabel) {
|
||||||
var rawIcon = isBuiltIn ? (plugin.cornerIcon || "extension") : (plugin.icon || "extension");
|
var rawIcon = isBuiltIn ? (plugin.cornerIcon || "extension") : (plugin.icon || "extension");
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -178,8 +178,6 @@ Rectangle {
|
|||||||
if (!root.item)
|
if (!root.item)
|
||||||
return "";
|
return "";
|
||||||
switch (root.item.type) {
|
switch (root.item.type) {
|
||||||
case "calculator":
|
|
||||||
return I18n.tr("Calc");
|
|
||||||
case "plugin":
|
case "plugin":
|
||||||
return I18n.tr("Plugin");
|
return I18n.tr("Plugin");
|
||||||
case "file":
|
case "file":
|
||||||
|
|||||||
@@ -91,7 +91,12 @@ DankModal {
|
|||||||
id: searchField
|
id: searchField
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
leftIconName: "search"
|
leftIconName: "search"
|
||||||
|
keyForwardTargets: [root.modalFocusScope]
|
||||||
onTextEdited: searchDebounce.restart()
|
onTextEdited: searchDebounce.restart()
|
||||||
|
Keys.onEscapePressed: event => {
|
||||||
|
root.close();
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,39 @@ DankPopout {
|
|||||||
|
|
||||||
layerNamespace: "dms:app-launcher"
|
layerNamespace: "dms:app-launcher"
|
||||||
|
|
||||||
|
property string _pendingMode: ""
|
||||||
|
property string _pendingQuery: ""
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
open();
|
open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openWithMode(mode) {
|
||||||
|
_pendingMode = mode || "";
|
||||||
|
open();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleWithMode(mode) {
|
||||||
|
if (shouldBeVisible) {
|
||||||
|
close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
openWithMode(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openWithQuery(query) {
|
||||||
|
_pendingQuery = query || "";
|
||||||
|
open();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleWithQuery(query) {
|
||||||
|
if (shouldBeVisible) {
|
||||||
|
close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
openWithQuery(query);
|
||||||
|
}
|
||||||
|
|
||||||
popupWidth: 560
|
popupWidth: 560
|
||||||
popupHeight: 640
|
popupHeight: 640
|
||||||
triggerWidth: 40
|
triggerWidth: 40
|
||||||
@@ -30,15 +59,25 @@ DankPopout {
|
|||||||
var lc = contentLoader.item?.launcherContent;
|
var lc = contentLoader.item?.launcherContent;
|
||||||
if (!lc)
|
if (!lc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const query = _pendingQuery;
|
||||||
|
const mode = _pendingMode || "apps";
|
||||||
|
_pendingMode = "";
|
||||||
|
_pendingQuery = "";
|
||||||
|
|
||||||
if (lc.searchField) {
|
if (lc.searchField) {
|
||||||
lc.searchField.text = "";
|
lc.searchField.text = query;
|
||||||
lc.searchField.forceActiveFocus();
|
lc.searchField.forceActiveFocus();
|
||||||
}
|
}
|
||||||
if (lc.controller) {
|
if (lc.controller) {
|
||||||
lc.controller.searchMode = "apps";
|
lc.controller.searchMode = mode;
|
||||||
lc.controller.pluginFilter = "";
|
lc.controller.pluginFilter = "";
|
||||||
lc.controller.searchQuery = "";
|
lc.controller.searchQuery = "";
|
||||||
lc.controller.performSearch();
|
if (query) {
|
||||||
|
lc.controller.setSearchQuery(query);
|
||||||
|
} else {
|
||||||
|
lc.controller.performSearch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lc.resetScroll?.();
|
lc.resetScroll?.();
|
||||||
lc.actionPanel?.hide();
|
lc.actionPanel?.hide();
|
||||||
|
|||||||
@@ -15,18 +15,22 @@ Item {
|
|||||||
property var pluginDetailInstance: null
|
property var pluginDetailInstance: null
|
||||||
property var widgetModel: null
|
property var widgetModel: null
|
||||||
property var collapseCallback: null
|
property var collapseCallback: null
|
||||||
|
property real maxAvailableHeight: 9999
|
||||||
|
|
||||||
function getDetailHeight(section) {
|
function getDetailHeight(section) {
|
||||||
const maxAvailable = parent ? parent.height - Theme.spacingS : 9999;
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case section === "wifi":
|
case section === "wifi":
|
||||||
case section === "bluetooth":
|
case section === "bluetooth":
|
||||||
case section === "builtin_vpn":
|
case section === "builtin_vpn":
|
||||||
return Math.min(350, maxAvailable);
|
return Math.min(350, maxAvailableHeight);
|
||||||
case section.startsWith("brightnessSlider_"):
|
case section.startsWith("brightnessSlider_"):
|
||||||
return Math.min(400, maxAvailable);
|
return Math.min(400, maxAvailableHeight);
|
||||||
|
case section.startsWith("plugin_"):
|
||||||
|
if (pluginDetailInstance?.ccDetailHeight)
|
||||||
|
return Math.min(pluginDetailInstance.ccDetailHeight, maxAvailableHeight);
|
||||||
|
return Math.min(250, maxAvailableHeight);
|
||||||
default:
|
default:
|
||||||
return Math.min(250, maxAvailable);
|
return Math.min(250, maxAvailableHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,26 @@ Column {
|
|||||||
|
|
||||||
spacing: editMode ? Theme.spacingL : Theme.spacingS
|
spacing: editMode ? Theme.spacingL : Theme.spacingS
|
||||||
|
|
||||||
|
property real maxPopoutHeight: 9999
|
||||||
property var currentRowWidgets: []
|
property var currentRowWidgets: []
|
||||||
property real currentRowWidth: 0
|
property real currentRowWidth: 0
|
||||||
property int expandedRowIndex: -1
|
property int expandedRowIndex: -1
|
||||||
property var colorPickerModal: null
|
property var colorPickerModal: null
|
||||||
|
|
||||||
|
readonly property real _maxDetailHeight: {
|
||||||
|
const rows = layoutResult.rows;
|
||||||
|
let totalRowHeight = 0;
|
||||||
|
for (let i = 0; i < rows.length; i++) {
|
||||||
|
const sliderOnly = rows[i].every(w => {
|
||||||
|
const id = w.id || "";
|
||||||
|
return id === "volumeSlider" || id === "brightnessSlider" || id === "inputVolumeSlider";
|
||||||
|
});
|
||||||
|
totalRowHeight += sliderOnly ? 36 : 60;
|
||||||
|
}
|
||||||
|
const rowSpacing = Math.max(0, rows.length - 1) * spacing;
|
||||||
|
return Math.max(100, maxPopoutHeight - totalRowHeight - rowSpacing);
|
||||||
|
}
|
||||||
|
|
||||||
function calculateRowsAndWidgets() {
|
function calculateRowsAndWidgets() {
|
||||||
return LayoutUtils.calculateRowsAndWidgets(root, expandedSection, expandedWidgetIndex);
|
return LayoutUtils.calculateRowsAndWidgets(root, expandedSection, expandedWidgetIndex);
|
||||||
}
|
}
|
||||||
@@ -163,6 +178,7 @@ Column {
|
|||||||
DetailHost {
|
DetailHost {
|
||||||
id: detailHost
|
id: detailHost
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
maxAvailableHeight: root._maxDetailHeight
|
||||||
height: active ? (getDetailHeight(root.expandedSection) + Theme.spacingS) : 0
|
height: active ? (getDetailHeight(root.expandedSection) + Theme.spacingS) : 0
|
||||||
property bool active: {
|
property bool active: {
|
||||||
if (root.expandedSection === "")
|
if (root.expandedSection === "")
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ DankPopout {
|
|||||||
property alias bluetoothCodecSelector: bluetoothCodecSelector
|
property alias bluetoothCodecSelector: bluetoothCodecSelector
|
||||||
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
clip: true
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -166,6 +167,10 @@ DankPopout {
|
|||||||
id: widgetGrid
|
id: widgetGrid
|
||||||
width: parent.width
|
width: parent.width
|
||||||
editMode: root.editMode
|
editMode: root.editMode
|
||||||
|
maxPopoutHeight: {
|
||||||
|
const screenHeight = (root.triggerScreen?.height ?? 1080);
|
||||||
|
return screenHeight - 100 - Theme.spacingL - headerPane.height - Theme.spacingS;
|
||||||
|
}
|
||||||
expandedSection: root.expandedSection
|
expandedSection: root.expandedSection
|
||||||
expandedWidgetIndex: root.expandedWidgetIndex
|
expandedWidgetIndex: root.expandedWidgetIndex
|
||||||
expandedWidgetData: root.expandedWidgetData
|
expandedWidgetData: root.expandedWidgetData
|
||||||
|
|||||||
@@ -642,24 +642,52 @@ Item {
|
|||||||
popoutTarget: appDrawerLoader.item
|
popoutTarget: appDrawerLoader.item
|
||||||
parentScreen: barWindow.screen
|
parentScreen: barWindow.screen
|
||||||
hyprlandOverviewLoader: barWindow ? barWindow.hyprlandOverviewLoader : null
|
hyprlandOverviewLoader: barWindow ? barWindow.hyprlandOverviewLoader : null
|
||||||
onClicked: {
|
|
||||||
|
function _preparePopout() {
|
||||||
appDrawerLoader.active = true;
|
appDrawerLoader.active = true;
|
||||||
// Use topBarContent.barConfig directly since widget barConfig binding doesn't work in Components
|
if (!appDrawerLoader.item)
|
||||||
|
return false;
|
||||||
const effectiveBarConfig = topBarContent.barConfig;
|
const effectiveBarConfig = topBarContent.barConfig;
|
||||||
// Calculate barPosition from axis.edge
|
|
||||||
const barPosition = barWindow.axis?.edge === "left" ? 2 : (barWindow.axis?.edge === "right" ? 3 : (barWindow.axis?.edge === "top" ? 0 : 1));
|
const barPosition = barWindow.axis?.edge === "left" ? 2 : (barWindow.axis?.edge === "right" ? 3 : (barWindow.axis?.edge === "top" ? 0 : 1));
|
||||||
if (appDrawerLoader.item && appDrawerLoader.item.setBarContext) {
|
if (appDrawerLoader.item.setBarContext)
|
||||||
appDrawerLoader.item.setBarContext(barPosition, effectiveBarConfig?.bottomGap ?? 0);
|
appDrawerLoader.item.setBarContext(barPosition, effectiveBarConfig?.bottomGap ?? 0);
|
||||||
}
|
if (appDrawerLoader.item.setTriggerPosition) {
|
||||||
if (appDrawerLoader.item && appDrawerLoader.item.setTriggerPosition) {
|
|
||||||
const globalPos = launcherButton.visualContent.mapToItem(null, 0, 0);
|
const globalPos = launcherButton.visualContent.mapToItem(null, 0, 0);
|
||||||
const currentScreen = barWindow.screen;
|
const currentScreen = barWindow.screen;
|
||||||
const pos = SettingsData.getPopupTriggerPosition(globalPos, currentScreen, barWindow.effectiveBarThickness, launcherButton.visualWidth, effectiveBarConfig?.spacing ?? 4, barPosition, effectiveBarConfig);
|
const pos = SettingsData.getPopupTriggerPosition(globalPos, currentScreen, barWindow.effectiveBarThickness, launcherButton.visualWidth, effectiveBarConfig?.spacing ?? 4, barPosition, effectiveBarConfig);
|
||||||
appDrawerLoader.item.setTriggerPosition(pos.x, pos.y, pos.width, launcherButton.section, currentScreen, barPosition, barWindow.effectiveBarThickness, effectiveBarConfig?.spacing ?? 4, effectiveBarConfig);
|
appDrawerLoader.item.setTriggerPosition(pos.x, pos.y, pos.width, launcherButton.section, currentScreen, barPosition, barWindow.effectiveBarThickness, effectiveBarConfig?.spacing ?? 4, effectiveBarConfig);
|
||||||
}
|
}
|
||||||
if (appDrawerLoader.item) {
|
return true;
|
||||||
PopoutManager.requestPopout(appDrawerLoader.item, undefined, "appDrawer");
|
}
|
||||||
}
|
|
||||||
|
function openWithMode(mode) {
|
||||||
|
if (!_preparePopout())
|
||||||
|
return;
|
||||||
|
appDrawerLoader.item.openWithMode(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleWithMode(mode) {
|
||||||
|
if (!_preparePopout())
|
||||||
|
return;
|
||||||
|
appDrawerLoader.item.toggleWithMode(mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openWithQuery(query) {
|
||||||
|
if (!_preparePopout())
|
||||||
|
return;
|
||||||
|
appDrawerLoader.item.openWithQuery(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleWithQuery(query) {
|
||||||
|
if (!_preparePopout())
|
||||||
|
return;
|
||||||
|
appDrawerLoader.item.toggleWithQuery(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (!_preparePopout())
|
||||||
|
return;
|
||||||
|
PopoutManager.requestPopout(appDrawerLoader.item, undefined, "appDrawer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ PanelWindow {
|
|||||||
property bool _isDestroying: false
|
property bool _isDestroying: false
|
||||||
property bool _finalized: false
|
property bool _finalized: false
|
||||||
property real _lastReportedAlignedHeight: -1
|
property real _lastReportedAlignedHeight: -1
|
||||||
|
property real _storedTopMargin: 0
|
||||||
|
property real _storedBottomMargin: 0
|
||||||
readonly property string clearText: I18n.tr("Dismiss")
|
readonly property string clearText: I18n.tr("Dismiss")
|
||||||
property bool descriptionExpanded: false
|
property bool descriptionExpanded: false
|
||||||
readonly property bool hasExpandableBody: (notificationData?.htmlBody || "").replace(/<[^>]*>/g, "").trim().length > 0
|
readonly property bool hasExpandableBody: (notificationData?.htmlBody || "").replace(/<[^>]*>/g, "").trim().length > 0
|
||||||
@@ -146,6 +148,8 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
_lastReportedAlignedHeight = Theme.px(implicitHeight, dpr);
|
_lastReportedAlignedHeight = Theme.px(implicitHeight, dpr);
|
||||||
|
_storedTopMargin = getTopMargin();
|
||||||
|
_storedBottomMargin = getBottomMargin();
|
||||||
if (SettingsData.notificationPopupPrivacyMode)
|
if (SettingsData.notificationPopupPrivacyMode)
|
||||||
descriptionExpanded = false;
|
descriptionExpanded = false;
|
||||||
if (hasValidData) {
|
if (hasValidData) {
|
||||||
@@ -179,14 +183,30 @@ PanelWindow {
|
|||||||
property bool isBottomCenter: SettingsData.notificationPopupPosition === SettingsData.Position.BottomCenter
|
property bool isBottomCenter: SettingsData.notificationPopupPosition === SettingsData.Position.BottomCenter
|
||||||
property bool isCenterPosition: isTopCenter || isBottomCenter
|
property bool isCenterPosition: isTopCenter || isBottomCenter
|
||||||
|
|
||||||
anchors.top: isTopCenter || SettingsData.notificationPopupPosition === SettingsData.Position.Top || SettingsData.notificationPopupPosition === SettingsData.Position.Left
|
anchors.top: true
|
||||||
anchors.bottom: isBottomCenter || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom || SettingsData.notificationPopupPosition === SettingsData.Position.Right
|
anchors.bottom: true
|
||||||
anchors.left: SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom
|
anchors.left: SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom
|
||||||
anchors.right: SettingsData.notificationPopupPosition === SettingsData.Position.Top || SettingsData.notificationPopupPosition === SettingsData.Position.Right
|
anchors.right: SettingsData.notificationPopupPosition === SettingsData.Position.Top || SettingsData.notificationPopupPosition === SettingsData.Position.Right
|
||||||
|
|
||||||
|
mask: contentInputMask
|
||||||
|
|
||||||
|
Region {
|
||||||
|
id: contentInputMask
|
||||||
|
item: contentMaskRect
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: contentMaskRect
|
||||||
|
visible: false
|
||||||
|
x: content.x
|
||||||
|
y: content.y
|
||||||
|
width: alignedWidth
|
||||||
|
height: alignedHeight
|
||||||
|
}
|
||||||
|
|
||||||
margins {
|
margins {
|
||||||
top: getTopMargin()
|
top: _storedTopMargin
|
||||||
bottom: getBottomMargin()
|
bottom: _storedBottomMargin
|
||||||
left: getLeftMargin()
|
left: getLeftMargin()
|
||||||
right: getRightMargin()
|
right: getRightMargin()
|
||||||
}
|
}
|
||||||
@@ -263,7 +283,14 @@ PanelWindow {
|
|||||||
id: content
|
id: content
|
||||||
|
|
||||||
x: Theme.snap((win.width - alignedWidth) / 2, dpr)
|
x: Theme.snap((win.width - alignedWidth) / 2, dpr)
|
||||||
y: Theme.snap((win.height - alignedHeight) / 2, dpr)
|
y: {
|
||||||
|
const isTop = isTopCenter || SettingsData.notificationPopupPosition === SettingsData.Position.Top || SettingsData.notificationPopupPosition === SettingsData.Position.Left;
|
||||||
|
if (isTop) {
|
||||||
|
return Theme.snap(screenY, dpr);
|
||||||
|
} else {
|
||||||
|
return Theme.snap(win.height - alignedHeight - screenY, dpr);
|
||||||
|
}
|
||||||
|
}
|
||||||
width: alignedWidth
|
width: alignedWidth
|
||||||
height: alignedHeight
|
height: alignedHeight
|
||||||
visible: !win._finalized
|
visible: !win._finalized
|
||||||
@@ -311,7 +338,7 @@ PanelWindow {
|
|||||||
id: bgShadowLayer
|
id: bgShadowLayer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.snap(4, win.dpr)
|
anchors.margins: Theme.snap(4, win.dpr)
|
||||||
layer.enabled: !win._isDestroying && win.screenValid && !implicitHeightAnim.running
|
layer.enabled: !win._isDestroying && win.screenValid
|
||||||
layer.smooth: false
|
layer.smooth: false
|
||||||
layer.textureSize: Qt.size(Math.round(width * win.dpr), Math.round(height * win.dpr))
|
layer.textureSize: Qt.size(Math.round(width * win.dpr), Math.round(height * win.dpr))
|
||||||
layer.textureMirroring: ShaderEffectSource.MirrorVertically
|
layer.textureMirroring: ShaderEffectSource.MirrorVertically
|
||||||
|
|||||||
@@ -376,22 +376,12 @@ FocusScope {
|
|||||||
return;
|
return;
|
||||||
var isLauncher = plugin.type === "launcher" || (plugin.capabilities && plugin.capabilities.includes("launcher"));
|
var isLauncher = plugin.type === "launcher" || (plugin.capabilities && plugin.capabilities.includes("launcher"));
|
||||||
if (isLauncher) {
|
if (isLauncher) {
|
||||||
pluginReloadTimer.pendingPluginId = pluginId;
|
pluginsTab.isReloading = true;
|
||||||
pluginReloadTimer.restart();
|
PluginService.reloadPlugin(pluginId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: pluginReloadTimer
|
|
||||||
property string pendingPluginId: ""
|
|
||||||
interval: 500
|
|
||||||
onTriggered: {
|
|
||||||
if (pendingPluginId)
|
|
||||||
PluginService.reloadPlugin(pendingPluginId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: DMSService
|
target: DMSService
|
||||||
function onPluginsListReceived(plugins) {
|
function onPluginsListReceived(plugins) {
|
||||||
|
|||||||
@@ -469,6 +469,44 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: shadowSource
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: "black"
|
||||||
|
visible: false
|
||||||
|
opacity: contentWrapper.opacity
|
||||||
|
scale: contentWrapper.scale
|
||||||
|
x: contentWrapper.x
|
||||||
|
y: contentWrapper.y
|
||||||
|
|
||||||
|
property real shadowBlurPx: 10
|
||||||
|
property real shadowSpreadPx: 0
|
||||||
|
property real shadowBaseAlpha: 0.60
|
||||||
|
readonly property real popupSurfaceAlpha: SettingsData.popupTransparency
|
||||||
|
readonly property real effectiveShadowAlpha: Math.max(0, Math.min(1, shadowBaseAlpha * popupSurfaceAlpha))
|
||||||
|
readonly property int blurMax: 64
|
||||||
|
|
||||||
|
layer.enabled: Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1" && !(root.suspendShadowWhileResizing && root._resizeActive)
|
||||||
|
layer.smooth: false
|
||||||
|
|
||||||
|
layer.effect: MultiEffect {
|
||||||
|
id: shadowFx
|
||||||
|
autoPaddingEnabled: true
|
||||||
|
shadowEnabled: true
|
||||||
|
blurEnabled: false
|
||||||
|
maskEnabled: false
|
||||||
|
shadowBlur: Math.max(0, Math.min(1, shadowSource.shadowBlurPx / shadowSource.blurMax))
|
||||||
|
shadowScale: 1 + (2 * shadowSource.shadowSpreadPx) / Math.max(1, Math.min(shadowSource.width, shadowSource.height))
|
||||||
|
shadowColor: {
|
||||||
|
const baseColor = Theme.isLightMode ? Qt.rgba(0, 0, 0, 1) : Theme.surfaceContainerHighest;
|
||||||
|
return Theme.withAlpha(baseColor, shadowSource.effectiveShadowAlpha);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: contentWrapper
|
id: contentWrapper
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -480,31 +518,10 @@ Item {
|
|||||||
x: Theme.snap(contentContainer.animX + (parent.width - width) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
x: Theme.snap(contentContainer.animX + (parent.width - width) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
||||||
y: Theme.snap(contentContainer.animY + (parent.height - height) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
y: Theme.snap(contentContainer.animY + (parent.height - height) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
||||||
|
|
||||||
property real shadowBlurPx: 10
|
layer.enabled: contentWrapper.opacity < 1
|
||||||
property real shadowSpreadPx: 0
|
|
||||||
property real shadowBaseAlpha: 0.60
|
|
||||||
readonly property real popupSurfaceAlpha: SettingsData.popupTransparency
|
|
||||||
readonly property real effectiveShadowAlpha: Math.max(0, Math.min(1, shadowBaseAlpha * popupSurfaceAlpha))
|
|
||||||
readonly property int blurMax: 64
|
|
||||||
|
|
||||||
layer.enabled: Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1" && !(root.suspendShadowWhileResizing && root._resizeActive)
|
|
||||||
layer.smooth: false
|
layer.smooth: false
|
||||||
layer.textureSize: root.dpr > 1 ? Qt.size(Math.ceil(width * root.dpr), Math.ceil(height * root.dpr)) : Qt.size(0, 0)
|
layer.textureSize: root.dpr > 1 ? Qt.size(Math.ceil(width * root.dpr), Math.ceil(height * root.dpr)) : Qt.size(0, 0)
|
||||||
|
|
||||||
layer.effect: MultiEffect {
|
|
||||||
id: shadowFx
|
|
||||||
autoPaddingEnabled: true
|
|
||||||
shadowEnabled: true
|
|
||||||
blurEnabled: false
|
|
||||||
maskEnabled: false
|
|
||||||
shadowBlur: Math.max(0, Math.min(1, contentWrapper.shadowBlurPx / contentWrapper.blurMax))
|
|
||||||
shadowScale: 1 + (2 * contentWrapper.shadowSpreadPx) / Math.max(1, Math.min(contentWrapper.width, contentWrapper.height))
|
|
||||||
shadowColor: {
|
|
||||||
const baseColor = Theme.isLightMode ? Qt.rgba(0, 0, 0, 1) : Theme.surfaceContainerHighest;
|
|
||||||
return Theme.withAlpha(baseColor, contentWrapper.effectiveShadowAlpha);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: animationDuration
|
duration: animationDuration
|
||||||
|
|||||||
Reference in New Issue
Block a user