fix: remove inner highlight from calendar selection box#341
Conversation
1. Removed the inner white highlight effect from selected date boxes in the calendar widget 2. The highlight was visually unnecessary and didn't match current design guidelines 3. Simplified the painting logic by removing redundant pen color changes 4. Maintains the outer selection indicator while removing the inner decoration fix: 移除日历选择框的内层高光效果 1. 移除了日历组件中日期选择框的内层白色高光效果 2. 该高光效果视觉上不必要且不符合当前设计规范 3. 通过移除多余的画笔颜色变化简化了绘制逻辑 4. 保留外层选择指示器同时移除了内部装饰效果 Pms: BUG-317321
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThis PR refines the calendar widget's paintEvent by removing the inner white highlight around selected date boxes and associated redundant pen color changes, while preserving the outer selection indicator. Class diagram for SidebarCalendarKeyButton paintEvent changesclassDiagram
class SidebarCalendarKeyButton {
+void paintEvent(QPaintEvent* event)
}
SidebarCalendarKeyButton : - Removed inner white highlight drawing logic
SidebarCalendarKeyButton : - Removed redundant pen color changes
SidebarCalendarKeyButton : + Maintains outer selection indicator drawing
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review代码审查意见如下:
根据以上意见,代码可以修改为: void SidebarCalendarKeyButton::paintEvent(QPaintEvent* event)
{
// ... 其他代码 ...
if (m_isSelected) {
// 绘制选中框外圈
pen.setColor(Qt::black);
pen.setWidth(RECT_PENWIDTH);
painter.setPen(pen);
painter.drawRoundedRect(rectf.adjusted(-RECT_PENWIDTH, -RECT_PENWIDTH, RECT_PENWIDTH, RECT_PENWIDTH), ROUND_CORNER, ROUND_CORNER);
// 绘制选中框内圈白色高光
pen.setColor(Qt::white);
pen.setWidth(1);
painter.setPen(pen);
painter.drawRoundedRect(rectf.adjusted(RECT_PENWIDTH + RECT_MARGINS + 1, RECT_PENWIDTH + RECT_MARGINS + 1, -RECT_PENWIDTH - RECT_MARGINS - 1, -RECT_PENWIDTH - RECT_MARGINS - 1), ROUND_CORNER - RECT_PENWIDTH, ROUND_CORNER - RECT_PENWIDTH);
pen.setColor(pa.windowText().color());
painter.setPen(pen);
} else if (!m_isThisMonth) {
// 设置正常显示状态下的字体颜色
painter.setOpacity(0.3);
// ... 其他代码 ...
}
}以上修改旨在提高代码的可读性、可维护性和性能。 |
|
/forcemerge |
fix: 移除日历选择框的内层高光效果
Pms: BUG-317321
Summary by Sourcery
Remove unnecessary inner decoration from calendar selection boxes while preserving the outer selection indicator
Bug Fixes:
Enhancements: