D9973: ktooltipwidget: Fix tooltip positioning

Elvis Angelaccio noreply at phabricator.kde.org
Sat Mar 10 19:01:21 UTC 2018


elvisangelaccio added a comment.


  Almost there! Just minor comments.

INLINE COMMENTS

> ktooltipwidgettest.cpp:195
> +    QLabel* contentWidget = new QLabel(content);
> +    const QSize shrinkSize{2 * m_offset, 2 * m_offset};
> +    contentWidget->setMaximumSize(m_screenGeometry.size() - shrinkSize);

Don't use the `{}` constructor syntax only here, it breaks consistency.

> ktooltipwidget.cpp:32
>  #include <QWindow>
> +#include <QDebug>
>  

Please remove this include.

> ktooltipwidget.cpp:125
>      const QRect screenGeometry = screen->geometry();
> -
> +    const int margin = q->style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth);
> +    

Is there a reason why you moved this line?

> ktooltipwidget.cpp:131
>      const bool hasRoomBelow   = (rect.bottom() + size.height() + margin <= screenGeometry.bottom());
> +    
>      if (!hasRoomAbove && !hasRoomBelow && !hasRoomToLeft && !hasRoomToRight) {

unrelated whitespace change

> ktooltipwidget.cpp:143
>          }
> +
>          if (hasRoomBelow) {

unrelated whitespace change

REPOSITORY
  R236 KWidgetsAddons

REVISION DETAIL
  https://phabricator.kde.org/D9973

To: michaelh, elvisangelaccio, #frameworks, #dolphin, ngraham
Cc: dfaure, cfeck, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180310/653b7013/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list