Fix text box title bar height/spacing when zooming

preferencesAboutTextFull
Craig Watson 8 years ago
parent 0491ce9e0b
commit d6295358a6
  1. 2
      src/domain/UBGraphicsDelegateFrame.cpp
  2. 1
      src/domain/UBGraphicsDelegateFrame.h
  3. 2
      src/domain/UBGraphicsItemDelegate.cpp

@ -66,6 +66,7 @@ UBGraphicsDelegateFrame::UBGraphicsDelegateFrame(UBGraphicsItemDelegate* pDelega
, mMirrorX(false)
, mMirrorY(false)
, mTitleBarHeight(hasTitleBar ? 20 :0)
, mNominalTitleBarHeight(hasTitleBar ? 20:0)
{
mAngleTolerance = UBSettings::settings()->angleTolerance->get().toReal();
@ -117,6 +118,7 @@ UBGraphicsDelegateFrame::~UBGraphicsDelegateFrame()
void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale)
{
mFrameWidth = mNominalFrameWidth * pAntiScale;
mTitleBarHeight = mNominalTitleBarHeight * pAntiScale;
QTransform tr;
tr.scale(pAntiScale, pAntiScale);

@ -143,6 +143,7 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
bool mMirroredXAtStart;
bool mMirroredYAtStart;
qreal mTitleBarHeight;
qreal mNominalTitleBarHeight;
QList<UBGraphicsDelegateFrame *> mLinkedFrames;
};

@ -790,7 +790,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
}
else if (button->getSection() == Qt::TitleBarArea){
button->setParentItem(mFrame);
button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5)), topYTitleBar);
button->setPos(topXTitleBar + (k++ * (frameButtonHeight + 5) * mAntiScaleRatio), topYTitleBar);
button->setTransform(tr);
button->setTransform(QTransform::fromScale(0.8, 0.8), true);
}

Loading…
Cancel
Save