[Plasma Dialog] Fix flag conditions

The code wants to check whether we're not a tooltip. This wasn't done properly and didn't work
when other flags were present.

Differential Revision: https://phabricator.kde.org/D6554
This commit is contained in:
Kai Uwe Broulik 2017-07-10 11:55:27 +02:00
parent 8e24c87d8f
commit a19701c252

View File

@ -209,7 +209,7 @@ void DialogPrivate::syncBorders(const QRect& geom)
//Tooltips always have all the borders //Tooltips always have all the borders
// floating windows have all borders // floating windows have all borders
if ((q->flags() & Qt::ToolTip) != Qt::ToolTip && location != Plasma::Types::Floating) { if (!q->flags().testFlag(Qt::ToolTip) && location != Plasma::Types::Floating) {
if (geom.x() <= avail.x() || location == Plasma::Types::LeftEdge) { if (geom.x() <= avail.x() || location == Plasma::Types::LeftEdge) {
borders = borders & ~Plasma::FrameSvg::LeftBorder; borders = borders & ~Plasma::FrameSvg::LeftBorder;
} }
@ -314,8 +314,7 @@ void DialogPrivate::updateVisibility(bool visible)
} }
} }
if (!q->flags().testFlag(Qt::ToolTip) && type != Dialog::Notification) {
if (!(q->flags() & Qt::ToolTip) && type != Dialog::Notification) {
KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge; KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge;
switch (location) { switch (location) {
@ -675,7 +674,7 @@ void DialogPrivate::slotWindowPositionChanged()
{ {
// Tooltips always have all the borders // Tooltips always have all the borders
// floating windows have all borders // floating windows have all borders
if (!q->isVisible() || (q->flags() & Qt::ToolTip) || location == Plasma::Types::Floating) { if (!q->isVisible() || q->flags().testFlag(Qt::ToolTip) || location == Plasma::Types::Floating) {
return; return;
} }