summaryrefslogtreecommitdiff
path: root/LibGUI/GStatusBar.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-04 10:47:54 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-04 10:47:54 +0100
commit4ea7a51ecdd1913698cb80f911301a3633f57781 (patch)
tree637f41ab3a2f752cfe9e8a6a87bb9945e3592caa /LibGUI/GStatusBar.cpp
parentac2a3f7fdf270f771b61a546f6b67ab026971413 (diff)
downloadserenity-4ea7a51ecdd1913698cb80f911301a3633f57781.zip
LibGUI: Improve GStatusBar and GToolBar and share some code via GStyle.
Diffstat (limited to 'LibGUI/GStatusBar.cpp')
-rw-r--r--LibGUI/GStatusBar.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/LibGUI/GStatusBar.cpp b/LibGUI/GStatusBar.cpp
index 9b0e0d2034..a4b54f46ae 100644
--- a/LibGUI/GStatusBar.cpp
+++ b/LibGUI/GStatusBar.cpp
@@ -1,15 +1,16 @@
#include <LibGUI/GStatusBar.h>
#include <LibGUI/GLabel.h>
#include <LibGUI/GBoxLayout.h>
+#include <LibGUI/GStyle.h>
#include <SharedGraphics/Painter.h>
GStatusBar::GStatusBar(GWidget* parent)
: GWidget(parent)
{
set_size_policy(SizePolicy::Fill, SizePolicy::Fixed);
- set_preferred_size({ 0, 18 });
+ set_preferred_size({ 0, 20 });
set_layout(make<GBoxLayout>(Orientation::Horizontal));
- layout()->set_margins({ 1, 1, 1, 1 });
+ layout()->set_margins({ 4, 2, 4, 2 });
m_label = new GLabel(this);
m_label->set_text_alignment(TextAlignment::CenterLeft);
m_label->set_fill_with_background_color(false);
@@ -33,7 +34,5 @@ void GStatusBar::paint_event(GPaintEvent& event)
{
Painter painter(*this);
painter.set_clip_rect(event.rect());
- painter.fill_rect({ 0, 1, width(), height() - 1 }, Color::LightGray);
- painter.draw_line({ 0, 0 }, { width() - 1, 0 }, Color::White);
- painter.draw_line({ 0, rect().bottom() }, { width() - 1, rect().bottom() }, Color::DarkGray);
+ GStyle::the().paint_surface(painter, rect());
}