From a19701c2529d6f7ab505a59a8c89c6e36d2e3c95 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 10 Jul 2017 11:55:27 +0200 Subject: [PATCH] [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 --- src/plasmaquick/dialog.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index 6b6922ace..a1416dbb2 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -209,7 +209,7 @@ void DialogPrivate::syncBorders(const QRect& geom) //Tooltips always have all the 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) { borders = borders & ~Plasma::FrameSvg::LeftBorder; } @@ -314,8 +314,7 @@ void DialogPrivate::updateVisibility(bool visible) } } - - if (!(q->flags() & Qt::ToolTip) && type != Dialog::Notification) { + if (!q->flags().testFlag(Qt::ToolTip) && type != Dialog::Notification) { KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge; switch (location) { @@ -675,7 +674,7 @@ void DialogPrivate::slotWindowPositionChanged() { // Tooltips always have all the 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; }