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:
parent
d17b06ff65
commit
6abb37d6a1
@ -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);
|
||||
|
@ -53,7 +53,6 @@ public:
|
||||
void setShowMenuInside(bool inside);
|
||||
bool showMenuInside() const;
|
||||
|
||||
|
||||
signals:
|
||||
void middleMouseClicked();
|
||||
void controlClicked();
|
||||
|
Loading…
Reference in New Issue
Block a user