mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:42:44 +00:00 
			
		
		
		
	 4384a236b0
			
		
	
	
		4384a236b0
		
	
	
	
	
		
			
			Instead of using the doubleclick_event this uses the current double- click speed setting to check whether or not the colors of the double- click icon should be inverted. This allows us to use the current (and unsaved) setting for comparison instead of having to apply the settings first.
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			786 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			786 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 | |
|  * Copyright (c) 2021, Mathias Jakobsen <mathias@jbcoding.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibCore/ElapsedTimer.h>
 | |
| #include <LibGUI/Widget.h>
 | |
| 
 | |
| namespace MouseSettings {
 | |
| 
 | |
| class DoubleClickArrowWidget final : public GUI::Widget {
 | |
|     C_OBJECT(DoubleClickArrowWidget);
 | |
| 
 | |
| public:
 | |
|     virtual ~DoubleClickArrowWidget() override;
 | |
|     void set_double_click_speed(int);
 | |
| 
 | |
| private:
 | |
|     DoubleClickArrowWidget();
 | |
|     virtual void paint_event(GUI::PaintEvent&) override;
 | |
|     virtual void mousedown_event(GUI::MouseEvent&) override;
 | |
| 
 | |
|     RefPtr<Gfx::Bitmap> m_arrow_bitmap;
 | |
|     int m_double_click_speed { 0 };
 | |
|     bool m_inverted { false };
 | |
|     Core::ElapsedTimer m_double_click_timer;
 | |
| };
 | |
| 
 | |
| }
 |