1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 01:55:00 +00:00

LibGUI: Put all classes in the GUI namespace and remove the leading G

This took me a moment. Welcome to the new world of GUI::Widget! :^)
This commit is contained in:
Andreas Kling 2020-02-02 15:07:41 +01:00
parent 2d39da5405
commit c5bd9d4ed1
337 changed files with 5400 additions and 4816 deletions

View file

@ -36,23 +36,25 @@
#include <LibGUI/GTextBox.h>
#include <LibGUI/GWindow.h>
GTableView::GTableView(GWidget* parent)
: GAbstractTableView(parent)
namespace GUI {
TableView::TableView(Widget* parent)
: AbstractTableView(parent)
{
set_background_role(ColorRole::Base);
set_foreground_role(ColorRole::BaseText);
}
GTableView::~GTableView()
TableView::~TableView()
{
}
void GTableView::paint_event(GPaintEvent& event)
void TableView::paint_event(PaintEvent& event)
{
Color widget_background_color = palette().color(background_role());
GFrame::paint_event(event);
Frame::paint_event(event);
GPainter painter(*this);
Painter painter(*this);
painter.add_clip_rect(frame_inner_rect());
painter.add_clip_rect(event.rect());
painter.fill_rect(event.rect(), widget_background_color);
@ -125,7 +127,7 @@ void GTableView::paint_event(GPaintEvent& event)
if (is_selected_row)
text_color = palette().selection_text();
else
text_color = model()->data(cell_index, GModel::Role::ForegroundColor).to_color(palette().color(foreground_role()));
text_color = model()->data(cell_index, Model::Role::ForegroundColor).to_color(palette().color(foreground_role()));
painter.draw_text(cell_rect, data.to_string(), font, column_metadata.text_alignment, text_color, TextElision::Right);
}
}
@ -142,3 +144,5 @@ void GTableView::paint_event(GPaintEvent& event)
if (headers_visible())
paint_headers(painter);
}
}