mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Merge branch 'lea-statistics' into upgrade-1.6.0
This commit is contained in:
52
apps/shared/buffer_function_title_cell.cpp
Normal file
52
apps/shared/buffer_function_title_cell.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#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() {
|
||||
m_bufferTextView.setFrame(bufferTextViewFrame());
|
||||
}
|
||||
|
||||
KDRect BufferFunctionTitleCell::bufferTextViewFrame() const {
|
||||
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-k_separatorThickness, bounds().height()-k_separatorThickness);
|
||||
}
|
||||
return textFrame;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user