mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:27:35 +00:00
Everywhere: Rename left/right-click to primary/secondary
This resolves #10641.
This commit is contained in:
parent
a6ccf6659a
commit
d6a0726302
79 changed files with 183 additions and 183 deletions
|
@ -176,7 +176,7 @@ void ChessWidget::mousedown_event(GUI::MouseEvent& event)
|
|||
if (!frame_inner_rect().contains(event.position()))
|
||||
return;
|
||||
|
||||
if (event.button() == GUI::MouseButton::Right) {
|
||||
if (event.button() == GUI::MouseButton::Secondary) {
|
||||
if (m_dragging_piece) {
|
||||
m_dragging_piece = false;
|
||||
set_override_cursor(Gfx::StandardCursor::None);
|
||||
|
@ -212,7 +212,7 @@ void ChessWidget::mouseup_event(GUI::MouseEvent& event)
|
|||
if (!frame_inner_rect().contains(event.position()))
|
||||
return;
|
||||
|
||||
if (event.button() == GUI::MouseButton::Right) {
|
||||
if (event.button() == GUI::MouseButton::Secondary) {
|
||||
m_current_marking.secondary_color = event.shift();
|
||||
m_current_marking.alternate_color = event.ctrl();
|
||||
m_current_marking.to = mouse_to_square(event);
|
||||
|
|
|
@ -168,7 +168,7 @@ void BoardWidget::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
void BoardWidget::mousedown_event(GUI::MouseEvent& event)
|
||||
{
|
||||
if (event.button() == GUI::MouseButton::Left) {
|
||||
if (event.button() == GUI::MouseButton::Primary) {
|
||||
set_toggling_cells(true);
|
||||
auto row_and_column = get_row_and_column_for_point(event.x(), event.y());
|
||||
if (!row_and_column.has_value())
|
||||
|
|
|
@ -728,7 +728,7 @@ void Game::mouseup_event(GUI::MouseEvent& event)
|
|||
{
|
||||
GUI::Frame::mouseup_event(event);
|
||||
|
||||
if (event.button() != GUI::MouseButton::Left)
|
||||
if (event.button() != GUI::MouseButton::Primary)
|
||||
return;
|
||||
|
||||
if (!m_human_can_play)
|
||||
|
|
|
@ -19,14 +19,14 @@ class SquareButton final : public GUI::Button {
|
|||
C_OBJECT(SquareButton);
|
||||
|
||||
public:
|
||||
Function<void()> on_right_click;
|
||||
Function<void()> on_secondary_click;
|
||||
Function<void()> on_middle_click;
|
||||
|
||||
virtual void mousedown_event(GUI::MouseEvent& event) override
|
||||
{
|
||||
if (event.button() == GUI::MouseButton::Right) {
|
||||
if (on_right_click)
|
||||
on_right_click();
|
||||
if (event.button() == GUI::MouseButton::Secondary) {
|
||||
if (on_secondary_click)
|
||||
on_secondary_click();
|
||||
}
|
||||
if (event.button() == GUI::MouseButton::Middle) {
|
||||
if (on_middle_click)
|
||||
|
@ -50,8 +50,8 @@ public:
|
|||
|
||||
virtual void mousedown_event(GUI::MouseEvent& event) override
|
||||
{
|
||||
if (event.button() == GUI::MouseButton::Right || event.button() == GUI::MouseButton::Left) {
|
||||
if (event.buttons() == (GUI::MouseButton::Right | GUI::MouseButton::Left) || m_square.field->is_single_chording()) {
|
||||
if (event.button() == GUI::MouseButton::Secondary || event.button() == GUI::MouseButton::Primary) {
|
||||
if (event.buttons() == (GUI::MouseButton::Secondary | GUI::MouseButton::Primary) || m_square.field->is_single_chording()) {
|
||||
m_chord = true;
|
||||
m_square.field->set_chord_preview(m_square, true);
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
virtual void mouseup_event(GUI::MouseEvent& event) override
|
||||
{
|
||||
if (m_chord) {
|
||||
if (event.button() == GUI::MouseButton::Left || event.button() == GUI::MouseButton::Right) {
|
||||
if (event.button() == GUI::MouseButton::Primary || event.button() == GUI::MouseButton::Secondary) {
|
||||
if (rect().contains(event.position())) {
|
||||
if (on_chord_click)
|
||||
on_chord_click();
|
||||
|
@ -248,8 +248,8 @@ void Field::reset()
|
|||
square.button->on_click = [this, &square](auto) {
|
||||
on_square_clicked(square);
|
||||
};
|
||||
square.button->on_right_click = [this, &square] {
|
||||
on_square_right_clicked(square);
|
||||
square.button->on_secondary_click = [this, &square] {
|
||||
on_square_secondary_clicked(square);
|
||||
};
|
||||
square.button->on_middle_click = [this, &square] {
|
||||
on_square_middle_clicked(square);
|
||||
|
@ -385,7 +385,7 @@ void Field::on_square_chorded(Square& square)
|
|||
});
|
||||
}
|
||||
|
||||
void Field::on_square_right_clicked(Square& square)
|
||||
void Field::on_square_secondary_clicked(Square& square)
|
||||
{
|
||||
if (square.is_swept)
|
||||
return;
|
||||
|
|
|
@ -61,7 +61,7 @@ private:
|
|||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
|
||||
void on_square_clicked(Square&);
|
||||
void on_square_right_clicked(Square&);
|
||||
void on_square_secondary_clicked(Square&);
|
||||
void on_square_middle_clicked(Square&);
|
||||
void on_square_chorded(Square&);
|
||||
void game_over();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue