mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-26 19:28:59 +00:00
MouseDemo: Show distinct colors for primary vs secondary button
This shows mouse down of primary button in blue color, and secondary button in light blue color.
This commit is contained in:
parent
903bfc3d68
commit
2c142e4c57
Notes:
sideshowbarker
2024-07-17 03:51:28 +09:00
Author: https://github.com/andreao
Commit: 2c142e4c57
Pull-request: https://github.com/SerenityOS/serenity/pull/16219
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/martinfalisse
1 changed files with 6 additions and 4 deletions
|
@ -79,13 +79,15 @@ public:
|
|||
auto secondary_pressed = m_buttons & GUI::MouseButton::Secondary;
|
||||
|
||||
if (primary_secondary_switched ? secondary_pressed : primary_pressed) {
|
||||
painter.fill_rect({ 31, 21, 34, 44 }, Color::Blue);
|
||||
painter.draw_triangle({ 30, 21 }, { 65, 21 }, { 65, 12 }, Color::Blue);
|
||||
auto button_color = primary_secondary_switched ? Color::LightBlue : Color::MidBlue;
|
||||
painter.fill_rect({ 31, 21, 34, 44 }, button_color);
|
||||
painter.draw_triangle({ 30, 21 }, { 65, 21 }, { 65, 12 }, button_color);
|
||||
}
|
||||
|
||||
if (primary_secondary_switched ? primary_pressed : secondary_pressed) {
|
||||
painter.fill_rect({ 96, 21, 34, 44 }, Color::Blue);
|
||||
painter.draw_triangle({ 96, 12 }, { 96, 21 }, { 132, 21 }, Color::Blue);
|
||||
auto button_color = primary_secondary_switched ? Color::MidBlue : Color::LightBlue;
|
||||
painter.fill_rect({ 96, 21, 34, 44 }, button_color);
|
||||
painter.draw_triangle({ 96, 12 }, { 96, 21 }, { 132, 21 }, button_color);
|
||||
}
|
||||
|
||||
if (m_buttons & GUI::MouseButton::Middle)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue