Formatted code (#1007)

* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
This commit is contained in:
jLynx 2023-05-19 08:16:05 +12:00 committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
599 changed files with 70746 additions and 66896 deletions

View file

@ -29,52 +29,52 @@
#include "ui_painter.hpp"
namespace ui {
#define MAX_TABS 5
class Tab : public Widget {
public:
Tab();
public:
Tab();
void paint(Painter& painter) override;
bool on_key(const KeyEvent key) override;
bool on_touch(const TouchEvent event) override;
void set(uint32_t index, Dim width, std::string text, Color text_color);
void paint(Painter& painter) override;
private:
std::string text_ { };
Color text_color_ { };
uint32_t index_ { };
bool on_key(const KeyEvent key) override;
bool on_touch(const TouchEvent event) override;
void set(uint32_t index, Dim width, std::string text, Color text_color);
private:
std::string text_{};
Color text_color_{};
uint32_t index_{};
};
class TabView : public View {
public:
struct TabDef {
std::string text;
ui::Color color;
View* view;
};
TabView(std::initializer_list<TabDef> tab_definitions);
~TabView();
void focus() override;
void on_show() override;
void set_selected(uint32_t index);
uint32_t selected() {
return current_tab;
};
public:
struct TabDef {
std::string text;
ui::Color color;
View* view;
};
private:
size_t n_tabs { };
std::array<Tab, MAX_TABS> tabs { };
std::array<View*, MAX_TABS> views { };
uint32_t current_tab { 0 };
TabView(std::initializer_list<TabDef> tab_definitions);
~TabView();
void focus() override;
void on_show() override;
void set_selected(uint32_t index);
uint32_t selected() {
return current_tab;
};
private:
size_t n_tabs{};
std::array<Tab, MAX_TABS> tabs{};
std::array<View*, MAX_TABS> views{};
uint32_t current_tab{0};
};
} /* namespace ui */
#endif/*__UI_TABVIEW_H__*/
#endif /*__UI_TABVIEW_H__*/