Skip to content

Commit 82ea74e

Browse files
committed
feat: add left edge click signal for dock panel
1. Added leftEdgeClicked signal in DockPanel to handle clicks on the left margin area 2. Implemented MouseArea in QML to capture clicks on the left margin of the dock 3. The signal emits the minimum dockOrder value among all applet items when clicked 4. This allows special handling for edge interactions in the dock panel Log: Added left edge click functionality for dock panel Influence: 1. Test clicking on the left margin area of the dock panel 2. Verify that leftEdgeClicked signal is emitted with correct dockOrder value 3. Check that the signal works with different numbers of applet items 4. Test with various dock configurations and orientations 5. Verify that the click area doesn't interfere with existing applet functionality feat: 为任务栏面板添加左侧边缘点击信号 1. 在DockPanel中添加leftEdgeClicked信号以处理左侧边距区域的点击 2. 在QML中实现MouseArea来捕获任务栏左侧边距的点击 3. 这使得任务栏面板能够特殊处理边缘交互 Log: 新增任务栏面板左侧边缘点击功能 Influence: 1. 测试点击任务栏面板的左侧边距区域 2. 验证leftEdgeClicked信号是否以正确的dockOrder值发射 3. 检查信号在不同数量的小程序项下的工作情况 4. 使用不同的任务栏配置和方向进行测试 5. 验证点击区域不会干扰现有小程序功能 PMS: BUG-345931
1 parent c50c790 commit 82ea74e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

panels/dock/dockpanel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ private Q_SLOTS:
127127
void dockScreenChanged(QScreen *screen);
128128
void screenNameChanged();
129129
void requestClosePopup();
130+
void leftEdgeClicked(const QString &itemName);
130131
void devicePixelRatioChanged(qreal ratio);
131132
void lockedChanged(bool locked);
132133

panels/dock/package/main.qml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,26 @@ Window {
447447
}
448448
}
449449
}
450-
450+
//此处为边距区域的点击实践特殊处理。
451+
MouseArea {
452+
id: leftMarginArea
453+
z: 1
454+
width: useColumnLayout ? parent.width : gridLayout.columnSpacing
455+
height: useColumnLayout ? gridLayout.rowSpacing : parent.height
456+
anchors.left: parent.left
457+
anchors.top: parent.top
458+
onClicked: {
459+
let minOrder = Number.MAX_VALUE
460+
461+
for (let i = 0; i < Applet.appletItems.rowCount(); i++) {
462+
let itemData = Applet.appletItems.data(Applet.appletItems.index(i, 0), Qt.UserRole + 1)
463+
if (itemData && itemData.dockOrder < minOrder) {
464+
minOrder = itemData.dockOrder
465+
}
466+
}
467+
Panel.leftEdgeClicked(minOrder)
468+
}
469+
}
451470
// TODO: remove GridLayout and use delegatechosser manager all items
452471
GridLayout {
453472
id: gridLayout

0 commit comments

Comments
 (0)