summaryrefslogtreecommitdiff
path: root/Userland/Applications/SystemMonitor/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-04 22:04:49 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-04 22:43:43 +0200
commit9cba533e360a847fb76f4ebe32e3e0bb9b1e5e07 (patch)
treeb2522a8f360f14144e1d6f1019ebe1a70572e2f5 /Userland/Applications/SystemMonitor/main.cpp
parenta1b7bd6feaee862384b358ab10bd1ad6365df6de (diff)
downloadserenity-9cba533e360a847fb76f4ebe32e3e0bb9b1e5e07.zip
SystemMonitor: Tweak main UI layout :^)
Diffstat (limited to 'Userland/Applications/SystemMonitor/main.cpp')
-rw-r--r--Userland/Applications/SystemMonitor/main.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp
index c2bcf2a021..814825d2ad 100644
--- a/Userland/Applications/SystemMonitor/main.cpp
+++ b/Userland/Applications/SystemMonitor/main.cpp
@@ -49,6 +49,7 @@
#include <LibGUI/Menu.h>
#include <LibGUI/MenuBar.h>
#include <LibGUI/Painter.h>
+#include <LibGUI/SeparatorWidget.h>
#include <LibGUI/SortingProxyModel.h>
#include <LibGUI/Splitter.h>
#include <LibGUI/StackWidget.h>
@@ -174,14 +175,21 @@ int main(int argc, char** argv)
window->set_title("System Monitor");
window->resize(680, 400);
- auto& keeper = window->set_main_widget<GUI::Widget>();
- keeper.set_layout<GUI::VerticalBoxLayout>();
- keeper.set_fill_with_background_color(true);
- keeper.layout()->set_margins({ 2, 2, 2, 0 });
+ auto& main_widget = window->set_main_widget<GUI::Widget>();
+ main_widget.set_layout<GUI::VerticalBoxLayout>();
+ main_widget.set_fill_with_background_color(true);
+
+ // Add a tasteful separating line between the menu and the main UI.
+ auto& top_line = main_widget.add<GUI::SeparatorWidget>(Gfx::Orientation::Horizontal);
+ top_line.set_fixed_height(2);
+
+ auto& tabwidget_container = main_widget.add<GUI::Widget>();
+ tabwidget_container.set_layout<GUI::VerticalBoxLayout>();
+ tabwidget_container.layout()->set_margins({ 4, 0, 4, 4 });
+ auto& tabwidget = tabwidget_container.add<GUI::TabWidget>();
- auto& tabwidget = keeper.add<GUI::TabWidget>();
+ auto& statusbar = main_widget.add<GUI::StatusBar>(2);
- auto& statusbar = keeper.add<GUI::StatusBar>(2);
auto process_model = ProcessModel::create();
process_model->on_state_update = [&](int process_count, int thread_count) {
statusbar.set_text(0, String::formatted("Processes: {}", process_count));