mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 18:55:07 +00:00
WindowServer: Improve look of drag&drop items somewhat
This just adds a bit of padding around items. There's lots of room for improvement here.
This commit is contained in:
parent
0391806eec
commit
ce4ee1df1b
2 changed files with 4 additions and 3 deletions
|
@ -461,14 +461,15 @@ void Compositor::compose()
|
||||||
// TODO: render once into a backing bitmap, then just blit...
|
// TODO: render once into a backing bitmap, then just blit...
|
||||||
auto render_dnd = [&]() {
|
auto render_dnd = [&]() {
|
||||||
back_painter.fill_rect(dnd_rect, wm.palette().selection().with_alpha(200));
|
back_painter.fill_rect(dnd_rect, wm.palette().selection().with_alpha(200));
|
||||||
|
back_painter.draw_rect(dnd_rect, wm.palette().selection());
|
||||||
if (!wm.dnd_text().is_empty()) {
|
if (!wm.dnd_text().is_empty()) {
|
||||||
auto text_rect = dnd_rect;
|
auto text_rect = dnd_rect;
|
||||||
if (wm.dnd_bitmap())
|
if (wm.dnd_bitmap())
|
||||||
text_rect.move_by(wm.dnd_bitmap()->width(), 0);
|
text_rect.move_by(wm.dnd_bitmap()->width() + 8, 0);
|
||||||
back_painter.draw_text(text_rect, wm.dnd_text(), Gfx::TextAlignment::CenterLeft, wm.palette().selection_text());
|
back_painter.draw_text(text_rect, wm.dnd_text(), Gfx::TextAlignment::CenterLeft, wm.palette().selection_text());
|
||||||
}
|
}
|
||||||
if (wm.dnd_bitmap()) {
|
if (wm.dnd_bitmap()) {
|
||||||
back_painter.blit(dnd_rect.top_left(), *wm.dnd_bitmap(), wm.dnd_bitmap()->rect());
|
back_painter.blit(dnd_rect.top_left().translated(4, 4), *wm.dnd_bitmap(), wm.dnd_bitmap()->rect());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1381,7 +1381,7 @@ Gfx::IntRect WindowManager::dnd_rect() const
|
||||||
int width = font().width(m_dnd_text) + bitmap_width;
|
int width = font().width(m_dnd_text) + bitmap_width;
|
||||||
int height = max((int)font().glyph_height(), bitmap_height);
|
int height = max((int)font().glyph_height(), bitmap_height);
|
||||||
auto location = Compositor::the().current_cursor_rect().center().translated(8, 8);
|
auto location = Compositor::the().current_cursor_rect().center().translated(8, 8);
|
||||||
return Gfx::IntRect(location, { width, height }).inflated(4, 4);
|
return Gfx::IntRect(location, { width, height }).inflated(16, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowManager::update_theme(String theme_path, String theme_name)
|
bool WindowManager::update_theme(String theme_path, String theme_name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue