From 48470cdf44c24b6fd7a05cf561790cc22b3c0d83 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 8 Mar 2019 19:53:11 +0100 Subject: Launcher: Add a launcher button for TextEditor. --- Applications/Launcher/main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Applications/Launcher') diff --git a/Applications/Launcher/main.cpp b/Applications/Launcher/main.cpp index 44de2ef384..7710056fc6 100644 --- a/Applications/Launcher/main.cpp +++ b/Applications/Launcher/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,8 @@ public: { set_button_style(GButtonStyle::CoolBar); set_icon(GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, icon_path, { 32, 32 })); - resize(50, 50); + set_preferred_size({ 50, 50 }); + set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); on_click = [this] (GButton&) { pid_t child_pid = fork(); if (!child_pid) { @@ -63,16 +65,14 @@ GWindow* make_launcher_window() window->set_rect(50, 50, 300, 60); auto* widget = new GWidget; + widget->set_layout(make(Orientation::Horizontal)); + widget->layout()->set_margins({ 5, 5, 5, 5 }); window->set_main_widget(widget); - auto* terminal_button = new LauncherButton("/res/icons/Terminal.rgb", "/bin/Terminal", widget); - terminal_button->move_to(5, 5); - - auto* font_editor_button = new LauncherButton("/res/icons/FontEditor.rgb", "/bin/FontEditor", widget); - font_editor_button->move_to(60, 5); - - auto* file_manager_button = new LauncherButton("/res/icons/FileManager.rgb", "/bin/FileManager", widget); - file_manager_button->move_to(115, 5); + new LauncherButton("/res/icons/Terminal.rgb", "/bin/Terminal", widget); + new LauncherButton("/res/icons/FontEditor.rgb", "/bin/FontEditor", widget); + new LauncherButton("/res/icons/FileManager.rgb", "/bin/FileManager", widget); + new LauncherButton("/res/icons/TextEditor.rgb", "/bin/TextEditor", widget); return window; } -- cgit v1.2.3