1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +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

@ -501,18 +501,18 @@ void ImageEditor::layers_did_change()
Color ImageEditor::color_for(GUI::MouseButton button) const
{
if (button == GUI::MouseButton::Left)
if (button == GUI::MouseButton::Primary)
return m_primary_color;
if (button == GUI::MouseButton::Right)
if (button == GUI::MouseButton::Secondary)
return m_secondary_color;
VERIFY_NOT_REACHED();
}
Color ImageEditor::color_for(GUI::MouseEvent const& event) const
{
if (event.buttons() & GUI::MouseButton::Left)
if (event.buttons() & GUI::MouseButton::Primary)
return m_primary_color;
if (event.buttons() & GUI::MouseButton::Right)
if (event.buttons() & GUI::MouseButton::Secondary)
return m_secondary_color;
VERIFY_NOT_REACHED();
}

View file

@ -146,7 +146,7 @@ void LayerListWidget::mousedown_event(GUI::MouseEvent& event)
{
if (!m_image)
return;
if (event.button() != GUI::MouseButton::Left)
if (event.button() != GUI::MouseButton::Primary)
return;
Gfx::IntPoint translated_event_point = { 0, vertical_scrollbar().value() + event.y() };
@ -201,7 +201,7 @@ void LayerListWidget::mouseup_event(GUI::MouseEvent& event)
{
if (!m_image)
return;
if (event.button() != GUI::MouseButton::Left)
if (event.button() != GUI::MouseButton::Primary)
return;
if (!m_moving_gadget_index.has_value())
return;

View file

@ -50,9 +50,9 @@ public:
}
}
if (event.button() == GUI::MouseButton::Left)
if (event.button() == GUI::MouseButton::Primary)
m_palette_widget.set_primary_color(m_color);
else if (event.button() == GUI::MouseButton::Right)
else if (event.button() == GUI::MouseButton::Secondary)
m_palette_widget.set_secondary_color(m_color);
}
@ -69,7 +69,7 @@ public:
virtual void mousedown_event(GUI::MouseEvent& event) override
{
if (event.button() != GUI::MouseButton::Left || !on_color_change)
if (event.button() != GUI::MouseButton::Primary || !on_color_change)
return;
auto dialog = GUI::ColorPicker::construct(m_color, window());

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);
}