From 93a4a4c5975d8fe0d8ed1191509664ef22342b5d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 8 Apr 2019 17:17:16 +0200 Subject: [PATCH] Taskbar: Replace TaskbarWidget with a simple GFrame. There's no need for a custom widget here, at least not now. --- Applications/Taskbar/Makefile | 1 - Applications/Taskbar/TaskbarWidget.cpp | 24 ------------------------ Applications/Taskbar/TaskbarWidget.h | 14 -------------- Applications/Taskbar/TaskbarWindow.cpp | 12 ++++++++++-- LibGUI/GFrame.h | 2 +- 5 files changed, 11 insertions(+), 42 deletions(-) delete mode 100644 Applications/Taskbar/TaskbarWidget.cpp delete mode 100644 Applications/Taskbar/TaskbarWidget.h diff --git a/Applications/Taskbar/Makefile b/Applications/Taskbar/Makefile index 9b86e8dea62..3e6edc3144f 100644 --- a/Applications/Taskbar/Makefile +++ b/Applications/Taskbar/Makefile @@ -1,6 +1,5 @@ OBJS = \ TaskbarWindow.o \ - TaskbarWidget.o \ WindowList.o \ main.o diff --git a/Applications/Taskbar/TaskbarWidget.cpp b/Applications/Taskbar/TaskbarWidget.cpp deleted file mode 100644 index 1108dcd74d3..00000000000 --- a/Applications/Taskbar/TaskbarWidget.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "TaskbarWidget.h" -#include -#include -#include -#include -#include - -TaskbarWidget::TaskbarWidget(WindowList& window_list, GWidget* parent) - : GFrame(parent) - , m_window_list(window_list) -{ - set_fill_with_background_color(true); - set_layout(make(Orientation::Horizontal)); - layout()->set_margins({ 3, 2, 3, 2 }); - layout()->set_spacing(3); - - set_frame_thickness(1); - set_frame_shape(GFrame::Shape::Panel); - set_frame_shadow(GFrame::Shadow::Raised); -} - -TaskbarWidget::~TaskbarWidget() -{ -} diff --git a/Applications/Taskbar/TaskbarWidget.h b/Applications/Taskbar/TaskbarWidget.h deleted file mode 100644 index 4ba5b356c85..00000000000 --- a/Applications/Taskbar/TaskbarWidget.h +++ /dev/null @@ -1,14 +0,0 @@ -#include - -class WindowList; - -class TaskbarWidget final : public GFrame { -public: - TaskbarWidget(WindowList&, GWidget* parent = nullptr); - virtual ~TaskbarWidget() override; - - virtual const char* class_name() const override { return "TaskbarWidget"; } - -private: - WindowList& m_window_list; -}; diff --git a/Applications/Taskbar/TaskbarWindow.cpp b/Applications/Taskbar/TaskbarWindow.cpp index 1f1a8b1d4b8..866fdb230f1 100644 --- a/Applications/Taskbar/TaskbarWindow.cpp +++ b/Applications/Taskbar/TaskbarWindow.cpp @@ -1,9 +1,10 @@ #include "TaskbarWindow.h" -#include "TaskbarWidget.h" #include #include #include +#include #include +#include #include #include @@ -17,7 +18,14 @@ TaskbarWindow::TaskbarWindow() GDesktop::the().on_rect_change = [this] (const Rect& rect) { on_screen_rect_change(rect); }; - auto* widget = new TaskbarWidget(m_window_list); + auto* widget = new GFrame; + widget->set_fill_with_background_color(true); + widget->set_layout(make(Orientation::Horizontal)); + widget->layout()->set_margins({ 3, 2, 3, 2 }); + widget->layout()->set_spacing(3); + widget->set_frame_thickness(1); + widget->set_frame_shape(GFrame::Shape::Panel); + widget->set_frame_shadow(GFrame::Shadow::Raised); set_main_widget(widget); m_window_list.aid_create_button = [this] { diff --git a/LibGUI/GFrame.h b/LibGUI/GFrame.h index f0a2b7138f5..be10bf59fb4 100644 --- a/LibGUI/GFrame.h +++ b/LibGUI/GFrame.h @@ -4,7 +4,7 @@ class GFrame : public GWidget { public: - explicit GFrame(GWidget* parent); + explicit GFrame(GWidget* parent = nullptr); virtual ~GFrame() override; enum Shadow { Plain, Raised, Sunken };