[apps] OK icon in graphs is in the top right corner

It doesn't move when the banner height changes
This commit is contained in:
Léa Saviot
2018-10-12 16:46:08 +02:00
committed by Émilie Feral
parent 8bffbf6ae7
commit ede20db6b9
2 changed files with 2 additions and 6 deletions

View File

@@ -558,12 +558,8 @@ KDRect CurveView::bannerFrame() {
KDRect CurveView::okFrame() {
KDRect okFrame = KDRectZero;
if (m_okView && (m_mainViewSelected || m_forceOkDisplay)) {
KDCoordinate bannerHeight = 0;
if (m_bannerView != nullptr) {
bannerHeight = m_bannerView->minimalSizeForOptimalDisplay().height();
}
KDSize okSize = m_okView->minimalSizeForOptimalDisplay();
okFrame = KDRect(bounds().width()- okSize.width()-k_okHorizontalMargin, bounds().height()- bannerHeight-okSize.height()-k_okVerticalMargin, okSize);
okFrame = KDRect(bounds().width()- okSize.width()-k_okHorizontalMargin, bounds().y()+k_okVerticalMargin, okSize);
}
return okFrame;
}

View File

@@ -38,7 +38,7 @@ protected:
// Drawing methods
virtual float samplingRatio() const;
constexpr static KDCoordinate k_labelMargin = 4;
constexpr static KDCoordinate k_okVerticalMargin = 23;
constexpr static KDCoordinate k_okVerticalMargin = 3;
constexpr static KDCoordinate k_okHorizontalMargin = 10;
constexpr static KDCoordinate k_labelGraduationLength = 6;
constexpr static int k_maxNumberOfXLabels = CurveViewRange::k_maxNumberOfXGridUnits;