diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-10 13:16:36 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-10 13:16:36 +0100 |
commit | 5d69bf06d231cb3fee25f79065461198dbb8cb53 (patch) | |
tree | 7a4490c16dfbe95f217b8b908c507130c515777a | |
parent | 6836e21d1c9e1e9b00b5f87ac988d2f2a7639796 (diff) | |
download | serenity-5d69bf06d231cb3fee25f79065461198dbb8cb53.zip |
LibGUI: Don't fill widgets with background color by defualt.
-rw-r--r-- | Applications/FontEditor/FontEditor.cpp | 2 | ||||
-rw-r--r-- | Applications/Launcher/main.cpp | 1 | ||||
-rw-r--r-- | Applications/ProcessManager/MemoryStatsWidget.cpp | 5 | ||||
-rw-r--r-- | Applications/ProcessManager/main.cpp | 1 | ||||
-rw-r--r-- | Applications/Terminal/Terminal.cpp | 2 | ||||
-rw-r--r-- | Applications/TextEditor/main.cpp | 1 | ||||
-rw-r--r-- | LibGUI/GButton.cpp | 1 | ||||
-rw-r--r-- | LibGUI/GLabel.cpp | 6 | ||||
-rw-r--r-- | LibGUI/GLabel.h | 1 | ||||
-rw-r--r-- | LibGUI/GStatusBar.cpp | 1 | ||||
-rw-r--r-- | LibGUI/GTableView.cpp | 2 | ||||
-rw-r--r-- | LibGUI/GTextEditor.cpp | 2 | ||||
-rw-r--r-- | LibGUI/GToolBar.cpp | 1 | ||||
-rw-r--r-- | LibGUI/GWidget.h | 2 |
14 files changed, 12 insertions, 16 deletions
diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp index 2207e2618f..5d4a223775 100644 --- a/Applications/FontEditor/FontEditor.cpp +++ b/Applications/FontEditor/FontEditor.cpp @@ -9,6 +9,8 @@ FontEditorWidget::FontEditorWidget(const String& path, RetainPtr<Font>&& edited_ : GWidget(parent) , m_edited_font(move(edited_font)) { + set_fill_with_background_color(true); + if (path.is_empty()) m_path = "/tmp/saved.font"; else diff --git a/Applications/Launcher/main.cpp b/Applications/Launcher/main.cpp index 7d46a40e20..44aca4d460 100644 --- a/Applications/Launcher/main.cpp +++ b/Applications/Launcher/main.cpp @@ -64,6 +64,7 @@ GWindow* make_launcher_window() window->set_rect(50, 50, 300, 60); auto* widget = new GWidget; + widget->set_fill_with_background_color(true); widget->set_layout(make<GBoxLayout>(Orientation::Horizontal)); widget->layout()->set_margins({ 5, 5, 5, 5 }); window->set_main_widget(widget); diff --git a/Applications/ProcessManager/MemoryStatsWidget.cpp b/Applications/ProcessManager/MemoryStatsWidget.cpp index 6dd576c77c..5143ee9a71 100644 --- a/Applications/ProcessManager/MemoryStatsWidget.cpp +++ b/Applications/ProcessManager/MemoryStatsWidget.cpp @@ -18,17 +18,14 @@ MemoryStatsWidget::MemoryStatsWidget(GWidget* parent) auto build_widgets_for_label = [this] (const String& description) -> GLabel* { auto* container = new GWidget(this); - container->set_fill_with_background_color(false); container->set_layout(make<GBoxLayout>(Orientation::Horizontal)); container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); container->set_preferred_size({ 250, 12 }); - auto* description_label = new GLabel(container); + auto* description_label = new GLabel(description, container); description_label->set_font(Font::default_bold_font()); description_label->set_text_alignment(TextAlignment::CenterLeft); - description_label->set_text(description); auto* label = new GLabel(container); label->set_text_alignment(TextAlignment::CenterRight); - label->set_fill_with_background_color(false); return label; }; diff --git a/Applications/ProcessManager/main.cpp b/Applications/ProcessManager/main.cpp index bcb0b9d652..14008e63b7 100644 --- a/Applications/ProcessManager/main.cpp +++ b/Applications/ProcessManager/main.cpp @@ -16,7 +16,6 @@ int main(int argc, char** argv) GApplication app(argc, argv); auto* widget = new GWidget; - widget->set_fill_with_background_color(false); widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); auto* toolbar = new GToolBar(widget); diff --git a/Applications/Terminal/Terminal.cpp b/Applications/Terminal/Terminal.cpp index 25df6def7d..e065e6b35a 100644 --- a/Applications/Terminal/Terminal.cpp +++ b/Applications/Terminal/Terminal.cpp @@ -41,8 +41,6 @@ Terminal::Terminal(int ptm_fd) flush_dirty_lines(); }; - set_fill_with_background_color(false); - m_line_height = font().glyph_height() + m_line_spacing; set_size(80, 25); diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp index d6bb29b676..78d9f16993 100644 --- a/Applications/TextEditor/main.cpp +++ b/Applications/TextEditor/main.cpp @@ -19,7 +19,6 @@ int main(int argc, char** argv) GApplication app(argc, argv); auto* widget = new GWidget; - widget->set_fill_with_background_color(false); widget->set_layout(make<GBoxLayout>(Orientation::Vertical)); auto* toolbar = new GToolBar(widget); diff --git a/LibGUI/GButton.cpp b/LibGUI/GButton.cpp index f612cac7c2..4b1a35b988 100644 --- a/LibGUI/GButton.cpp +++ b/LibGUI/GButton.cpp @@ -7,7 +7,6 @@ GButton::GButton(GWidget* parent) : GWidget(parent) { - set_fill_with_background_color(false); } GButton::~GButton() diff --git a/LibGUI/GLabel.cpp b/LibGUI/GLabel.cpp index 2962d04051..c674a674a6 100644 --- a/LibGUI/GLabel.cpp +++ b/LibGUI/GLabel.cpp @@ -7,6 +7,12 @@ GLabel::GLabel(GWidget* parent) { } +GLabel::GLabel(const String& text, GWidget* parent) + : GWidget(parent) + , m_text(text) +{ +} + GLabel::~GLabel() { } diff --git a/LibGUI/GLabel.h b/LibGUI/GLabel.h index 29d42eb465..6f1e9fc700 100644 --- a/LibGUI/GLabel.h +++ b/LibGUI/GLabel.h @@ -9,6 +9,7 @@ class GraphicsBitmap; class GLabel final : public GWidget { public: explicit GLabel(GWidget* parent); + GLabel(const String& text, GWidget* parent); virtual ~GLabel() override; String text() const { return m_text; } diff --git a/LibGUI/GStatusBar.cpp b/LibGUI/GStatusBar.cpp index a4b54f46ae..982e2d565b 100644 --- a/LibGUI/GStatusBar.cpp +++ b/LibGUI/GStatusBar.cpp @@ -13,7 +13,6 @@ GStatusBar::GStatusBar(GWidget* parent) 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); } GStatusBar::~GStatusBar() diff --git a/LibGUI/GTableView.cpp b/LibGUI/GTableView.cpp index 61f64df896..f7918d4949 100644 --- a/LibGUI/GTableView.cpp +++ b/LibGUI/GTableView.cpp @@ -7,8 +7,6 @@ GTableView::GTableView(GWidget* parent) : GWidget(parent) { - set_fill_with_background_color(false); - m_vertical_scrollbar = new GScrollBar(Orientation::Vertical, this); m_vertical_scrollbar->set_step(4); m_vertical_scrollbar->on_change = [this] (int) { diff --git a/LibGUI/GTextEditor.cpp b/LibGUI/GTextEditor.cpp index bbaaface65..98b1f5a7d4 100644 --- a/LibGUI/GTextEditor.cpp +++ b/LibGUI/GTextEditor.cpp @@ -14,8 +14,6 @@ GTextEditor::GTextEditor(GWidget* parent) { set_font(GFontDatabase::the().get_by_name("Csilla Thin")); - set_fill_with_background_color(false); - m_vertical_scrollbar = new GScrollBar(Orientation::Vertical, this); m_vertical_scrollbar->set_step(4); m_vertical_scrollbar->on_change = [this] (int) { diff --git a/LibGUI/GToolBar.cpp b/LibGUI/GToolBar.cpp index e052e5fd1c..3024e218f8 100644 --- a/LibGUI/GToolBar.cpp +++ b/LibGUI/GToolBar.cpp @@ -46,7 +46,6 @@ public: SeparatorWidget(GWidget* parent) : GWidget(parent) { - set_fill_with_background_color(false); set_size_policy(SizePolicy::Fixed, SizePolicy::Fixed); set_background_color(Color::White); set_preferred_size({ 8, 20 }); diff --git a/LibGUI/GWidget.h b/LibGUI/GWidget.h index 0a287e5988..a7fa50c8b7 100644 --- a/LibGUI/GWidget.h +++ b/LibGUI/GWidget.h @@ -140,5 +140,5 @@ private: SizePolicy m_vertical_size_policy { SizePolicy::Fill }; Size m_preferred_size; - bool m_fill_with_background_color { true }; + bool m_fill_with_background_color { false }; }; |