mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-23 06:14:13 -04:00
Consolidate styles (#1116)
* Consolidate styles into a Styles class and clean up code * Format * Add style_bg_dark_grey for nav bar * Fix bugs found in PR * Rename styles * Add bg_white style --------- Co-authored-by: kallanreed <kallanreed@outlook.com> Co-authored-by: gullradriel <3157857+gullradriel@users.noreply.github.com>
This commit is contained in:
parent
496b124baf
commit
0f28fefc82
52 changed files with 299 additions and 400 deletions
|
@ -42,21 +42,17 @@ bool ScreenshotViewer::on_key(KeyEvent) {
|
|||
void ScreenshotViewer::paint(Painter& painter) {
|
||||
constexpr size_t pixel_width = 240;
|
||||
constexpr size_t pixel_height = 320;
|
||||
Style style_default{
|
||||
.font = ui::font::fixed_8x16,
|
||||
.background = ui::Color::black(),
|
||||
.foreground = ui::Color::white()};
|
||||
File file{};
|
||||
|
||||
painter.fill_rectangle({0, 0, pixel_width, pixel_height}, Color::black());
|
||||
|
||||
auto show_invalid = [&]() {
|
||||
painter.draw_string({10, 160}, style_default, "Not a valid screenshot.");
|
||||
painter.draw_string({10, 160}, Styles::white, "Not a valid screenshot.");
|
||||
};
|
||||
|
||||
auto error = file.open(path_);
|
||||
if (error) {
|
||||
painter.draw_string({10, 160}, style_default, error->what());
|
||||
painter.draw_string({10, 160}, Styles::white, error->what());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue