summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-29 14:31:24 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-29 15:12:58 +0100
commite705e4e08358072c1b1e659561284b555d9511af (patch)
treec3f71d850ad54ba27d117a345f0c654d741cc2bd /Applications
parent7cd1bdfd818a094a41bb55403c442423db6a53bf (diff)
downloadserenity-e705e4e08358072c1b1e659561284b555d9511af.zip
About: Adopt Buggie :^)
Simon Struthers drew a SerenityOS ladybug and since it's so cute, I figured we could adopt it!
Diffstat (limited to 'Applications')
-rwxr-xr-xApplications/About/Makefile2
-rw-r--r--Applications/About/main.cpp54
2 files changed, 35 insertions, 21 deletions
diff --git a/Applications/About/Makefile b/Applications/About/Makefile
index 928c8c530c..4745b70e23 100755
--- a/Applications/About/Makefile
+++ b/Applications/About/Makefile
@@ -5,6 +5,6 @@ PROGRAM = About
LIB_DEPS = GUI Gfx IPC Core
-DEFINES += -DGIT_COMMIT=\"`git rev-parse --short HEAD`\" -DGIT_BRANCH=\"`git rev-parse --abbrev-ref HEAD`\" -DGIT_CHANGES=\"`git diff-index --quiet HEAD -- && echo "tracked"|| echo "untracked"`\"
+DEFINES += -DGIT_COMMIT=\"`git rev-parse --short HEAD`\" -DGIT_BRANCH=\"`git rev-parse --abbrev-ref HEAD`\"
include ../../Makefile.common
diff --git a/Applications/About/main.cpp b/Applications/About/main.cpp
index 6c646dfc69..4da40c942c 100644
--- a/Applications/About/main.cpp
+++ b/Applications/About/main.cpp
@@ -57,24 +57,33 @@ int main(int argc, char** argv)
auto window = GUI::Window::construct();
window->set_title("About SerenityOS");
- Gfx::Rect window_rect { 0, 0, 240, 180 };
+ window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/ladybug.png"));
+ Gfx::Rect window_rect { 0, 0, 224, 178 };
window_rect.center_within(GUI::Desktop::the().rect());
window->set_resizable(false);
window->set_rect(window_rect);
- auto widget = GUI::Widget::construct();
- window->set_main_widget(widget);
- widget->set_fill_with_background_color(true);
- widget->set_layout(make<GUI::VerticalBoxLayout>());
- widget->layout()->set_margins({ 0, 8, 0, 8 });
- widget->layout()->set_spacing(8);
+ auto outer_widget = GUI::Widget::construct();
+ window->set_main_widget(outer_widget);
+ outer_widget->set_fill_with_background_color(true);
+ outer_widget->set_layout(make<GUI::VerticalBoxLayout>());
+ outer_widget->layout()->set_margins({ 8, 8, 8, 8 });
- auto icon_label = widget->add<GUI::Label>();
- icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/serenity.png"));
- icon_label->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
- icon_label->set_preferred_size(icon_label->icon()->size());
+ auto inner_widget = outer_widget->add<GUI::Widget>();
+ inner_widget->set_layout(make<GUI::HorizontalBoxLayout>());
+ inner_widget->layout()->set_spacing(8);
+
+ auto left_outer_container = inner_widget->add<GUI::Widget>();
+ left_outer_container->set_layout(make<GUI::HorizontalBoxLayout>());
+
+ auto left_inner_container = left_outer_container->add<GUI::Widget>();
+ left_inner_container->set_layout(make<GUI::VerticalBoxLayout>());
+ left_inner_container->layout()->set_spacing(8);
+ left_inner_container->set_preferred_size(0, 50);
+ left_inner_container->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
- auto label = widget->add<GUI::Label>();
+ auto label = left_inner_container->add<GUI::Label>();
+ label->set_text_alignment(Gfx::TextAlignment::CenterRight);
label->set_font(Gfx::Font::default_bold_font());
label->set_text("SerenityOS");
label->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
@@ -84,22 +93,27 @@ int main(int argc, char** argv)
int rc = uname(&uts);
ASSERT(rc == 0);
- auto version_label = widget->add<GUI::Label>();
+ auto version_label = left_inner_container->add<GUI::Label>();
+ version_label->set_text_alignment(Gfx::TextAlignment::CenterRight);
version_label->set_text(String::format("Version %s", uts.release));
version_label->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
version_label->set_preferred_size(0, 11);
- auto git_info_label = widget->add<GUI::Label>();
- git_info_label->set_text(String::format("Built on %s@%s", GIT_BRANCH, GIT_COMMIT));
+ auto git_info_label = left_inner_container->add<GUI::Label>();
+ git_info_label->set_text_alignment(Gfx::TextAlignment::CenterRight);
+ git_info_label->set_text(String::format("%s@%s", GIT_BRANCH, GIT_COMMIT));
git_info_label->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
git_info_label->set_preferred_size(0, 11);
- auto git_changes_label = widget->add<GUI::Label>();
- git_changes_label->set_text(String::format("Changes: %s", GIT_CHANGES));
- git_changes_label->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
- git_changes_label->set_preferred_size(0, 11);
+ auto right_container = inner_widget->add<GUI::Widget>();
+ right_container->set_layout(make<GUI::VerticalBoxLayout>());
+
+ auto icon_label = right_container->add<GUI::Label>();
+ icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/buggie.png"));
+ icon_label->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
+ icon_label->set_preferred_size(icon_label->icon()->size());
- auto quit_button = widget->add<GUI::Button>();
+ auto quit_button = outer_widget->add<GUI::Button>();
quit_button->set_text("Okay");
quit_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fixed);
quit_button->set_preferred_size(100, 20);