mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:27:34 +00:00
PixelPaint: Use eyedropper cursor when color picking using Alt key
This commit is contained in:
parent
45e60a416b
commit
2f5bbc68ed
1 changed files with 17 additions and 4 deletions
|
@ -425,7 +425,9 @@ void ImageEditor::mousemove_event(GUI::MouseEvent& event)
|
||||||
|
|
||||||
void ImageEditor::mouseup_event(GUI::MouseEvent& event)
|
void ImageEditor::mouseup_event(GUI::MouseEvent& event)
|
||||||
{
|
{
|
||||||
set_override_cursor(m_active_cursor);
|
if (!(m_active_tool && event.alt() && !m_active_tool->is_overriding_alt()))
|
||||||
|
set_override_cursor(m_active_cursor);
|
||||||
|
|
||||||
if (event.button() == GUI::MouseButton::Middle) {
|
if (event.button() == GUI::MouseButton::Middle) {
|
||||||
stop_panning();
|
stop_panning();
|
||||||
return;
|
return;
|
||||||
|
@ -454,7 +456,13 @@ void ImageEditor::keydown_event(GUI::KeyEvent& event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_active_tool && m_active_tool->on_keydown(event))
|
if (!m_active_tool)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!m_active_tool->is_overriding_alt() && event.key() == Key_Alt)
|
||||||
|
set_override_cursor(Gfx::StandardCursor::Eyedropper);
|
||||||
|
|
||||||
|
if (m_active_tool->on_keydown(event))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event.key() == Key_Escape && !m_image->selection().is_empty()) {
|
if (event.key() == Key_Escape && !m_image->selection().is_empty()) {
|
||||||
|
@ -468,8 +476,13 @@ void ImageEditor::keydown_event(GUI::KeyEvent& event)
|
||||||
|
|
||||||
void ImageEditor::keyup_event(GUI::KeyEvent& event)
|
void ImageEditor::keyup_event(GUI::KeyEvent& event)
|
||||||
{
|
{
|
||||||
if (m_active_tool)
|
if (!m_active_tool)
|
||||||
m_active_tool->on_keyup(event);
|
return;
|
||||||
|
|
||||||
|
if (!m_active_tool->is_overriding_alt() && event.key() == Key_Alt)
|
||||||
|
update_tool_cursor();
|
||||||
|
|
||||||
|
m_active_tool->on_keyup(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImageEditor::enter_event(Core::Event&)
|
void ImageEditor::enter_event(Core::Event&)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue