1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibGfx: Move StandardCursor enum to LibGfx

This enum existed both in LibGUI and WindowServer which was silly and
error-prone.
This commit is contained in:
Andreas Kling 2020-09-10 19:25:13 +02:00
parent c063a02979
commit 0f9be82826
23 changed files with 127 additions and 111 deletions

View file

@ -274,12 +274,12 @@ void HexEditor::mousemove_event(GUI::MouseEvent& event)
auto text_end_x = text_start_x + (bytes_per_row() * character_width());
auto text_end_y = text_start_y + 5 + (total_rows() * line_height());
window()->set_override_cursor(GUI::StandardCursor::None);
window()->set_override_cursor(Gfx::StandardCursor::None);
if ((absolute_x >= hex_start_x && absolute_x <= hex_end_x
&& absolute_y >= hex_start_y && absolute_y <= hex_end_y)
|| (absolute_x >= text_start_x && absolute_x <= text_end_x
&& absolute_y >= text_start_y && absolute_y <= text_end_y)) {
window()->set_override_cursor(GUI::StandardCursor::IBeam);
window()->set_override_cursor(Gfx::StandardCursor::IBeam);
}
if (m_in_drag_select) {
@ -585,5 +585,5 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
void HexEditor::leave_event(Core::Event&)
{
ASSERT(window());
window()->set_override_cursor(GUI::StandardCursor::None);
window()->set_override_cursor(Gfx::StandardCursor::None);
}

View file

@ -81,16 +81,16 @@ void KeyButton::mousemove_event(GUI::MouseEvent& event)
Gfx::IntRect c = { rect().x() + 7, rect().y() + 4, rect().width() - 14, rect().height() - 14 };
if (c.contains(event.position())) {
window()->set_override_cursor(GUI::StandardCursor::Hand);
window()->set_override_cursor(Gfx::StandardCursor::Hand);
return;
}
window()->set_override_cursor(GUI::StandardCursor::Arrow);
window()->set_override_cursor(Gfx::StandardCursor::Arrow);
AbstractButton::mousemove_event(event);
}
void KeyButton::leave_event(Core::Event& event)
{
window()->set_override_cursor(GUI::StandardCursor::Arrow);
window()->set_override_cursor(Gfx::StandardCursor::Arrow);
AbstractButton::leave_event(event);
}

View file

@ -52,7 +52,7 @@ void MoveTool::on_mousedown(Layer& layer, GUI::MouseEvent& event, GUI::MouseEven
m_layer_being_moved = layer;
m_event_origin = image_event.position();
m_layer_origin = layer.location();
m_editor->window()->set_override_cursor(GUI::StandardCursor::Move);
m_editor->window()->set_override_cursor(Gfx::StandardCursor::Move);
}
void MoveTool::on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent& image_event)
@ -69,7 +69,7 @@ void MoveTool::on_mouseup(Layer&, GUI::MouseEvent& event, GUI::MouseEvent&)
if (event.button() != GUI::MouseButton::Left)
return;
m_layer_being_moved = nullptr;
m_editor->window()->set_override_cursor(GUI::StandardCursor::None);
m_editor->window()->set_override_cursor(Gfx::StandardCursor::None);
}
void MoveTool::on_keydown(GUI::KeyEvent& event)