[apps] Color Series names if not empty in Statistics

This commit is contained in:
Léa Saviot
2018-05-22 11:42:08 +02:00
parent 54ca272eb1
commit b1e732e135
10 changed files with 38 additions and 37 deletions

View File

@@ -0,0 +1,48 @@
#include "buffer_function_title_cell.h"
#include <assert.h>
namespace Shared {
BufferFunctionTitleCell::BufferFunctionTitleCell(Orientation orientation, KDText::FontSize size) :
FunctionTitleCell(orientation),
m_bufferTextView(size, 0.5f, 0.5f)
{
}
void BufferFunctionTitleCell::setHighlighted(bool highlight) {
EvenOddCell::setHighlighted(highlight);
m_bufferTextView.setHighlighted(highlight);
}
void BufferFunctionTitleCell::setEven(bool even) {
EvenOddCell::setEven(even);
m_bufferTextView.setEven(even);
}
void BufferFunctionTitleCell::setColor(KDColor color) {
FunctionTitleCell::setColor(color);
m_bufferTextView.setTextColor(color);
}
void BufferFunctionTitleCell::setText(const char * title) {
m_bufferTextView.setText(title);
}
int BufferFunctionTitleCell::numberOfSubviews() const {
return 1;
}
View * BufferFunctionTitleCell::subviewAtIndex(int index) {
assert(index == 0);
return &m_bufferTextView;
}
void BufferFunctionTitleCell::layoutSubviews() {
KDRect textFrame(0, k_colorIndicatorThickness, bounds().width(), bounds().height() - k_colorIndicatorThickness);
if (m_orientation == Orientation::VerticalIndicator){
textFrame = KDRect(k_colorIndicatorThickness, 0, bounds().width() - k_colorIndicatorThickness, bounds().height()-k_separatorThickness);
}
m_bufferTextView.setFrame(textFrame);
}
}