Commit d6295358 authored by Craig Watson's avatar Craig Watson

Fix text box title bar height/spacing when zooming

parent 0491ce9e
...@@ -66,6 +66,7 @@ UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelega ...@@ -66,6 +66,7 @@ UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelega
, mMirrorX(false) , mMirrorX(false)
, mMirrorY(false) , mMirrorY(false)
, mTitleBarHeight(hasTitleBar ? 20 :0) , mTitleBarHeight(hasTitleBar ? 20 :0)
, mNominalTitleBarHeight(hasTitleBar ? 20:0)
{ {
mAngleTolerance = UBSettings::settings()->angleTolerance->get().toReal(); mAngleTolerance = UBSettings::settings()->angleTolerance->get().toReal();
...@@ -117,6 +118,7 @@ UBGraphicsDelegateFrame::~UBGraphicsDelegateFrame() ...@@ -117,6 +118,7 @@ UBGraphicsDelegateFrame::~UBGraphicsDelegateFrame()
void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale) void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale)
{ {
mFrameWidth = mNominalFrameWidth * pAntiScale; mFrameWidth = mNominalFrameWidth * pAntiScale;
mTitleBarHeight = mNominalTitleBarHeight * pAntiScale;
QTransform tr; QTransform tr;
tr.scale(pAntiScale, pAntiScale); tr.scale(pAntiScale, pAntiScale);
......
...@@ -143,6 +143,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject ...@@ -143,6 +143,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
bool mMirroredXAtStart; bool mMirroredXAtStart;
bool mMirroredYAtStart; bool mMirroredYAtStart;
qreal mTitleBarHeight; qreal mTitleBarHeight;
qreal mNominalTitleBarHeight;
QList<UBGraphicsDelegateFrame *> mLinkedFrames; QList<UBGraphicsDelegateFrame *> mLinkedFrames;
}; };
......
...@@ -790,7 +790,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated) ...@@ -790,7 +790,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
} }
else if (button->getSection() == Qt::TitleBarArea){ else if (button->getSection() == Qt::TitleBarArea){
button->setParentItem(mFrame); button->setParentItem(mFrame);
button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5)), topYTitleBar); button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5) * mAntiScaleRatio), topYTitleBar);
button->setTransform(tr); button->setTransform(tr);
button->setTransform(QTransform::fromScale(0.8, 0.8), true); button->setTransform(QTransform::fromScale(0.8, 0.8), true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment