Skip to content

Commit

Permalink
hideo-about: Made skiftOS woke and based pilled
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Mar 12, 2024
1 parent 922b9ae commit 6912873
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions src/apps/hideo-about/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ Ui::Child app() {
"The skiftOS Developers\n"
"All rights reserved.");

auto transflagText = Ui::hflow(
6,
Ui::image(Media::loadImage("bundle://hideo-about/pride.qoi"_url).unwrap(), 4),
Ui::bodySmall("Trans Rights are Human Rights"));

auto licenseBtn = Ui::button(
[](auto &n) {
Ui::showDialog(n, Ui::licenseDialog());
},
Ui::ButtonStyle::subtle(),
Ui::ButtonStyle::outline(),
Mdi::LICENSE,
"License");

auto closeBtn = Ui::button(
Ui::bindBubble<Events::RequestExitEvent>(),
Ui::ButtonStyle::primary(),
"Close");

return Ui::vflow(
8,
Ui::hflow(
Expand All @@ -43,9 +43,8 @@ Ui::Child app() {
Ui::grow(NONE),
Ui::hflow(
8,
licenseBtn,
Ui::grow(NONE),
closeBtn)) |
transflagText | Ui::vcenter() | Ui::grow(),
licenseBtn)) |
Ui::spacing(16);
},
.size = {460, 320},
Expand Down
Binary file added src/apps/hideo-about/res/pride.qoi
Binary file not shown.
6 changes: 2 additions & 4 deletions src/libs/karm-base/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,14 @@ struct _Vec {
constexpr T const *buf() const { return _buf.buf(); }

constexpr T &operator[](usize i) {
if (i >= len()) {
if (i >= len())
panic("index out of bounds");
}
return _buf[i];
}

constexpr T const &operator[](usize i) const {
if (i >= len()) {
if (i >= len())
panic("index out of bounds");
}
return _buf[i];
}
};
Expand Down
2 changes: 2 additions & 0 deletions src/libs/karm-ui/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ struct Image : public View<Image> {
: _image(image), _radius(radius) {}

void paint(Gfx::Context &g, Math::Recti) override {
g.save();
if (_radius) {
g.fillStyle(_image);
g.fill(bound(), *_radius);
Expand All @@ -338,6 +339,7 @@ struct Image : public View<Image> {

if (debugShowLayoutBounds)
g.plot(bound(), Gfx::CYAN);
g.restore();
}

Math::Vec2i size(Math::Vec2i, Layout::Hint) override {
Expand Down

0 comments on commit 6912873

Please sign in to comment.