mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 23:25:08 +00:00
LibGUI: Tweak focus appearance and add it to GTableView.
This commit is contained in:
parent
5c27e74fac
commit
ef4d517429
2 changed files with 11 additions and 1 deletions
|
@ -163,6 +163,16 @@ void GTableView::paint_event(GPaintEvent& event)
|
||||||
// Then untranslate and fill in the scroll corner. This is pretty messy, tbh.
|
// Then untranslate and fill in the scroll corner. This is pretty messy, tbh.
|
||||||
painter.translate(m_horizontal_scrollbar->value(), 0);
|
painter.translate(m_horizontal_scrollbar->value(), 0);
|
||||||
painter.fill_rect({ m_horizontal_scrollbar->relative_rect().top_right().translated(1, 0), { m_vertical_scrollbar->preferred_size().width(), m_horizontal_scrollbar->preferred_size().height() } }, Color::LightGray);
|
painter.fill_rect({ m_horizontal_scrollbar->relative_rect().top_right().translated(1, 0), { m_vertical_scrollbar->preferred_size().width(), m_horizontal_scrollbar->preferred_size().height() } }, Color::LightGray);
|
||||||
|
|
||||||
|
if (is_focused()) {
|
||||||
|
Rect item_area_rect {
|
||||||
|
0,
|
||||||
|
header_height(),
|
||||||
|
width() - m_vertical_scrollbar->width(),
|
||||||
|
height() - header_height() - m_horizontal_scrollbar->height()
|
||||||
|
};
|
||||||
|
painter.draw_rect(item_area_rect, Color::from_rgb(0x84351a));
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
int GTableView::item_count() const
|
int GTableView::item_count() const
|
||||||
|
|
|
@ -445,7 +445,7 @@ void Painter::draw_focus_rect(const Rect& rect)
|
||||||
focus_rect.move_by(1, 1);
|
focus_rect.move_by(1, 1);
|
||||||
focus_rect.set_width(focus_rect.width() - 2);
|
focus_rect.set_width(focus_rect.width() - 2);
|
||||||
focus_rect.set_height(focus_rect.height() - 2);
|
focus_rect.set_height(focus_rect.height() - 2);
|
||||||
draw_rect(focus_rect, Color(96, 96, 192));
|
draw_rect(focus_rect, Color::from_rgb(0x84351a));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Painter::set_clip_rect(const Rect& rect)
|
void Painter::set_clip_rect(const Rect& rect)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue