Skip to content

Commit 551a05c

Browse files
dengzhongyuan365-devlzwind
authored andcommitted
fix: hide color tool in effect (blur/mosaic) mode
Commit 81701e0 added m_colorTool->show() to the else branch of changeShotToolWidget, which is shared by all non-geometry tools. This overrides the earlier m_colorTool->setFunction("effect") call that correctly hides it, causing the color picker to appear in blur, mosaic, shape-blur and pen-blur modes where it is not needed. Add a dedicated branch for "effect" that keeps m_colorTool hidden. bug: https://pms.uniontech.com/bug-view-356071.html
1 parent b8054be commit 551a05c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/widgets/sidebar.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,16 @@ void SideBarWidget::changeShotToolWidget(const QString &func)
197197
qCDebug(dsrApp) << "Using AI assistant recommended size:" << recommendedSize;
198198
resize(recommendedSize);
199199
m_currentFunc = func;
200+
} else if (func == "effect") {
201+
// 模糊工具不需要颜色功能,隐藏颜色工具和形状工具
202+
qCDebug(dsrApp) << "Effect mode: hiding ShapeToolWidget and ColorToolWidget";
203+
m_shapeTool->hide();
204+
m_seperator1->hide();
205+
m_aiAssistantTool->hide();
206+
m_shotTool->show();
207+
m_colorTool->hide();
208+
setMinimumSize(TOOLBAR_WIDGET_SIZE1);
209+
m_currentFunc = func;
200210
} else {
201211
qCDebug(dsrApp) << "Non-geometry mode: hiding ShapeToolWidget";
202212
m_shapeTool->hide();
@@ -206,7 +216,7 @@ void SideBarWidget::changeShotToolWidget(const QString &func)
206216
m_colorTool->show();
207217
setMinimumSize(TOOLBAR_WIDGET_SIZE1);
208218
m_currentFunc = func;
209-
219+
210220
}
211221

212222
//不同图形下二级菜单的大小及长度不一样

0 commit comments

Comments
 (0)