Skip to content

Commit

Permalink
hideo-shell: Change the default wallpaper.
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Dec 29, 2024
1 parent babb06e commit f904629
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 17 deletions.
5 changes: 3 additions & 2 deletions meta/image/efi/boot/loader.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"bundle://grund-seat/_bin",
"bundle://grund-shell/_bin",
"bundle://grund-bus/_bin",
"bundle://hideo-shell/wallpaper.qoi",
"bundle://hideo-shell/wallpapers/winter.qoi",
"bundle://fonts-inter/fonts/Inter-Regular.ttf",
"bundle://fonts-inter/fonts/Inter-Medium.ttf"
"bundle://fonts-inter/fonts/Inter-Medium.ttf",
"bundle://fonts-inter/fonts/Inter-Bold.ttf"
]
}
]
Expand Down
11 changes: 4 additions & 7 deletions src/apps/hideo-shell/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ Ui::Child statusbar(State const &state) {
}) |
Ui::box({
.padding = {0, 12},
.backgroundFill = Ui::GRAY900,
.backgroundFill = state.instances.len() ? Ui::GRAY900 : Ui::GRAY950.withOpacity(0.6),
});
}

Ui::Child statusbarButton(State const &state) {
return Ui::button(
Model::bind<Activate>(Panel::SYS),
Ui::ButtonStyle::none(),
statusbar(state)
);
}
Expand Down Expand Up @@ -121,7 +122,7 @@ Ui::Child taskbar(State const &state) {
) |
Ui::box({
.padding = 6,
.backgroundFill = Ui::GRAY950.withOpacity(0.8),
.backgroundFill = Ui::GRAY950.withOpacity(0.6),
}),
Ui::separator()
) |
Expand Down Expand Up @@ -162,11 +163,7 @@ Ui::Child tablet(State const &state) {
? background(state)
: Ui::empty(),
Ui::vflow(
Ui::vflow(
statusbarButton(state),
Ui::separator()
) |
Ui::slideIn(Ui::SlideFrom::TOP),
statusbarButton(state) | Ui::slideIn(Ui::SlideFrom::TOP),
appHost(state) | Ui::grow(),
navbar(state)
)
Expand Down
34 changes: 28 additions & 6 deletions src/apps/hideo-shell/lock.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <karm-text/loader.h>
#include <karm-ui/box.h>
#include <karm-ui/drag.h>
#include <mdi/chevron-up.h>
Expand All @@ -6,21 +7,42 @@

namespace Hideo::Shell {

static Opt<Strong<Text::Fontface>> _blackFontface = NONE;

static Strong<Text::Fontface> blackFontface() {
if (not _blackFontface) {
_blackFontface = Text::loadFontfaceOrFallback("bundle://fonts-inter/fonts/Inter-Bold.ttf"_url).unwrap();
}
return *_blackFontface;
}

Ui::Child lock(State const &state) {
auto [date, time] = state.dateTime;
auto dateTime = Io::format(
// Mon. 28 Jul
"{}. {} {}",
Io::toCapitalCase(date.dayOfWeek().abbr()),
// Mon, 28 Jul
"{}, {} {}",
Io::toCapitalCase(date.dayOfWeek().str()),
date.dayOfMonth() + 1,
Io::toCapitalCase(date.month.str())
);

auto clock = Ui::vflow(
16,
0,
Math::Align::CENTER,
Ui::displayMedium("{02}:{02}", time.hour, time.minute),
Ui::titleMedium(dateTime.unwrap())
Ui::text({
.font = Text::Font{
blackFontface(),
16,
},
},
dateTime.unwrap()),
Ui::text({
.font = Text::Font{
blackFontface(),
72,
},
},
"{02}:{02}", time.hour, time.minute)
);

auto hintText = Ui::vflow(
Expand Down
2 changes: 1 addition & 1 deletion src/apps/hideo-shell/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Async::Task<> entryPointAsync(Sys::Context &ctx) {
Hideo::Shell::State state = {
.isMobile = isMobile,
.dateTime = Sys::dateTime(),
.background = co_try$(Image::loadOrFallback("bundle://hideo-shell/wallpaper.qoi"_url)),
.background = co_try$(Image::loadOrFallback("bundle://hideo-shell/wallpapers/winter.qoi"_url)),
.noti = {},
.manifests = {
makeStrong<Hideo::Shell::Manifest>(Mdi::INFORMATION_OUTLINE, "About"s, Gfx::BLUE_RAMP),
Expand Down
File renamed without changes
File renamed without changes.
Binary file added src/apps/hideo-shell/res/wallpapers/winter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/apps/hideo-shell/res/wallpapers/winter.qoi
Binary file not shown.
2 changes: 1 addition & 1 deletion src/srvs/grund-shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Async::Task<> servAsync(Sys::Context &ctx) {
Hideo::Shell::State state = {
.isMobile = false,
.dateTime = Sys::dateTime(),
.background = co_try$(Image::loadOrFallback("bundle://hideo-shell/wallpaper.qoi"_url)),
.background = co_try$(Image::loadOrFallback("bundle://hideo-shell/wallpapers/winter.qoi"_url)),
.noti = {},
.manifests = {
makeStrong<Hideo::Shell::Manifest>(Mdi::INFORMATION_OUTLINE, "About"s, Gfx::BLUE_RAMP),
Expand Down

0 comments on commit f904629

Please sign in to comment.