From 1ccf9de6b9c10013dea663bc6315b8b819bcb478 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 4 Mar 2021 06:41:40 -0500 Subject: [PATCH] Serendipity: Couple more tips and some clean-up --- Base/home/anon/Documents/tips.txt | 11 +++++++++++ .../Applications/Serendipity/SerendipityWidget.cpp | 3 --- .../Applications/Serendipity/SerendipityWindow.gml | 3 +++ Userland/Applications/Serendipity/main.cpp | 13 +++++++++++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Base/home/anon/Documents/tips.txt b/Base/home/anon/Documents/tips.txt index 7c5447bdcb..72ebed52fb 100644 --- a/Base/home/anon/Documents/tips.txt +++ b/Base/home/anon/Documents/tips.txt @@ -8,3 +8,14 @@ Text Editor has multiple viewing modes; edit and preview HTML and Markdown in re It can help to get a second pair of $ Eyes on a problem. Or fifty: $ Eyes -n 100 Highlighted text in Terminal can be launched or right-clicked for more context. Focus can be cycled between windows by pressing and holding Super+Tab. Shift reverses the order. +Super+Down is a quick way to minimize a window. +Bold text in context menus hints at the default behavior of a double-click. +Tree nodes can be fully expanded by pressing Ctrl+Right. Collapse them again with Ctrl+Left. +Double clicking a window's title bar maximizes it; double clicking its icon will close it. +Text files can be dragged directly from Terminal and dropped on Text Editor's title bar. +Resizable windows can be snapped to all sides of the screen. Drag a window to an edge or press Super+Left, Right or Up while it has focus. +The Run dialog accepts all Shell command language. Truly the gentleman's terminal. +Windows can be dragged from any visible point by holding Super+Left-click. Super+Right-click begins resizing them. +Many Serenity applications already have convenient aliases. $ cat /etc/shellrc to view them. +Custom keymaps can be created and edited with $ KeyboardMapper + diff --git a/Userland/Applications/Serendipity/SerendipityWidget.cpp b/Userland/Applications/Serendipity/SerendipityWidget.cpp index 2f731a8bfe..6632d5230d 100644 --- a/Userland/Applications/Serendipity/SerendipityWidget.cpp +++ b/Userland/Applications/Serendipity/SerendipityWidget.cpp @@ -31,10 +31,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -50,7 +48,6 @@ SerendipityWidget::SerendipityWidget() banner_label.set_icon(Gfx::Bitmap::load_from_file("/res/graphics/welcome-serendipity.png")); auto& navigation_column = *find_descendant_of_type_named("navigation_column"); - navigation_column.layout()->add_spacer(); auto& nav_separator = navigation_column.add(Gfx::Orientation::Horizontal); nav_separator.set_max_height(2); diff --git a/Userland/Applications/Serendipity/SerendipityWindow.gml b/Userland/Applications/Serendipity/SerendipityWindow.gml index be5789fd59..e0ed21deb7 100644 --- a/Userland/Applications/Serendipity/SerendipityWindow.gml +++ b/Userland/Applications/Serendipity/SerendipityWindow.gml @@ -98,6 +98,9 @@ text: "Next Tip" } + @GUI::Widget { + } + } } diff --git a/Userland/Applications/Serendipity/main.cpp b/Userland/Applications/Serendipity/main.cpp index 260223ae07..b176dd12f6 100644 --- a/Userland/Applications/Serendipity/main.cpp +++ b/Userland/Applications/Serendipity/main.cpp @@ -26,10 +26,16 @@ #include "SerendipityWidget.h" #include +#include #include int main(int argc, char** argv) { + if (pledge("stdio recvfd sendfd rpath unix proc accept exec fattr", nullptr) < 0) { + perror("pledge"); + return 1; + } + auto app = GUI::Application::construct(argc, argv); if (pledge("stdio recvfd sendfd rpath unix proc accept exec", nullptr) < 0) { @@ -37,6 +43,8 @@ int main(int argc, char** argv) return 1; } + auto app_icon = GUI::Icon::default_icon("app-serendipity"); + if (unveil("/res", "r") < 0) { perror("unveil"); return 1; @@ -63,11 +71,12 @@ int main(int argc, char** argv) } auto window = GUI::Window::construct(); - window->set_minimum_size(480, 250); + window->resize(480, 250); window->center_on_screen(); window->set_title("Welcome"); - window->set_resizable(true); + window->set_minimum_size(480, 250); + window->set_icon(app_icon.bitmap_for_size(16)); window->set_main_widget(); window->show();