From 48470cdf44c24b6fd7a05cf561790cc22b3c0d83 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 8 Mar 2019 19:53:11 +0100 Subject: [PATCH] Launcher: Add a launcher button for TextEditor. --- Applications/Launcher/main.cpp | 18 +++++++++--------- Base/res/icons/TextEditor.png | Bin 0 -> 454 bytes Base/res/icons/TextEditor.rgb | Bin 0 -> 4096 bytes 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 Base/res/icons/TextEditor.png create mode 100644 Base/res/icons/TextEditor.rgb 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; } diff --git a/Base/res/icons/TextEditor.png b/Base/res/icons/TextEditor.png new file mode 100644 index 0000000000000000000000000000000000000000..86ad985a78c2c3fb6af68a6911cf0f5321650518 GIT binary patch literal 454 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}Y)RhkE)0Gk`1Qd=kW$V9 zkH}&M20djEW~^9hU&g?|z+U3%>&pI^nM26LYR{B2FBljYBuiW)N}Tg^b5rw57@Uhz z6H8K46v{J8G8EiBeFMT9`NSC*81+0|977@wzYX8m+hQOfBb{V4L8Dd3L&t@22U|va zhu90oj3%}d0zWJDE&b-Ov>kTab=~+PSLNQvl03T`*qk^vN$Sr(TTpuRu|?bSN)un< zoTE-0t6tB_`i(P!P#bOxGZ9lzZ*OBYo%nbd)rE^Ws?^ik? zG27E3eC6YJx+_+_x^gVYtC-29Mdx%`>YY=zlb+WVr~AJ9oqG@h|8F@E!5GZF=1-rm zjzQRi^Y@$PZ+VarT{n|8_jXdbQPe4or7>p9m)p5{X=*IJ@cpm*$HTrW*R8d?HBCRg wF_uH|gjm<21zT5E6dOfJulHSO{ZshHlM5V*XQ;4KfRtoiK5b8d})h-roMdt*s60 zADCU}w4a|J11;?bxdCK8y1g(y)c!v&U%vc5bLPzdAR2@zWp{RV{x2#j`cH)YU_1X) z5fl^@{2xgBLH;Jk{(t}e{fFW||Ni|W6@&GHf{|SNL3*L~gUup`4Kjlg`{&P}|DPNT zb1NnGgUtB*_b*v~hv}olevn>}8z{jbGe*O|i0u4NN!Ww*j)wn#aJf%T`3DL+P#98z zL1v7m|B;#gL2(blAU3%e