1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

Everywhere: Rename left/right-click to primary/secondary

This resolves #10641.
This commit is contained in:
Filiph Sandström 2021-10-27 13:20:27 +02:00 committed by Idan Horowitz
parent a6ccf6659a
commit d6a0726302
79 changed files with 183 additions and 183 deletions

View file

@ -32,7 +32,7 @@ void BrushTool::on_mousedown(Layer* layer, MouseEvent& event)
return;
auto& layer_event = event.layer_event();
if (layer_event.button() != GUI::MouseButton::Left && layer_event.button() != GUI::MouseButton::Right)
if (layer_event.button() != GUI::MouseButton::Primary && layer_event.button() != GUI::MouseButton::Secondary)
return;
// Shift+Click draws a line from the last position to current one.
@ -60,7 +60,7 @@ void BrushTool::on_mousemove(Layer* layer, MouseEvent& event)
return;
auto& layer_event = event.layer_event();
if (!(layer_event.buttons() & GUI::MouseButton::Left || layer_event.buttons() & GUI::MouseButton::Right))
if (!(layer_event.buttons() & GUI::MouseButton::Primary || layer_event.buttons() & GUI::MouseButton::Secondary))
return;
draw_line(layer->bitmap(), color_for(layer_event), m_last_position, layer_event.position());

View file

@ -56,7 +56,7 @@ void EllipseTool::on_mousedown(Layer* layer, MouseEvent& event)
return;
auto& layer_event = event.layer_event();
if (layer_event.button() != GUI::MouseButton::Left && layer_event.button() != GUI::MouseButton::Right)
if (layer_event.button() != GUI::MouseButton::Primary && layer_event.button() != GUI::MouseButton::Secondary)
return;
if (m_drawing_button != GUI::MouseButton::None)

View file

@ -56,7 +56,7 @@ void GuideTool::on_mousedown(Layer*, MouseEvent& event)
auto& image_event = event.image_event();
if (image_event.button() != GUI::MouseButton::Left)
if (image_event.button() != GUI::MouseButton::Primary)
return;
m_editor->set_guide_visibility(true);

View file

@ -45,7 +45,7 @@ void LineTool::on_mousedown(Layer* layer, MouseEvent& event)
return;
auto& layer_event = event.layer_event();
if (layer_event.button() != GUI::MouseButton::Left && layer_event.button() != GUI::MouseButton::Right)
if (layer_event.button() != GUI::MouseButton::Primary && layer_event.button() != GUI::MouseButton::Secondary)
return;
if (m_drawing_button != GUI::MouseButton::None)

View file

@ -24,7 +24,7 @@ MoveTool::~MoveTool()
void MoveTool::on_mousedown(Layer* layer, MouseEvent& event)
{
if (event.image_event().button() == GUI::MouseButton::Right && !m_is_panning) {
if (event.image_event().button() == GUI::MouseButton::Secondary && !m_is_panning) {
m_is_panning = true;
m_event_origin = event.raw_event().position();
m_saved_pan_origin = m_editor->pan_origin();
@ -37,7 +37,7 @@ void MoveTool::on_mousedown(Layer* layer, MouseEvent& event)
auto& layer_event = event.layer_event();
auto& image_event = event.image_event();
if (layer_event.button() != GUI::MouseButton::Left)
if (layer_event.button() != GUI::MouseButton::Primary)
return;
if (!layer->rect().contains(layer_event.position()))
return;
@ -70,7 +70,7 @@ void MoveTool::on_mousemove(Layer* layer, MouseEvent& event)
void MoveTool::on_mouseup(Layer* layer, MouseEvent& event)
{
if (event.image_event().button() == GUI::MouseButton::Right && m_is_panning) {
if (event.image_event().button() == GUI::MouseButton::Secondary && m_is_panning) {
m_is_panning = false;
m_editor->set_override_cursor(cursor());
return;
@ -80,7 +80,7 @@ void MoveTool::on_mouseup(Layer* layer, MouseEvent& event)
return;
auto& layer_event = event.layer_event();
if (layer_event.button() != GUI::MouseButton::Left)
if (layer_event.button() != GUI::MouseButton::Primary)
return;
m_layer_being_moved = nullptr;
m_editor->did_complete_action();

View file

@ -38,9 +38,9 @@ void PickerTool::on_mousedown(Layer* layer, MouseEvent& event)
if (!color.alpha())
return;
if (event.layer_event().button() == GUI::MouseButton::Left)
if (event.layer_event().button() == GUI::MouseButton::Primary)
m_editor->set_primary_color(color);
else if (event.layer_event().button() == GUI::MouseButton::Right)
else if (event.layer_event().button() == GUI::MouseButton::Secondary)
m_editor->set_secondary_color(color);
}

View file

@ -29,7 +29,7 @@ RectangleSelectTool::~RectangleSelectTool()
void RectangleSelectTool::on_mousedown(Layer*, MouseEvent& event)
{
auto& image_event = event.image_event();
if (image_event.button() != GUI::MouseButton::Left)
if (image_event.button() != GUI::MouseButton::Primary)
return;
m_selecting = true;
@ -61,7 +61,7 @@ void RectangleSelectTool::on_mousemove(Layer*, MouseEvent& event)
void RectangleSelectTool::on_mouseup(Layer*, MouseEvent& event)
{
auto& image_event = event.image_event();
if (!m_selecting || image_event.button() != GUI::MouseButton::Left)
if (!m_selecting || image_event.button() != GUI::MouseButton::Primary)
return;
m_selecting = false;

View file

@ -59,7 +59,7 @@ void RectangleTool::on_mousedown(Layer* layer, MouseEvent& event)
return;
auto& layer_event = event.layer_event();
if (layer_event.button() != GUI::MouseButton::Left && layer_event.button() != GUI::MouseButton::Right)
if (layer_event.button() != GUI::MouseButton::Primary && layer_event.button() != GUI::MouseButton::Secondary)
return;
if (m_drawing_button != GUI::MouseButton::None)

View file

@ -23,10 +23,10 @@ ZoomTool::~ZoomTool()
void ZoomTool::on_mousedown(Layer*, MouseEvent& event)
{
auto& raw_event = event.raw_event();
if (raw_event.button() != GUI::MouseButton::Left && raw_event.button() != GUI::MouseButton::Right)
if (raw_event.button() != GUI::MouseButton::Primary && raw_event.button() != GUI::MouseButton::Secondary)
return;
auto scale_factor = (raw_event.button() == GUI::MouseButton::Left) ? m_sensitivity : -m_sensitivity;
auto scale_factor = (raw_event.button() == GUI::MouseButton::Primary) ? m_sensitivity : -m_sensitivity;
m_editor->scale_centered_on_position(raw_event.position(), scale_factor);
}