|
|
|
@ -92,24 +92,29 @@ UBStylusPalette::UBStylusPalette(QWidget *parent, Qt::Orientation orient) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBStylusPalette::initPosition() |
|
|
|
|
{ |
|
|
|
|
if(!UBSettings::settings()->appToolBarOrientationVertical->get().toBool()) |
|
|
|
|
{ |
|
|
|
|
QWidget* pParentW = parentWidget(); |
|
|
|
|
if(NULL != pParentW) |
|
|
|
|
{ |
|
|
|
|
if(!pParentW) return ; |
|
|
|
|
|
|
|
|
|
mCustomPosition = true; |
|
|
|
|
|
|
|
|
|
QPoint pos; |
|
|
|
|
int parentWidth = pParentW->width(); |
|
|
|
|
int parentHeight = pParentW->height(); |
|
|
|
|
int posX = (parentWidth / 2) - (width() / 2); |
|
|
|
|
int posY = parentHeight - border() - height(); |
|
|
|
|
|
|
|
|
|
if(UBSettings::settings()->appToolBarOrientationVertical->get().toBool()){ |
|
|
|
|
int posX = border(); |
|
|
|
|
int posY = (parentHeight / 2) - (height() / 2); |
|
|
|
|
pos.setX(posX); |
|
|
|
|
pos.setY(posY); |
|
|
|
|
moveInsideParent(pos); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
int posX = (parentWidth / 2) - (width() / 2); |
|
|
|
|
int posY = parentHeight - border() - height(); |
|
|
|
|
pos.setX(posX); |
|
|
|
|
pos.setY(posY); |
|
|
|
|
} |
|
|
|
|
moveInsideParent(pos); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
UBStylusPalette::~UBStylusPalette() |
|
|
|
|