mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-03 11:02:08 -04:00
Compare commits
22 Commits
ac0a8f3449
...
hotfix-1.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db4de55338 | ||
|
|
37ecbbbbde | ||
|
|
d6a6d2a438 | ||
|
|
bf1c6eec74 | ||
|
|
0ddae80584 | ||
|
|
5c96c03bfa | ||
|
|
dfe36e47d8 | ||
|
|
63e1b75e57 | ||
|
|
29efdd8598 | ||
|
|
34d03cf11b | ||
|
|
c339389d44 | ||
|
|
af5f6eb656 | ||
|
|
a6d28e2553 | ||
|
|
6213267908 | ||
|
|
d084114149 | ||
|
|
f6d99eca0d | ||
|
|
722eb3289e | ||
|
|
b7f2bdcb2d | ||
|
|
11c20db6e6 | ||
|
|
8a4e3f8bb1 | ||
|
|
bc8fe97c13 | ||
|
|
47262155aa |
@@ -100,7 +100,7 @@ windowrule = float on, match:class ^(blueman-manager)$
|
||||
windowrule = float on, match:class ^(org\.gnome\.Nautilus)$
|
||||
windowrule = float on, match:class ^(xdg-desktop-portal)$
|
||||
|
||||
windowrule = no_initial_focus on, match:class ^(steam)$, match:title ^(notificationtoasts)
|
||||
windowrule = noinitialfocus 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)$
|
||||
|
||||
@@ -258,7 +258,7 @@ func (i *ExtWorkspaceManagerV1) Dispatch(opcode uint32, fd int, data []byte) {
|
||||
l := 0
|
||||
objectID := client.Uint32(data[l : l+4])
|
||||
proxy := i.Context().GetProxy(objectID)
|
||||
if proxy != nil && !proxy.IsZombie() {
|
||||
if proxy != nil {
|
||||
e.WorkspaceGroup = proxy.(*ExtWorkspaceGroupHandleV1)
|
||||
} else {
|
||||
groupHandle := &ExtWorkspaceGroupHandleV1{}
|
||||
@@ -278,7 +278,7 @@ func (i *ExtWorkspaceManagerV1) Dispatch(opcode uint32, fd int, data []byte) {
|
||||
l := 0
|
||||
objectID := client.Uint32(data[l : l+4])
|
||||
proxy := i.Context().GetProxy(objectID)
|
||||
if proxy != nil && !proxy.IsZombie() {
|
||||
if proxy != nil {
|
||||
e.Workspace = proxy.(*ExtWorkspaceHandleV1)
|
||||
} else {
|
||||
wsHandle := &ExtWorkspaceHandleV1{}
|
||||
|
||||
@@ -1 +1 @@
|
||||
The Wolverine
|
||||
Saffron Bloom
|
||||
|
||||
@@ -859,70 +859,6 @@ Item {
|
||||
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 {
|
||||
const widgets = BarWidgetService.getRegisteredWidgetIds();
|
||||
if (widgets.length === 0)
|
||||
|
||||
@@ -125,6 +125,13 @@ Item {
|
||||
}
|
||||
|
||||
readonly property var sectionDefinitions: [
|
||||
{
|
||||
id: "calculator",
|
||||
title: I18n.tr("Calculator"),
|
||||
icon: "calculate",
|
||||
priority: 0,
|
||||
defaultViewMode: "list"
|
||||
},
|
||||
{
|
||||
id: "favorites",
|
||||
title: I18n.tr("Pinned"),
|
||||
@@ -674,6 +681,12 @@ Item {
|
||||
return;
|
||||
}
|
||||
|
||||
var calculatorResult = evaluateCalculator(searchQuery);
|
||||
if (calculatorResult) {
|
||||
calculatorResult._preScored = 12000;
|
||||
allItems.push(calculatorResult);
|
||||
}
|
||||
|
||||
var apps = searchApps(searchQuery);
|
||||
for (var i = 0; i < apps.length; i++) {
|
||||
if (searchQuery)
|
||||
@@ -918,6 +931,13 @@ Item {
|
||||
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) {
|
||||
if (!query || query.length === 0)
|
||||
return {
|
||||
@@ -1539,6 +1559,9 @@ Item {
|
||||
case "file":
|
||||
openFile(item.data?.path);
|
||||
break;
|
||||
case "calculator":
|
||||
copyToClipboard(item.name);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,6 +101,35 @@ function detectIconType(iconName) {
|
||||
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) {
|
||||
if (!order || order.length === 0)
|
||||
return pluginIds;
|
||||
|
||||
@@ -190,6 +190,32 @@ 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) {
|
||||
var rawIcon = isBuiltIn ? (plugin.cornerIcon || "extension") : (plugin.icon || "extension");
|
||||
return {
|
||||
|
||||
@@ -178,6 +178,8 @@ Rectangle {
|
||||
if (!root.item)
|
||||
return "";
|
||||
switch (root.item.type) {
|
||||
case "calculator":
|
||||
return I18n.tr("Calc");
|
||||
case "plugin":
|
||||
return I18n.tr("Plugin");
|
||||
case "file":
|
||||
|
||||
@@ -91,12 +91,7 @@ DankModal {
|
||||
id: searchField
|
||||
Layout.alignment: Qt.AlignRight
|
||||
leftIconName: "search"
|
||||
keyForwardTargets: [root.modalFocusScope]
|
||||
onTextEdited: searchDebounce.restart()
|
||||
Keys.onEscapePressed: event => {
|
||||
root.close();
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,39 +8,10 @@ DankPopout {
|
||||
|
||||
layerNamespace: "dms:app-launcher"
|
||||
|
||||
property string _pendingMode: ""
|
||||
property string _pendingQuery: ""
|
||||
|
||||
function show() {
|
||||
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
|
||||
popupHeight: 640
|
||||
triggerWidth: 40
|
||||
@@ -59,25 +30,15 @@ DankPopout {
|
||||
var lc = contentLoader.item?.launcherContent;
|
||||
if (!lc)
|
||||
return;
|
||||
|
||||
const query = _pendingQuery;
|
||||
const mode = _pendingMode || "apps";
|
||||
_pendingMode = "";
|
||||
_pendingQuery = "";
|
||||
|
||||
if (lc.searchField) {
|
||||
lc.searchField.text = query;
|
||||
lc.searchField.text = "";
|
||||
lc.searchField.forceActiveFocus();
|
||||
}
|
||||
if (lc.controller) {
|
||||
lc.controller.searchMode = mode;
|
||||
lc.controller.searchMode = "apps";
|
||||
lc.controller.pluginFilter = "";
|
||||
lc.controller.searchQuery = "";
|
||||
if (query) {
|
||||
lc.controller.setSearchQuery(query);
|
||||
} else {
|
||||
lc.controller.performSearch();
|
||||
}
|
||||
lc.controller.performSearch();
|
||||
}
|
||||
lc.resetScroll?.();
|
||||
lc.actionPanel?.hide();
|
||||
|
||||
@@ -15,22 +15,18 @@ Item {
|
||||
property var pluginDetailInstance: null
|
||||
property var widgetModel: null
|
||||
property var collapseCallback: null
|
||||
property real maxAvailableHeight: 9999
|
||||
|
||||
function getDetailHeight(section) {
|
||||
const maxAvailable = parent ? parent.height - Theme.spacingS : 9999;
|
||||
switch (true) {
|
||||
case section === "wifi":
|
||||
case section === "bluetooth":
|
||||
case section === "builtin_vpn":
|
||||
return Math.min(350, maxAvailableHeight);
|
||||
return Math.min(350, maxAvailable);
|
||||
case section.startsWith("brightnessSlider_"):
|
||||
return Math.min(400, maxAvailableHeight);
|
||||
case section.startsWith("plugin_"):
|
||||
if (pluginDetailInstance?.ccDetailHeight)
|
||||
return Math.min(pluginDetailInstance.ccDetailHeight, maxAvailableHeight);
|
||||
return Math.min(250, maxAvailableHeight);
|
||||
return Math.min(400, maxAvailable);
|
||||
default:
|
||||
return Math.min(250, maxAvailableHeight);
|
||||
return Math.min(250, maxAvailable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,26 +31,11 @@ Column {
|
||||
|
||||
spacing: editMode ? Theme.spacingL : Theme.spacingS
|
||||
|
||||
property real maxPopoutHeight: 9999
|
||||
property var currentRowWidgets: []
|
||||
property real currentRowWidth: 0
|
||||
property int expandedRowIndex: -1
|
||||
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() {
|
||||
return LayoutUtils.calculateRowsAndWidgets(root, expandedSection, expandedWidgetIndex);
|
||||
}
|
||||
@@ -178,7 +163,6 @@ Column {
|
||||
DetailHost {
|
||||
id: detailHost
|
||||
width: parent.width
|
||||
maxAvailableHeight: root._maxDetailHeight
|
||||
height: active ? (getDetailHeight(root.expandedSection) + Theme.spacingS) : 0
|
||||
property bool active: {
|
||||
if (root.expandedSection === "")
|
||||
|
||||
@@ -116,7 +116,6 @@ DankPopout {
|
||||
property alias bluetoothCodecSelector: bluetoothCodecSelector
|
||||
|
||||
color: "transparent"
|
||||
clip: true
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
@@ -167,10 +166,6 @@ DankPopout {
|
||||
id: widgetGrid
|
||||
width: parent.width
|
||||
editMode: root.editMode
|
||||
maxPopoutHeight: {
|
||||
const screenHeight = (root.triggerScreen?.height ?? 1080);
|
||||
return screenHeight - 100 - Theme.spacingL - headerPane.height - Theme.spacingS;
|
||||
}
|
||||
expandedSection: root.expandedSection
|
||||
expandedWidgetIndex: root.expandedWidgetIndex
|
||||
expandedWidgetData: root.expandedWidgetData
|
||||
|
||||
@@ -642,52 +642,24 @@ Item {
|
||||
popoutTarget: appDrawerLoader.item
|
||||
parentScreen: barWindow.screen
|
||||
hyprlandOverviewLoader: barWindow ? barWindow.hyprlandOverviewLoader : null
|
||||
|
||||
function _preparePopout() {
|
||||
onClicked: {
|
||||
appDrawerLoader.active = true;
|
||||
if (!appDrawerLoader.item)
|
||||
return false;
|
||||
// Use topBarContent.barConfig directly since widget barConfig binding doesn't work in Components
|
||||
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));
|
||||
if (appDrawerLoader.item.setBarContext)
|
||||
if (appDrawerLoader.item && appDrawerLoader.item.setBarContext) {
|
||||
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 currentScreen = barWindow.screen;
|
||||
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);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
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");
|
||||
if (appDrawerLoader.item) {
|
||||
PopoutManager.requestPopout(appDrawerLoader.item, undefined, "appDrawer");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,12 +376,22 @@ FocusScope {
|
||||
return;
|
||||
var isLauncher = plugin.type === "launcher" || (plugin.capabilities && plugin.capabilities.includes("launcher"));
|
||||
if (isLauncher) {
|
||||
pluginsTab.isReloading = true;
|
||||
PluginService.reloadPlugin(pluginId);
|
||||
pluginReloadTimer.pendingPluginId = pluginId;
|
||||
pluginReloadTimer.restart();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: pluginReloadTimer
|
||||
property string pendingPluginId: ""
|
||||
interval: 500
|
||||
onTriggered: {
|
||||
if (pendingPluginId)
|
||||
PluginService.reloadPlugin(pendingPluginId);
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: DMSService
|
||||
function onPluginsListReceived(plugins) {
|
||||
|
||||
@@ -11,7 +11,7 @@ Singleton {
|
||||
id: root
|
||||
|
||||
readonly property string currentVersion: "1.4"
|
||||
readonly property bool changelogEnabled: false
|
||||
readonly property bool changelogEnabled: true
|
||||
|
||||
readonly property string configDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.ConfigLocation)) + "/DankMaterialShell"
|
||||
readonly property string changelogMarkerPath: configDir + "/.changelog-" + currentVersion
|
||||
|
||||
@@ -1 +1 @@
|
||||
v1.5-beta
|
||||
v1.4.1
|
||||
|
||||
Reference in New Issue
Block a user