mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[escher][apps] Make View using blendRectWithMask without background
inherit from TransparentView
This commit is contained in:
@@ -23,7 +23,6 @@ const uint8_t tickMask[BatteryView::k_tickHeight][BatteryView::k_tickWidth] = {
|
||||
|
||||
|
||||
BatteryView::BatteryView() :
|
||||
View(),
|
||||
m_chargeState(Ion::Battery::Charge::SOMEWHERE_INBETWEEN),
|
||||
m_isCharging(false),
|
||||
m_isPlugged(false)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <escher.h>
|
||||
|
||||
class BatteryView : public View {
|
||||
class BatteryView : public TransparentView {
|
||||
public:
|
||||
BatteryView();
|
||||
bool setChargeState(Ion::Battery::Charge chargeState);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace HardwareTest {
|
||||
|
||||
class ArrowView : public View {
|
||||
class ArrowView : public TransparentView {
|
||||
public:
|
||||
ArrowView();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <escher.h>
|
||||
|
||||
class LockView : public View {
|
||||
class LockView : public TransparentView {
|
||||
public:
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
KDSize minimalSizeForOptimalDisplay() const override;
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
|
||||
namespace Shared {
|
||||
|
||||
class OkView : public View {
|
||||
class OkView : public TransparentView {
|
||||
public:
|
||||
using View::View;
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
KDSize minimalSizeForOptimalDisplay() const override;
|
||||
constexpr static KDCoordinate k_okSize = 20;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Shared {
|
||||
|
||||
class RoundCursorView : public View {
|
||||
class RoundCursorView : public TransparentView {
|
||||
public:
|
||||
RoundCursorView(KDColor color = KDColorBlack);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#ifndef ESCHER_CHEVRON_VIEW_H
|
||||
#define ESCHER_CHEVRON_VIEW_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/transparent_view.h>
|
||||
|
||||
class ChevronView : public View {
|
||||
class ChevronView : public TransparentView {
|
||||
public:
|
||||
ChevronView();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
KDSize minimalSizeForOptimalDisplay() const override;
|
||||
/* k_chevronHeight and k_chevronWidth are the dimensions of the chevron. */
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#ifndef ESCHER_ELLIPSIS_VIEW_H
|
||||
#define ESCHER_ELLIPSIS_VIEW_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/transparent_view.h>
|
||||
|
||||
class EllipsisView : public View {
|
||||
class EllipsisView : public TransparentView {
|
||||
public:
|
||||
EllipsisView();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
KDSize minimalSizeForOptimalDisplay() const override;
|
||||
/* k_ellipsisHeight and k_ellipsisWidth are the dimensions of the ellipsis. */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef ESCHER_GAUGE_VIEW_H
|
||||
#define ESCHER_GAUGE_VIEW_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/transparent_view.h>
|
||||
|
||||
class GaugeView : public View {
|
||||
class GaugeView : public TransparentView {
|
||||
public:
|
||||
GaugeView();
|
||||
float level();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef ESCHER_KEY_VIEW_H
|
||||
#define ESCHER_KEY_VIEW_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/transparent_view.h>
|
||||
|
||||
class KeyView : public View {
|
||||
class KeyView : public TransparentView {
|
||||
public:
|
||||
enum class Type {
|
||||
Up,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef ESCHER_SWITCH_VIEW_H
|
||||
#define ESCHER_SWITCH_VIEW_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/transparent_view.h>
|
||||
|
||||
class SwitchView : public View {
|
||||
class SwitchView : public TransparentView {
|
||||
public:
|
||||
SwitchView();
|
||||
bool state();
|
||||
|
||||
@@ -14,11 +14,6 @@ const uint8_t chevronMask[ChevronView::k_chevronHeight][ChevronView::k_chevronWi
|
||||
{0x0C, 0xE1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
|
||||
};
|
||||
|
||||
ChevronView::ChevronView() :
|
||||
View()
|
||||
{
|
||||
}
|
||||
|
||||
KDColor s_workingBuffer[ChevronView::k_chevronWidth*ChevronView::k_chevronHeight];
|
||||
|
||||
void ChevronView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
|
||||
@@ -7,11 +7,6 @@ const uint8_t ellipsisMask[EllipsisView::k_ellipsisHeight][EllipsisView::k_ellip
|
||||
{0xFF, 0xD1, 0xA1, 0xC1, 0xFF, 0xFF, 0xFF, 0xD1, 0xA1, 0xC1, 0xFF, 0xFF, 0xFF, 0xD1, 0xA1, 0xC1, 0xFF},
|
||||
};
|
||||
|
||||
EllipsisView::EllipsisView() :
|
||||
View()
|
||||
{
|
||||
}
|
||||
|
||||
KDColor s_ellipsisWorkingBuffer[EllipsisView::k_ellipsisWidth*EllipsisView::k_ellipsisHeight];
|
||||
|
||||
void EllipsisView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
|
||||
@@ -15,7 +15,6 @@ const uint8_t gaugeIndicatorMask[GaugeView::k_indicatorDiameter][GaugeView::k_in
|
||||
};
|
||||
|
||||
GaugeView::GaugeView() :
|
||||
View(),
|
||||
m_level(1),
|
||||
m_backgroundColor(KDColorWhite)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,6 @@ const uint8_t minusMask[KeyView::k_keySize][KeyView::k_keySize] = {
|
||||
};
|
||||
|
||||
KeyView::KeyView(Type type) :
|
||||
View(),
|
||||
m_type(type)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ const uint8_t onOffMask[SwitchView::k_onOffSize][SwitchView::k_onOffSize] = {
|
||||
};
|
||||
|
||||
SwitchView::SwitchView() :
|
||||
View(),
|
||||
m_state(true)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user