[apps/stats] Display the labels of the bottom histogram only

This commit is contained in:
Léa Saviot
2018-05-23 14:44:38 +02:00
parent db94ba351f
commit ac59105a46
5 changed files with 24 additions and 12 deletions

View File

@@ -101,13 +101,18 @@ void HistogramController::ContentView::layoutSubviews() {
KDCoordinate bannerHeight = bannerFrame().height();
KDCoordinate subviewHeight = (bounds().height() - bannerHeight)/numberHistogramSubviews;
int displayedSubviewIndex = 0;
int bottomSeriesDisplayed = -1;
for (int i = 0; i < 3; i++) {
if (!m_store->seriesIsEmpty(i)) {
histogramViewAtIndex(i)->setDisplayLabels(false);
KDRect frame = KDRect(0, displayedSubviewIndex*subviewHeight, bounds().width(), subviewHeight);
subviewAtIndex(displayedSubviewIndex)->setFrame(frame);
displayedSubviewIndex++;
bottomSeriesDisplayed = i;
}
}
assert(bottomSeriesDisplayed >= 0);
histogramViewAtIndex(bottomSeriesDisplayed)->setDisplayLabels(true);
if (m_displayBanner) {
m_bannerView.setFrame(bannerFrame());
} else {