2019-10-11 23:16:53 +02:00
|
|
|
#include <LibGUI/GPainter.h>
|
|
|
|
#include <LibHTML/Layout/LayoutListItemMarker.h>
|
|
|
|
|
|
|
|
LayoutListItemMarker::LayoutListItemMarker()
|
2019-10-15 16:48:38 +02:00
|
|
|
: LayoutBox(nullptr, StyleProperties::create())
|
2019-10-11 23:16:53 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
LayoutListItemMarker::~LayoutListItemMarker()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void LayoutListItemMarker::render(RenderingContext& context)
|
|
|
|
{
|
|
|
|
Rect bullet_rect { 0, 0, 4, 4 };
|
2019-11-18 16:25:38 +01:00
|
|
|
bullet_rect.center_within(enclosing_int_rect(rect()));
|
2019-10-19 11:54:28 +02:00
|
|
|
// FIXME: It would be nicer to not have to go via the parent here to get our inherited style.
|
2020-01-05 00:09:35 +03:00
|
|
|
auto color = parent()->style().color_or_fallback(CSS::PropertyID::Color, document(), context.palette().base_text());
|
|
|
|
context.painter().fill_rect(bullet_rect, color);
|
2019-10-11 23:16:53 +02:00
|
|
|
}
|