diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-23 11:09:20 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-23 11:10:52 +0100 |
commit | bfd86c46316c0a7b0fca2b6966ec57884124caab (patch) | |
tree | 43e98365bf20dea6d7f827806ecfd9a797940939 | |
parent | 3d20da9ee451460b6e233f5efdf5a13e11525f97 (diff) | |
download | serenity-bfd86c46316c0a7b0fca2b6966ec57884124caab.zip |
LibGUI: Make GUI::Frame have the 2px sunken container look by default
The overwhelming majority of GUI::Frame users set the same appearance,
so let's just make it the default.
27 files changed, 7 insertions, 91 deletions
diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp index 082a819422..6c7a867cf3 100644 --- a/Applications/FileManager/PropertiesDialog.cpp +++ b/Applications/FileManager/PropertiesDialog.cpp @@ -276,9 +276,6 @@ void PropertiesDialog::make_divider(NonnullRefPtr<GUI::Widget>& parent) auto divider = parent->add<GUI::Frame>(); divider->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed); divider->set_preferred_size({ 0, 2 }); - divider->set_frame_shape(Gfx::FrameShape::HorizontalLine); - divider->set_frame_shadow(Gfx::FrameShadow::Sunken); - divider->set_frame_thickness(2); parent->layout()->add_spacer(); } diff --git a/Applications/FontEditor/GlyphEditorWidget.cpp b/Applications/FontEditor/GlyphEditorWidget.cpp index 1d0c350a9e..66adffdda5 100644 --- a/Applications/FontEditor/GlyphEditorWidget.cpp +++ b/Applications/FontEditor/GlyphEditorWidget.cpp @@ -32,9 +32,6 @@ GlyphEditorWidget::GlyphEditorWidget(Gfx::Font& mutable_font) : m_font(mutable_font) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); set_relative_rect({ 0, 0, preferred_width(), preferred_height() }); } diff --git a/Applications/FontEditor/GlyphMapWidget.cpp b/Applications/FontEditor/GlyphMapWidget.cpp index f057b46bb7..43ce3a234a 100644 --- a/Applications/FontEditor/GlyphMapWidget.cpp +++ b/Applications/FontEditor/GlyphMapWidget.cpp @@ -32,9 +32,6 @@ GlyphMapWidget::GlyphMapWidget(Gfx::Font& mutable_font) : m_font(mutable_font) { - set_frame_thickness(2); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); set_relative_rect({ 0, 0, preferred_width(), preferred_height() }); } diff --git a/Applications/HexEditor/HexEditor.cpp b/Applications/HexEditor/HexEditor.cpp index 1c4f1a53f7..6914cb1760 100644 --- a/Applications/HexEditor/HexEditor.cpp +++ b/Applications/HexEditor/HexEditor.cpp @@ -44,9 +44,6 @@ HexEditor::HexEditor(GUI::Widget* parent) : ScrollableWidget(parent) { - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); set_scrollbars_enabled(true); set_font(GFontDatabase::the().get_by_name("Csilla Thin")); set_background_role(ColorRole::Base); diff --git a/Applications/PaintBrush/PaletteWidget.cpp b/Applications/PaintBrush/PaletteWidget.cpp index e7394c10fd..fb6bcb077c 100644 --- a/Applications/PaintBrush/PaletteWidget.cpp +++ b/Applications/PaintBrush/PaletteWidget.cpp @@ -37,9 +37,6 @@ public: : m_palette_widget(palette_widget) , m_color(color) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); } virtual ~ColorWidget() override @@ -83,17 +80,11 @@ PaletteWidget::PaletteWidget(PaintableWidget& paintable_widget) set_preferred_size(0, 34); m_secondary_color_widget = add<GUI::Frame>(); - m_secondary_color_widget->set_frame_thickness(2); - m_secondary_color_widget->set_frame_shape(Gfx::FrameShape::Container); - m_secondary_color_widget->set_frame_shadow(Gfx::FrameShadow::Sunken); m_secondary_color_widget->set_relative_rect({ 2, 2, 60, 31 }); m_secondary_color_widget->set_fill_with_background_color(true); set_secondary_color(paintable_widget.secondary_color()); m_primary_color_widget = add<GUI::Frame>(); - m_primary_color_widget->set_frame_thickness(2); - m_primary_color_widget->set_frame_shape(Gfx::FrameShape::Container); - m_primary_color_widget->set_frame_shadow(Gfx::FrameShadow::Sunken); Gfx::Rect rect { 0, 0, 38, 15 }; rect.center_within(m_secondary_color_widget->relative_rect()); m_primary_color_widget->set_relative_rect(rect); diff --git a/Applications/Piano/KeysWidget.cpp b/Applications/Piano/KeysWidget.cpp index 9fd8779d5a..e757ef57c4 100644 --- a/Applications/Piano/KeysWidget.cpp +++ b/Applications/Piano/KeysWidget.cpp @@ -32,9 +32,6 @@ KeysWidget::KeysWidget(AudioEngine& audio_engine) : m_audio_engine(audio_engine) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); set_fill_with_background_color(true); } diff --git a/Applications/Piano/KnobsWidget.cpp b/Applications/Piano/KnobsWidget.cpp index c272ff80e8..0a4bf4b02f 100644 --- a/Applications/Piano/KnobsWidget.cpp +++ b/Applications/Piano/KnobsWidget.cpp @@ -36,9 +36,6 @@ KnobsWidget::KnobsWidget(AudioEngine& audio_engine, MainWidget& main_widget) : m_audio_engine(audio_engine) , m_main_widget(main_widget) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); set_layout(make<GUI::VerticalBoxLayout>()); set_fill_with_background_color(true); diff --git a/Applications/Piano/RollWidget.cpp b/Applications/Piano/RollWidget.cpp index 8efb6dd671..03b87413ac 100644 --- a/Applications/Piano/RollWidget.cpp +++ b/Applications/Piano/RollWidget.cpp @@ -36,10 +36,6 @@ constexpr int roll_height = note_count * note_height; RollWidget::RollWidget(AudioEngine& audio_engine) : m_audio_engine(audio_engine) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); - set_should_hide_unnecessary_scrollbars(true); set_content_size({ 0, roll_height }); vertical_scrollbar().set_value(roll_height / 2); diff --git a/Applications/Piano/SamplerWidget.cpp b/Applications/Piano/SamplerWidget.cpp index ea227659b9..2231afcea3 100644 --- a/Applications/Piano/SamplerWidget.cpp +++ b/Applications/Piano/SamplerWidget.cpp @@ -36,9 +36,6 @@ WaveEditor::WaveEditor(AudioEngine& audio_engine) : m_audio_engine(audio_engine) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); } WaveEditor::~WaveEditor() @@ -94,9 +91,6 @@ void WaveEditor::paint_event(GUI::PaintEvent& event) SamplerWidget::SamplerWidget(AudioEngine& audio_engine) : m_audio_engine(audio_engine) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); set_layout(make<GUI::VerticalBoxLayout>()); layout()->set_margins({ 10, 10, 10, 10 }); layout()->set_spacing(10); diff --git a/Applications/Piano/WaveWidget.cpp b/Applications/Piano/WaveWidget.cpp index 434f51cf4d..5d8f3d72be 100644 --- a/Applications/Piano/WaveWidget.cpp +++ b/Applications/Piano/WaveWidget.cpp @@ -33,9 +33,6 @@ WaveWidget::WaveWidget(AudioEngine& audio_engine) : m_audio_engine(audio_engine) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); } WaveWidget::~WaveWidget() diff --git a/Applications/QuickShow/QSWidget.cpp b/Applications/QuickShow/QSWidget.cpp index aebaa246f0..9adc2766e1 100644 --- a/Applications/QuickShow/QSWidget.cpp +++ b/Applications/QuickShow/QSWidget.cpp @@ -35,10 +35,6 @@ QSWidget::QSWidget(GUI::Widget* parent) : GUI::Frame(parent) { - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); - set_fill_with_background_color(true); set_background_color(Color::Black); } diff --git a/Applications/SoundPlayer/SampleWidget.cpp b/Applications/SoundPlayer/SampleWidget.cpp index 1346c218a3..06a6c53727 100644 --- a/Applications/SoundPlayer/SampleWidget.cpp +++ b/Applications/SoundPlayer/SampleWidget.cpp @@ -31,9 +31,6 @@ SampleWidget::SampleWidget() { - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); } SampleWidget::~SampleWidget() diff --git a/Applications/SystemMonitor/GraphWidget.cpp b/Applications/SystemMonitor/GraphWidget.cpp index 0a82a17b66..d3120e9ca0 100644 --- a/Applications/SystemMonitor/GraphWidget.cpp +++ b/Applications/SystemMonitor/GraphWidget.cpp @@ -30,9 +30,6 @@ GraphWidget::GraphWidget() { - set_frame_thickness(2); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); } GraphWidget::~GraphWidget() diff --git a/DevTools/HackStudio/FormEditorWidget.cpp b/DevTools/HackStudio/FormEditorWidget.cpp index 24c778e549..f8ee8e112b 100644 --- a/DevTools/HackStudio/FormEditorWidget.cpp +++ b/DevTools/HackStudio/FormEditorWidget.cpp @@ -36,10 +36,6 @@ FormEditorWidget::FormEditorWidget() set_fill_with_background_color(true); set_background_color(Color::MidGray); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); - m_form_widget = add<FormWidget>(); m_widget_tree_model = WidgetTreeModel::create(*m_form_widget); } diff --git a/DevTools/ProfileViewer/ProfileTimelineWidget.cpp b/DevTools/ProfileViewer/ProfileTimelineWidget.cpp index d65e994eab..e927033c1e 100644 --- a/DevTools/ProfileViewer/ProfileTimelineWidget.cpp +++ b/DevTools/ProfileViewer/ProfileTimelineWidget.cpp @@ -32,9 +32,6 @@ ProfileTimelineWidget::ProfileTimelineWidget(Profile& profile, GUI::Widget* pare : GUI::Frame(parent) , m_profile(profile) { - set_frame_thickness(2); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_shape(Gfx::FrameShape::Container); set_background_color(Color::White); set_fill_with_background_color(true); set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed); diff --git a/Games/Minesweeper/Field.cpp b/Games/Minesweeper/Field.cpp index e521dde58c..17250264ca 100644 --- a/Games/Minesweeper/Field.cpp +++ b/Games/Minesweeper/Field.cpp @@ -132,9 +132,6 @@ Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_b m_time_label.set_text(String::format("%u.%u", m_time_elapsed / 10, m_time_elapsed % 10)); }; m_timer->set_interval(100); - set_frame_thickness(2); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); m_mine_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/mine.png"); m_flag_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/flag.png"); m_badflag_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/badflag.png"); diff --git a/Libraries/LibGUI/AbstractTableView.cpp b/Libraries/LibGUI/AbstractTableView.cpp index 6c82e440ae..13a6e5bba5 100644 --- a/Libraries/LibGUI/AbstractTableView.cpp +++ b/Libraries/LibGUI/AbstractTableView.cpp @@ -42,10 +42,6 @@ static const int minimum_column_width = 2; AbstractTableView::AbstractTableView(Widget* parent) : AbstractView(parent) { - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); - set_should_hide_unnecessary_scrollbars(true); } diff --git a/Libraries/LibGUI/ColumnsView.cpp b/Libraries/LibGUI/ColumnsView.cpp index 62a86e422a..296b345c97 100644 --- a/Libraries/LibGUI/ColumnsView.cpp +++ b/Libraries/LibGUI/ColumnsView.cpp @@ -53,10 +53,6 @@ ColumnsView::ColumnsView(Widget* parent) set_fill_with_background_color(true); set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); - m_columns.append({ {}, 0 }); } diff --git a/Libraries/LibGUI/FilePicker.cpp b/Libraries/LibGUI/FilePicker.cpp index 9b5b78a434..008e8c53b5 100644 --- a/Libraries/LibGUI/FilePicker.cpp +++ b/Libraries/LibGUI/FilePicker.cpp @@ -225,9 +225,6 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView& auto preview_container = horizontal_container->add<Frame>(); preview_container->set_size_policy(SizePolicy::Fixed, SizePolicy::Fill); preview_container->set_preferred_size(180, 0); - preview_container->set_frame_shape(Gfx::FrameShape::Container); - preview_container->set_frame_shadow(Gfx::FrameShadow::Sunken); - preview_container->set_frame_thickness(2); preview_container->set_layout(make<VerticalBoxLayout>()); preview_container->layout()->set_margins({ 8, 8, 8, 8 }); diff --git a/Libraries/LibGUI/Frame.cpp b/Libraries/LibGUI/Frame.cpp index 6025e72698..18fd5eefeb 100644 --- a/Libraries/LibGUI/Frame.cpp +++ b/Libraries/LibGUI/Frame.cpp @@ -34,6 +34,9 @@ namespace GUI { Frame::Frame(Widget* parent) : Widget(parent) { + set_frame_thickness(2); + set_frame_shape(Gfx::FrameShape::Container); + set_frame_shadow(Gfx::FrameShadow::Sunken); } Frame::~Frame() diff --git a/Libraries/LibGUI/ItemView.cpp b/Libraries/LibGUI/ItemView.cpp index 4cae359cac..3c4a394e73 100644 --- a/Libraries/LibGUI/ItemView.cpp +++ b/Libraries/LibGUI/ItemView.cpp @@ -42,9 +42,6 @@ ItemView::ItemView(Widget* parent) { set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); horizontal_scrollbar().set_visible(false); } diff --git a/Libraries/LibGUI/Label.cpp b/Libraries/LibGUI/Label.cpp index 944d66084e..09a4dc87be 100644 --- a/Libraries/LibGUI/Label.cpp +++ b/Libraries/LibGUI/Label.cpp @@ -33,7 +33,7 @@ namespace GUI { Label::Label(Widget* parent) - : Frame(parent) + : Label({}, parent) { } @@ -41,6 +41,9 @@ Label::Label(const StringView& text, Widget* parent) : Frame(parent) , m_text(text) { + set_frame_thickness(0); + set_frame_shadow(Gfx::FrameShadow::Plain); + set_frame_shape(Gfx::FrameShape::NoFrame); } Label::~Label() diff --git a/Libraries/LibGUI/ListView.cpp b/Libraries/LibGUI/ListView.cpp index bdc1c5248a..d87339e27d 100644 --- a/Libraries/LibGUI/ListView.cpp +++ b/Libraries/LibGUI/ListView.cpp @@ -38,9 +38,6 @@ ListView::ListView(Widget* parent) { set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); } ListView::~ListView() diff --git a/Libraries/LibGUI/ProgressBar.cpp b/Libraries/LibGUI/ProgressBar.cpp index 92dfc06f04..4fee5a63c6 100644 --- a/Libraries/LibGUI/ProgressBar.cpp +++ b/Libraries/LibGUI/ProgressBar.cpp @@ -35,9 +35,6 @@ namespace GUI { ProgressBar::ProgressBar(Widget* parent) : Frame(parent) { - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); } ProgressBar::~ProgressBar() diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp index 74774c79f5..736ac7ec0b 100644 --- a/Libraries/LibGUI/TextEditor.cpp +++ b/Libraries/LibGUI/TextEditor.cpp @@ -61,9 +61,6 @@ TextEditor::TextEditor(Type type, Widget* parent) set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); set_document(TextDocument::create()); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); set_scrollbars_enabled(is_multi_line()); set_font(GFontDatabase::the().get_by_name("Csilla Thin")); // FIXME: Recompute vertical scrollbar step size on font change. diff --git a/Libraries/LibHTML/HtmlView.cpp b/Libraries/LibHTML/HtmlView.cpp index c6412d3c3e..ea2178aab0 100644 --- a/Libraries/LibHTML/HtmlView.cpp +++ b/Libraries/LibHTML/HtmlView.cpp @@ -59,9 +59,6 @@ HtmlView::HtmlView() update(adjusted_rect); }; - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); set_should_hide_unnecessary_scrollbars(true); set_background_role(ColorRole::Base); } diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp index afb76a01ed..9ecb9f8fcc 100644 --- a/Libraries/LibVT/TerminalWidget.cpp +++ b/Libraries/LibVT/TerminalWidget.cpp @@ -92,10 +92,6 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co m_cursor_blink_timer = add<Core::Timer>(); m_visual_beep_timer = add<Core::Timer>(); - set_frame_shape(Gfx::FrameShape::Container); - set_frame_shadow(Gfx::FrameShadow::Sunken); - set_frame_thickness(2); - m_scrollbar = add<GUI::ScrollBar>(Orientation::Vertical); m_scrollbar->set_relative_rect(0, 0, 16, 0); m_scrollbar->on_change = [this](int) { |