Numworks Epsilon  1.4.1
Graphing Calculator Operating System
logo_view.cpp
Go to the documentation of this file.
1 #include "logo_view.h"
2 #include "logo_icon.h"
3 #include <assert.h>
4 
5 namespace OnBoarding {
6 
8  View()
9 {
10  m_logoView.setImage(ImageStore::LogoIcon);
11 }
12 
13 void LogoView::drawRect(KDContext * ctx, KDRect rect) const {
14  ctx->fillRect(bounds(), KDColorWhite);
15 }
16 
17 int LogoView::numberOfSubviews() const {
18  return 1;
19 }
20 
21 View * LogoView::subviewAtIndex(int index) {
22  assert(index == 0);
23  return &m_logoView;
24 }
25 
26 void LogoView::layoutSubviews() {
27  m_logoView.setFrame(KDRect((Ion::Display::Width - ImageStore::LogoIcon->width())/2, (Ion::Display::Height - ImageStore::LogoIcon->height())/2, ImageStore::LogoIcon->width(), ImageStore::LogoIcon->height()));
28 }
29 
30 }
#define assert(e)
Definition: assert.h:9
void setFrame(KDRect frame)
Definition: view.cpp:125
constexpr int Width
Definition: display.h:26
constexpr KDColor KDColorWhite
Definition: color.h:42
void setImage(const Image *image)
Definition: image_view.cpp:21
Definition: rect.h:26
void fillRect(KDRect rect, KDColor color)
Definition: context_rect.cpp:8
Definition: view.h:23
void drawRect(KDContext *ctx, KDRect rect) const override
Definition: logo_view.cpp:13
constexpr int Height
Definition: display.h:27
KDRect bounds() const
Definition: view.cpp:157