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:
chenzhe 2020-01-14 16:49:31 +08:00
parent 07a53d1c16
commit fec57ae368
3 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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();
}
}