mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[Git] Fix conflicts
This commit is contained in:
44
escher/include/escher/palette.h
Normal file
44
escher/include/escher/palette.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef ESCHER_PALETTE_H
|
||||
#define ESCHER_PALETTE_H
|
||||
|
||||
#include <kandinsky/color.h>
|
||||
#include <stddef.h>
|
||||
|
||||
class Palette {
|
||||
public:
|
||||
constexpr static KDColor YellowDark = KDColor::RGB24(0xffb734);
|
||||
constexpr static KDColor YellowLight = KDColor::RGB24(0xffcc7b);
|
||||
constexpr static KDColor PurpleBright = KDColor::RGB24(0x656975);
|
||||
constexpr static KDColor PurpleDark = KDColor::RGB24(0x414147);
|
||||
constexpr static KDColor GreyWhite = KDColor::RGB24(0xf5f5f5);
|
||||
constexpr static KDColor GreyBright = KDColor::RGB24(0xececec);
|
||||
constexpr static KDColor GreyMiddle = KDColor::RGB24(0xd9d9d9);
|
||||
constexpr static KDColor GreyDark = KDColor::RGB24(0xa7a7a7);
|
||||
constexpr static KDColor GreyVeryDark = KDColor::RGB24(0x8c8c8c);
|
||||
constexpr static KDColor Select = KDColor::RGB24(0xd4d7e0);
|
||||
constexpr static KDColor SelectDark = KDColor::RGB24(0xb0b8d8);
|
||||
constexpr static KDColor WallScreen = KDColor::RGB24(0xf7f9fa);
|
||||
constexpr static KDColor WallScreenDark = KDColor::RGB24(0xe0e6ed);
|
||||
constexpr static KDColor SubTab = KDColor::RGB24(0xb8bbc5);
|
||||
constexpr static KDColor LowBattery = KDColor::RGB24(0xf30211);
|
||||
constexpr static KDColor Red = KDColor::RGB24(0xff000c);
|
||||
constexpr static KDColor RedLight = KDColor::RGB24(0xfe6363);
|
||||
constexpr static KDColor Magenta = KDColor::RGB24(0xff0588);
|
||||
constexpr static KDColor Turquoise = KDColor::RGB24(0x60c1ec);
|
||||
constexpr static KDColor Pink = KDColor::RGB24(0xffabb6);
|
||||
constexpr static KDColor Blue = KDColor::RGB24(0x5075f2);
|
||||
constexpr static KDColor BlueLight = KDColor::RGB24(0x718fee);
|
||||
constexpr static KDColor Orange = KDColor::RGB24(0xfe871f);
|
||||
constexpr static KDColor Green = KDColor::RGB24(0x50c102);
|
||||
constexpr static KDColor GreenLight = KDColor::RGB24(0x52db8f);
|
||||
constexpr static KDColor Brown = KDColor::RGB24(0x8d7350);
|
||||
constexpr static KDColor Purple = KDColor::RGB24(0x6e2d79);
|
||||
constexpr static KDColor DataColor[] = {Red, Blue, Green, YellowDark, Magenta, Turquoise, Pink, Orange};
|
||||
constexpr static KDColor DataColorLight[] = {RedLight, BlueLight, GreenLight, YellowLight};
|
||||
|
||||
constexpr static size_t numberOfDataColors() { return sizeof(DataColor)/sizeof(KDColor); }
|
||||
constexpr static size_t numberOfLightDataColors() { return sizeof(DataColorLight)/sizeof(KDColor); }
|
||||
static KDColor nextDataColor(int * colorIndex);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,6 +18,7 @@ public:
|
||||
|
||||
int depth();
|
||||
View * view() override;
|
||||
ViewController * topViewController();
|
||||
const char * title() override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
void didBecomeFirstResponder() override;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <escher/palette.h>
|
||||
#include <assert.h>
|
||||
|
||||
constexpr KDColor Palette::PrimaryText;
|
||||
constexpr KDColor Palette::SecondaryText; // =GREYDARK
|
||||
@@ -142,3 +143,11 @@ constexpr KDColor Palette::AtomReactiveNonmetal;
|
||||
constexpr KDColor Palette::AtomNobleGas;
|
||||
constexpr KDColor Palette::AtomTableLines;
|
||||
constexpr KDColor Palette::AtomColor[];
|
||||
|
||||
KDColor Palette::nextDataColor(int * colorIndex) {
|
||||
size_t nbOfColors = numberOfDataColors();
|
||||
assert(*colorIndex < nbOfColors);
|
||||
KDColor c = DataColor[*colorIndex];
|
||||
*colorIndex = (*colorIndex + 1) % nbOfColors;
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -92,6 +92,13 @@ const char * StackViewController::title() {
|
||||
return vc->title();
|
||||
}
|
||||
|
||||
ViewController * StackViewController::topViewController() {
|
||||
if (m_numberOfChildren < 1) {
|
||||
return nullptr;
|
||||
}
|
||||
return m_childrenFrame[m_numberOfChildren-1].viewController();
|
||||
}
|
||||
|
||||
void StackViewController::push(ViewController * vc, KDColor textColor, KDColor backgroundColor, KDColor separatorColor) {
|
||||
Frame frame = Frame(vc, textColor, backgroundColor, separatorColor);
|
||||
/* Add the frame to the model */
|
||||
@@ -112,7 +119,7 @@ void StackViewController::push(ViewController * vc, KDColor textColor, KDColor b
|
||||
|
||||
void StackViewController::pop() {
|
||||
assert(m_numberOfChildren > 0);
|
||||
ViewController * vc = m_childrenFrame[m_numberOfChildren-1].viewController();
|
||||
ViewController * vc = topViewController();
|
||||
if (vc->title() != nullptr && vc->displayParameter() != ViewController::DisplayParameter::DoNotShowOwnTitle) {
|
||||
m_view.popStack();
|
||||
}
|
||||
@@ -131,7 +138,7 @@ void StackViewController::pushModel(Frame frame) {
|
||||
}
|
||||
|
||||
void StackViewController::setupActiveViewController() {
|
||||
ViewController * vc = m_childrenFrame[m_numberOfChildren-1].viewController();
|
||||
ViewController * vc = topViewController();
|
||||
vc->setParentResponder(this);
|
||||
m_view.shouldDisplayStackHearders(vc->displayParameter() != ViewController::DisplayParameter::WantsMaximumSpace);
|
||||
m_view.setContentView(vc->view());
|
||||
@@ -141,7 +148,7 @@ void StackViewController::setupActiveViewController() {
|
||||
}
|
||||
|
||||
void StackViewController::didBecomeFirstResponder() {
|
||||
ViewController * vc = m_childrenFrame[m_numberOfChildren-1].viewController();
|
||||
ViewController * vc = topViewController();
|
||||
Container::activeApp()->setFirstResponder(vc);
|
||||
}
|
||||
|
||||
@@ -170,7 +177,7 @@ void StackViewController::viewWillAppear() {
|
||||
}
|
||||
}
|
||||
/* Load the visible controller view */
|
||||
ViewController * vc = m_childrenFrame[m_numberOfChildren-1].viewController();
|
||||
ViewController * vc = topViewController();
|
||||
if (m_numberOfChildren > 0 && vc) {
|
||||
m_view.setContentView(vc->view());
|
||||
m_view.shouldDisplayStackHearders(vc->displayParameter() != ViewController::DisplayParameter::WantsMaximumSpace);
|
||||
@@ -180,7 +187,7 @@ void StackViewController::viewWillAppear() {
|
||||
}
|
||||
|
||||
void StackViewController::viewDidDisappear() {
|
||||
ViewController * vc = m_childrenFrame[m_numberOfChildren-1].viewController();
|
||||
ViewController * vc = topViewController();
|
||||
if (m_numberOfChildren > 0 && vc) {
|
||||
vc->viewDidDisappear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user