mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher/solid_text_area] Remove unused class
This commit is contained in:
@@ -60,7 +60,6 @@ escher_src += $(addprefix escher/src/,\
|
||||
simple_list_view_data_source.cpp \
|
||||
simple_table_view_data_source.cpp \
|
||||
solid_color_view.cpp \
|
||||
solid_text_area.cpp \
|
||||
stack_view.cpp \
|
||||
stack_view_controller.cpp \
|
||||
switch_view.cpp \
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#ifndef ESCHER_SOLID_TEXT_AREA_H
|
||||
#define ESCHER_SOLID_TEXT_AREA_H
|
||||
|
||||
#include <escher/palette.h>
|
||||
#include <escher/text_area.h>
|
||||
|
||||
/* SolidTextArea is a text area that draws text in a single solid color over a
|
||||
* solid background. */
|
||||
|
||||
class SolidTextArea : public TextArea {
|
||||
public:
|
||||
SolidTextArea(Responder * parentResponder, const KDFont * font = KDFont::LargeFont,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite) :
|
||||
TextArea(parentResponder, &m_contentView, font),
|
||||
m_contentView(font, textColor, backgroundColor) {}
|
||||
protected:
|
||||
class ContentView : public TextArea::ContentView {
|
||||
public:
|
||||
ContentView(const KDFont * font, KDColor textColor, KDColor backgroundColor, KDColor backgroundHighlightColor = Palette::Select) :
|
||||
TextArea::ContentView(font),
|
||||
m_textColor(textColor),
|
||||
m_backgroundColor(backgroundColor),
|
||||
m_backgroundHighlightColor(backgroundHighlightColor)
|
||||
{
|
||||
}
|
||||
void clearRect(KDContext * ctx, KDRect rect) const override;
|
||||
void drawLine(KDContext * ctx, int line, const char * text, size_t length, int fromColumn, int toColumn, const char * selectionStart, const char * selectionEnd) const override;
|
||||
private:
|
||||
KDColor m_textColor;
|
||||
KDColor m_backgroundColor;
|
||||
KDColor m_backgroundHighlightColor;
|
||||
};
|
||||
|
||||
private:
|
||||
const ContentView * nonEditableContentView() const override { return &m_contentView; }
|
||||
ContentView m_contentView;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <escher/solid_text_area.h>
|
||||
|
||||
static inline int minInt(int x, int y) { return x < y ? x : y; }
|
||||
|
||||
void SolidTextArea::ContentView::clearRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(rect, m_backgroundColor);
|
||||
}
|
||||
|
||||
void SolidTextArea::ContentView::drawLine(KDContext * ctx, int line, const char * text, size_t length, int fromColumn, int toColumn, const char * selectionStart, const char * selectionEnd) const {
|
||||
drawStringAt(
|
||||
ctx,
|
||||
line,
|
||||
fromColumn,
|
||||
text + fromColumn,
|
||||
minInt(length - fromColumn, toColumn - fromColumn),
|
||||
m_textColor,
|
||||
m_backgroundColor,
|
||||
selectionStart,
|
||||
selectionEnd,
|
||||
m_backgroundHighlightColor);
|
||||
}
|
||||
Reference in New Issue
Block a user