1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

[SuperButton] Show menu correctly inside with RTL layout.

This commit is contained in:
nowrep 2013-06-09 12:54:50 +02:00
parent d17b06ff65
commit 6abb37d6a1
2 changed files with 7 additions and 2 deletions

View File

@ -20,6 +20,7 @@
#include <QMouseEvent>
#include <QMenu>
#include <QPainter>
#include <QApplication>
#include <QStyleOptionToolButton>
ToolButton::ToolButton(QWidget* parent)
@ -144,7 +145,12 @@ void ToolButton::showMenu()
}
QPoint pos = mapToGlobal(rect().bottomRight());
pos.setX(pos.x() - m->sizeHint().width());
if (QApplication::layoutDirection() == Qt::RightToLeft) {
pos.setX(pos.x() - rect().width());
}
else {
pos.setX(pos.x() - m->sizeHint().width());
}
setDown(true);
m->exec(pos);

View File

@ -53,7 +53,6 @@ public:
void setShowMenuInside(bool inside);
bool showMenuInside() const;
signals:
void middleMouseClicked();
void controlClicked();