From 8123279bdd61be242320affb2485430291e75bfd Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Tue, 13 Aug 2013 10:41:36 +0200 Subject: [PATCH] the desktop palette is moved at least a 30px from the top boarder in oder to not overlap top bar on mac --- src/desktop/UBDesktopPalette.cpp | 10 ++++++++++ src/desktop/UBDesktopPalette.h | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index 33ff38b8..d9d55088 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -101,6 +101,15 @@ UBDesktopPalette::~UBDesktopPalette() } +void UBDesktopPalette::adjustPosition() +{ + QPoint pos = this->pos(); + if(this->pos().y() < 30){ + pos.setY(30); + moveInsideParent(pos); + } +} + void UBDesktopPalette::disappearForCapture() { setWindowOpacity(0.0); @@ -209,6 +218,7 @@ void UBDesktopPalette::showEvent(QShowEvent *event) eraserIcon.addPixmap(QPixmap(":images/stylusPalette/eraserOnArrow.png"), QIcon::Normal, QIcon::On); UBApplication::mainWindow->actionEraser->setIcon(eraserIcon); + adjustPosition(); } void UBDesktopPalette::hideEvent(QHideEvent *event) diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h index 0d9bb593..d5258464 100644 --- a/src/desktop/UBDesktopPalette.h +++ b/src/desktop/UBDesktopPalette.h @@ -35,7 +35,7 @@ */ class UBDesktopPalette : public UBActionPalette { - Q_OBJECT; + Q_OBJECT public: UBDesktopPalette(QWidget *parent, UBRightPalette* rightPalette); @@ -71,7 +71,7 @@ protected: virtual int getParentRightOffset(); - private: +private: QAction *mShowHideAction; QAction *mDisplaySelectAction; QAction *mMaximizeAction; @@ -81,8 +81,10 @@ protected: UBRightPalette* rightPalette; + void adjustPosition(); - signals: + +signals: void stylusToolChanged(int tool); };