mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[escher] Make one constructor only for views
Change-Id: I304a49995beb59071dd88fcfad8715bdb58e6685
This commit is contained in:
@@ -5,8 +5,7 @@
|
||||
|
||||
class BufferTextView : public TextView {
|
||||
public:
|
||||
BufferTextView();
|
||||
BufferTextView(float horizontalAlignment, float verticalAlignment,
|
||||
BufferTextView(float horizontalAlignment = 0.5f, float verticalAlignment = 0.5f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void setText(const char * text);
|
||||
const char * text() const override;
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
|
||||
class PointerTextView : public TextView {
|
||||
public:
|
||||
PointerTextView();
|
||||
PointerTextView(const char * text, float horizontalAlignment, float verticalAlignment,
|
||||
PointerTextView(const char * text = nullptr, float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void setText(const char * text);
|
||||
protected:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
class SwitchMenuListCell : public MenuListCell {
|
||||
public:
|
||||
SwitchMenuListCell(char * label);
|
||||
SwitchMenuListCell(char * label = nullptr);
|
||||
View * accessoryView() const override;
|
||||
private:
|
||||
SwitchView m_accessoryView;
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
class TextView : public View {
|
||||
public:
|
||||
TextView();//;: TextView(nullptr, 0.0f, 0.0f);
|
||||
// alignment = 0 -> align left or top
|
||||
// alignment = 0.5 -> align center
|
||||
// alignment = 1.0 -> align right or bottom
|
||||
TextView(float horizontalAlignment, float verticalAlignment, KDColor textColor, KDColor backgroundColor);
|
||||
TextView(float horizontalAlignment = 0.0f, float verticalAlignment = 0.0f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void setBackgroundColor(KDColor backgroundColor);
|
||||
void setTextColor(KDColor textColor);
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
BufferTextView::BufferTextView() :
|
||||
TextView(0.5f, 0.5f, KDColorBlack, KDColorWhite)
|
||||
{
|
||||
}
|
||||
|
||||
BufferTextView::BufferTextView(float horizontalAlignment, float verticalAlignment,
|
||||
KDColor textColor, KDColor backgroundColor) :
|
||||
TextView(horizontalAlignment, verticalAlignment, textColor, backgroundColor)
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
#include <escher/pointer_text_view.h>
|
||||
|
||||
PointerTextView::PointerTextView() :
|
||||
TextView(),
|
||||
m_textPointer(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
PointerTextView::PointerTextView(const char * text, float horizontalAlignment, float verticalAlignment,
|
||||
KDColor textColor, KDColor backgroundColor) :
|
||||
TextView(horizontalAlignment, verticalAlignment, textColor, backgroundColor),
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#include <escher/text_view.h>
|
||||
|
||||
TextView::TextView() : TextView(0.0f, 0.0f, KDColorBlack, KDColorWhite)
|
||||
{
|
||||
}
|
||||
|
||||
TextView::TextView(float horizontalAlignment, float verticalAlignment,
|
||||
KDColor textColor, KDColor backgroundColor) :
|
||||
View(),
|
||||
|
||||
Reference in New Issue
Block a user