mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge branch 'main' into dock-group-apps
This commit is contained in:
+30
-9
@@ -95,6 +95,23 @@ Loader {
|
||||
readonly property bool hasBar: modelData && modelData.name ? (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0)) : false
|
||||
readonly property bool barAtSameEdge: hasBar && Settings.getBarPositionForScreen(modelData?.name) === dockPosition
|
||||
readonly property int barHeight: Style.getBarHeightForScreen(modelData?.name)
|
||||
readonly property int peekEdgeLength: {
|
||||
const edgeSize = isVertical ? Math.round(modelData?.height || maxHeight) : Math.round(modelData?.width || maxWidth);
|
||||
const minLength = Math.max(1, Math.round(edgeSize * 0.1));
|
||||
return Math.max(minLength, frameIndicatorLength);
|
||||
}
|
||||
readonly property int peekCenterOffsetX: {
|
||||
if (isVertical)
|
||||
return 0;
|
||||
const edgeSize = Math.round(modelData?.width || maxWidth);
|
||||
return Math.max(0, Math.round((edgeSize - peekEdgeLength) / 2));
|
||||
}
|
||||
readonly property int peekCenterOffsetY: {
|
||||
if (!isVertical)
|
||||
return 0;
|
||||
const edgeSize = Math.round(modelData?.height || maxHeight);
|
||||
return Math.max(0, Math.round((edgeSize - peekEdgeLength) / 2));
|
||||
}
|
||||
readonly property bool showFrameIndicator: {
|
||||
if (!isStaticMode || !Settings.data.dock.showFrameIndicator || Settings.data.bar.barType !== "framed" || !hasBar)
|
||||
return false;
|
||||
@@ -103,12 +120,12 @@ Loader {
|
||||
return !panel.isPanelOpen;
|
||||
return hidden;
|
||||
}
|
||||
readonly property int dockItemCount: dockApps.length + (Settings.data.dock.showLauncherIcon ? 1 : 0)
|
||||
readonly property int frameIndicatorLength: {
|
||||
const count = dockApps.length;
|
||||
if (count <= 0)
|
||||
if (dockItemCount <= 0)
|
||||
return 0;
|
||||
const spacing = Style.marginS;
|
||||
const layoutLength = (iconSize * count) + (spacing * Math.max(0, count - 1));
|
||||
const layoutLength = (iconSize * dockItemCount) + (spacing * Math.max(0, dockItemCount - 1));
|
||||
const padded = layoutLength + Style.marginXL;
|
||||
return Math.min(padded, isVertical ? maxHeight : maxWidth);
|
||||
}
|
||||
@@ -574,6 +591,8 @@ Loader {
|
||||
onTriggered: {
|
||||
if (autoHide) {
|
||||
if (isStaticMode) {
|
||||
if (dockItemCount <= 0)
|
||||
return;
|
||||
const panel = getStaticDockPanel();
|
||||
if (panel && !panel.isPanelOpen)
|
||||
panel.open();
|
||||
@@ -610,23 +629,23 @@ Loader {
|
||||
screen: modelData
|
||||
// Dynamic anchors based on dock position
|
||||
anchors.top: dockPosition === "top" || isVertical
|
||||
anchors.bottom: dockPosition === "bottom" || isVertical
|
||||
anchors.bottom: dockPosition === "bottom"
|
||||
anchors.left: dockPosition === "left" || !isVertical
|
||||
anchors.right: dockPosition === "right" || !isVertical
|
||||
anchors.right: dockPosition === "right"
|
||||
focusable: false
|
||||
color: "transparent"
|
||||
|
||||
// When bar is at same edge, position peek window past the bar so it receives mouse events
|
||||
margins.top: dockPosition === "top" && barAtSameEdge && !showFrameIndicator ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0
|
||||
margins.top: isVertical ? peekCenterOffsetY : (dockPosition === "top" && barAtSameEdge && !showFrameIndicator ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0)
|
||||
margins.bottom: dockPosition === "bottom" && barAtSameEdge && !showFrameIndicator ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginVertical : 0)) : 0
|
||||
margins.left: dockPosition === "left" && barAtSameEdge && !showFrameIndicator ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0)) : 0
|
||||
margins.left: !isVertical ? peekCenterOffsetX : (dockPosition === "left" && barAtSameEdge && !showFrameIndicator ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0)) : 0)
|
||||
margins.right: dockPosition === "right" && barAtSameEdge && !showFrameIndicator ? (barHeight + (Settings.data.bar.floating ? Settings.data.bar.marginHorizontal : 0)) : 0
|
||||
|
||||
WlrLayershell.namespace: "noctalia-dock-peek-" + (screen?.name || "unknown")
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
// Larger peek area when bar is at same edge, normal 1px otherwise
|
||||
implicitHeight: showFrameIndicator ? (isVertical ? Math.round(modelData?.height || 0) : indicatorThickness) : (barAtSameEdge && !isVertical ? indicatorThickness : peekHeight)
|
||||
implicitWidth: showFrameIndicator ? (isVertical ? indicatorThickness : Math.round(modelData?.width || 0)) : (barAtSameEdge && isVertical ? indicatorThickness : peekHeight)
|
||||
implicitHeight: isVertical ? peekEdgeLength : ((showFrameIndicator || barAtSameEdge) ? indicatorThickness : peekHeight)
|
||||
implicitWidth: isVertical ? ((showFrameIndicator || barAtSameEdge) ? indicatorThickness : peekHeight) : peekEdgeLength
|
||||
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
@@ -653,6 +672,8 @@ Loader {
|
||||
onEntered: {
|
||||
peekHovered = true;
|
||||
if (isStaticMode && !autoHide) {
|
||||
if (dockItemCount <= 0)
|
||||
return;
|
||||
const panel = getStaticDockPanel();
|
||||
if (panel && !panel.isPanelOpen)
|
||||
panel.open();
|
||||
|
||||
@@ -246,8 +246,16 @@ Item {
|
||||
}
|
||||
readonly property var launcherMetadata: BarWidgetRegistry.widgetMetadata["Launcher"]
|
||||
readonly property string launcherIcon: launcherWidgetSettings.icon || (launcherMetadata && launcherMetadata.icon ? launcherMetadata.icon : "search")
|
||||
readonly property string launcherIconColorKey: launcherWidgetSettings.iconColor !== undefined ? launcherWidgetSettings.iconColor : (launcherMetadata && launcherMetadata.iconColor !== undefined ? launcherMetadata.iconColor : "none")
|
||||
|
||||
readonly property string launcherIconColorKey: {
|
||||
if (Settings.data.dock.launcherIconColor !== undefined)
|
||||
return Settings.data.dock.launcherIconColor;
|
||||
if (launcherWidgetSettings.iconColor !== undefined)
|
||||
return launcherWidgetSettings.iconColor;
|
||||
if (launcherMetadata && launcherMetadata.iconColor !== undefined)
|
||||
return launcherMetadata.iconColor;
|
||||
return "none";
|
||||
}
|
||||
|
||||
Item {
|
||||
id: launcherIconContainer
|
||||
width: dockRoot.iconSize
|
||||
|
||||
@@ -165,13 +165,6 @@ PopupWindow {
|
||||
"action": function () {
|
||||
handleLauncherSettings();
|
||||
}
|
||||
},
|
||||
{
|
||||
"icon": "settings",
|
||||
"text": I18n.tr("actions.widget-settings"),
|
||||
"action": function () {
|
||||
handleLauncherWidgetSettings();
|
||||
}
|
||||
}
|
||||
];
|
||||
calculateMenuWidth();
|
||||
|
||||
Reference in New Issue
Block a user