Skip to content

Commit e645441

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 e645441

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

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 &minOrder);
130131
void devicePixelRatioChanged(qreal ratio);
131132
void lockedChanged(bool locked);
132133

panels/dock/package/main.qml

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

0 commit comments

Comments
 (0)