Skip to content

Commit

Permalink
hideo-shell: Removed duplicated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Mar 31, 2024
1 parent cf8dfc5 commit 38968da
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions src/apps/hideo-shell/lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,18 @@ namespace Hideo::Shell {
Ui::Child lock(State const &state) {
auto [date, time] = state.dateTime;
auto dateTime = Io::format(
"{}. {} {}",
date.month.abbr(),
date.dayOfMonth() + 1,
date.year.val()
)
.unwrap();
// Mon. 28 Jul
"{}. {} {}",
date.month.abbr(),
date.dayOfMonth() + 1,
date.year.val()
);

auto clock = Ui::vflow(
Ui::center(Ui::displayMedium("{02}:{02}", time.hour, time.minute)),
Ui::empty(16),
Ui::center(
Ui::titleMedium(
// Mon. 28 Jul
"{}. {} {}",
Io::toCapitalCase(date.dayOfWeek().abbr()),
date.dayOfMonth() + 1,
Io::toCapitalCase(date.month.str())
)
)
16,
Layout::Align::HCENTER,
Ui::displayMedium("{02}:{02}", time.hour, time.minute) | Ui::center(),
Ui::titleMedium(dateTime.unwrap()) | Ui::center()
);

auto hintText = Ui::vflow(
Expand Down

0 comments on commit 38968da

Please sign in to comment.