alpha
Login
or
Join now
arthomnix.dev
/
eepy
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
firmware for my Touchscreen E-Paper Input Module for Framework Laptop 16
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
eepy-launcher: add about page
author
arthomnix
date
7 months ago
(Nov 4, 2025, 9:24 PM UTC)
commit
b1f64dc5
b1f64dc5860141fa9375c8203e292f19c74c5c3c
parent
27d116f9
27d116f9e05ea9f384356a14bb30f32903d023dc
+89
-11
5 changed files
Expand all
Collapse all
Unified
Split
eepy-launcher
build.sh
src
ui
mod.rs
page
about.rs
main.rs
mod.rs
+1
eepy-launcher/build.sh
Reviewed
···
2
2
3
3
rm -rf out
4
4
mkdir out
5
5
+
export EEPY_LAUNCHER_BUILD_DATE=$(date -I)
5
6
cargo build --release
6
7
elf2epb -i ../target/thumbv6m-none-eabi/release/eepy-launcher -o out/eepy-launcher.s00.epb
7
8
truncate -s 128K out/eepy-launcher.s00.epb
+4
eepy-launcher/src/ui/mod.rs
Reviewed
···
3
3
use eepy_gui::draw_target::EpdDrawTarget;
4
4
use eepy_gui::element::Gui;
5
5
use eepy_sys::input_common::Event;
6
6
+
use crate::ui::page::about::AboutPage;
6
7
use crate::ui::page::app_info::AppInfoPage;
7
8
use crate::ui::page::main::MainPage;
8
9
use crate::ui::page::scratchpad::ScratchpadPage;
···
14
15
MainPage(MainPage),
15
16
ScratchpadPage(ScratchpadPage),
16
17
AppInfoPage(AppInfoPage),
18
18
+
AboutPage(AboutPage),
17
19
}
18
20
19
21
impl MainGui {
···
26
28
MainGui::MainPage(page) => page,
27
29
MainGui::ScratchpadPage(page) => page,
28
30
MainGui::AppInfoPage(page) => page,
31
31
+
MainGui::AboutPage(page) => page,
29
32
}
30
33
}
31
34
···
34
37
MainGui::MainPage(page) => page,
35
38
MainGui::ScratchpadPage(page) => page,
36
39
MainGui::AppInfoPage(page) => page,
40
40
+
MainGui::AboutPage(page) => page,
37
41
}
38
42
}
39
43
}
+56
eepy-launcher/src/ui/page/about.rs
Reviewed
···
1
1
+
use embedded_graphics::Drawable;
2
2
+
use embedded_graphics::mono_font::{ascii, MonoTextStyle};
3
3
+
use embedded_graphics::pixelcolor::BinaryColor;
4
4
+
use embedded_graphics::prelude::Point;
5
5
+
use embedded_graphics::text::Text;
6
6
+
use eepy_gui::draw_target::EpdDrawTarget;
7
7
+
use eepy_gui::element::button::Button;
8
8
+
use eepy_gui::element::{Gui, DEFAULT_TEXT_STYLE};
9
9
+
use eepy_sys::input_common::Event;
10
10
+
use crate::ui::MainGui;
11
11
+
use crate::ui::page::main::MainPage;
12
12
+
13
13
+
const SMALL_ITALIC_TEXT_STYLE: MonoTextStyle<BinaryColor> = MonoTextStyle::new(&ascii::FONT_6X13_ITALIC, BinaryColor::On);
14
14
+
15
15
+
pub(crate) struct AboutPage {
16
16
+
back_button: Button<'static>,
17
17
+
}
18
18
+
19
19
+
impl Default for AboutPage {
20
20
+
fn default() -> Self {
21
21
+
Self {
22
22
+
back_button: Button::with_default_style_auto_sized(Point::new(10, 10), "Back", true),
23
23
+
}
24
24
+
}
25
25
+
}
26
26
+
27
27
+
impl Gui for AboutPage {
28
28
+
type Output = Option<MainGui>;
29
29
+
30
30
+
fn draw_init(&self, target: &mut EpdDrawTarget) {
31
31
+
Text::new(concat!("eepyOS (Launcher ", env!("CARGO_PKG_VERSION"), ")"), Point::new(5, 190), DEFAULT_TEXT_STYLE)
32
32
+
.draw(target)
33
33
+
.unwrap();
34
34
+
Text::new(concat!("built ", env!("EEPY_LAUNCHER_BUILD_DATE")), Point::new(40, 210), DEFAULT_TEXT_STYLE)
35
35
+
.draw(target)
36
36
+
.unwrap();
37
37
+
Text::new("(c) 2025 arthomnix - MIT licensed", Point::new(18, 300), SMALL_ITALIC_TEXT_STYLE)
38
38
+
.draw(target)
39
39
+
.unwrap();
40
40
+
Text::new("https://tangled.org/@arthomnix.dev/eepy", Point::new(3, 316), SMALL_ITALIC_TEXT_STYLE)
41
41
+
.draw(target)
42
42
+
.unwrap();
43
43
+
self.back_button.draw_init(target);
44
44
+
}
45
45
+
46
46
+
fn tick(&mut self, target: &mut EpdDrawTarget, ev: Event) -> Self::Output {
47
47
+
let bb_out = self.back_button.tick(target, ev);
48
48
+
if bb_out.clicked {
49
49
+
return Some(MainGui::MainPage(MainPage::new()));
50
50
+
} else if bb_out.needs_refresh {
51
51
+
target.refresh(true);
52
52
+
}
53
53
+
54
54
+
None
55
55
+
}
56
56
+
}
+26
-10
eepy-launcher/src/ui/page/main.rs
Reviewed
···
7
7
use eepy_sys::header::Programs;
8
8
use eepy_sys::input_common::Event;
9
9
use crate::ui::MainGui;
10
10
+
use crate::ui::page::about::AboutPage;
10
11
use crate::ui::page::app_info::AppInfoPage;
11
12
use crate::ui::page::scratchpad::ScratchpadPage;
12
13
13
14
pub(crate) struct MainPage {
14
15
scratchpad_button: Button<'static>,
16
16
+
about_button: Button<'static>,
15
17
app_buttons: [Option<(Button<'static>, u8)>; 32],
16
18
}
17
19
18
20
impl MainPage {
19
19
-
fn app_button(x: usize, y: usize, label: &'static str) -> Button<'static> {
21
21
+
fn grid_button(x: usize, y: usize, label: &'static str, touch_feedback_immediate_release: bool) -> Button<'static> {
20
22
let x_coord = 10 + 115 * x as i32;
21
23
let y_coord = 8 + 25 * y as i32;
22
24
Button::with_default_style(
23
25
Rectangle::new(Point::new(x_coord, y_coord), Size::new(105, 20)),
24
26
label,
25
25
-
false,
27
27
+
touch_feedback_immediate_release,
26
28
)
27
29
}
28
30
31
31
+
fn app_button(x: usize, y: usize, label: &'static str) -> Button<'static> {
32
32
+
Self::grid_button(x, y, label, false)
33
33
+
}
34
34
+
29
35
pub(crate) fn refresh_buttons(&mut self) {
30
36
let mut programs = Programs::new();
31
37
···
48
54
49
55
pub(crate) fn new() -> Self {
50
56
let mut res = Self {
51
51
-
scratchpad_button: Button::with_default_style(
52
52
-
Rectangle::new(Point::new(10, 8), Size::new(105, 20)),
53
53
-
"Scratchpad",
54
54
-
true
55
55
-
),
57
57
+
scratchpad_button: Self::grid_button(0, 0, "Scratchpad", true),
58
58
+
about_button: Self::grid_button(1, 15, "About", true),
56
59
app_buttons: [const { None }; 32],
57
60
};
58
61
res.refresh_buttons();
···
65
68
66
69
fn draw_init(&self, draw_target: &mut EpdDrawTarget) {
67
70
self.scratchpad_button.draw_init(draw_target);
71
71
+
72
72
+
if self.app_buttons[31].is_none() {
73
73
+
self.about_button.draw_init(draw_target);
74
74
+
}
75
75
+
68
76
for b in &self.app_buttons {
69
77
if let Some((button, _)) = b {
70
78
button.draw_init(draw_target);
···
75
83
fn tick(&mut self, draw_target: &mut EpdDrawTarget, ev: Event) -> Self::Output {
76
84
let mut needs_refresh = false;
77
85
78
78
-
let s = self.scratchpad_button.tick(draw_target, ev);
79
79
-
if s.clicked {
86
86
+
let sp_out = self.scratchpad_button.tick(draw_target, ev);
87
87
+
if sp_out.clicked {
80
88
return Some(MainGui::ScratchpadPage(ScratchpadPage::new()));
81
81
-
} else if s.needs_refresh {
89
89
+
} else if sp_out.needs_refresh {
82
90
draw_target.refresh(true);
83
91
}
92
92
+
93
93
+
let about_out = self.about_button.tick(draw_target, ev);
94
94
+
if about_out.clicked {
95
95
+
return Some(MainGui::AboutPage(AboutPage::default()));
96
96
+
} else if about_out.needs_refresh {
97
97
+
draw_target.refresh(true);
98
98
+
}
99
99
+
84
100
85
101
for b in &mut self.app_buttons[1..] {
86
102
if let Some((button, s)) = b {
+2
-1
eepy-launcher/src/ui/page/mod.rs
Reviewed
···
1
1
pub(super) mod main;
2
2
pub(super) mod scratchpad;
3
3
-
pub(super) mod app_info;
3
3
+
pub(super) mod app_info;
4
4
+
pub(super) mod about;