mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix(dde-dock):The tray plug-in icon is more likely to pop up the taskbar properties window than the IME properties window.
托盘插件图标点击后较高几率弹出的是任务栏属性窗口而不是输入法属性窗口。 (bug:10461)
This commit is contained in:
parent
07a53d1c16
commit
fec57ae368
@ -198,8 +198,8 @@ const QRect DockItem::perfectIconRect() const
|
||||
QRect iconRect;
|
||||
|
||||
if (itemType() == Plugins) {
|
||||
iconRect.setWidth(itemRect.width() * 0.9);
|
||||
iconRect.setHeight(itemRect.height() * 0.9);
|
||||
iconRect.setWidth(itemRect.width());
|
||||
iconRect.setHeight(itemRect.height());
|
||||
} else {
|
||||
const int iconSize = std::min(itemRect.width(), itemRect.height()) * 0.8;
|
||||
iconRect.setWidth(iconSize);
|
||||
|
@ -47,7 +47,7 @@ void AbstractTrayWidget::mousePressEvent(QMouseEvent *event)
|
||||
// when right button of mouse is pressed immediately in fashion mode
|
||||
|
||||
// here we hide the right button press event when it is click in the special area
|
||||
if (event->button() == Qt::RightButton && perfectIconRect().contains(event->pos())) {
|
||||
if (event->button() == Qt::RightButton && perfectIconRect().contains(event->pos(), true)) {
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
@ -108,7 +108,7 @@ void AbstractTrayWidget::handleMouseRelease()
|
||||
const QRect AbstractTrayWidget::perfectIconRect() const
|
||||
{
|
||||
const QRect itemRect = rect();
|
||||
const int iconSize = std::min(itemRect.width(), itemRect.height()) * 0.8;
|
||||
const int iconSize = std::min(itemRect.width(), itemRect.height());
|
||||
|
||||
QRect iconRect;
|
||||
iconRect.setWidth(iconSize);
|
||||
|
@ -219,7 +219,7 @@ void SystemTrayItem::mousePressEvent(QMouseEvent *event)
|
||||
hideNonModel();
|
||||
|
||||
if (event->button() == Qt::RightButton) {
|
||||
if (perfectIconRect().contains(event->pos())) {
|
||||
if (perfectIconRect().contains(event->pos(), true)) {
|
||||
return showContextMenu();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user