mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:32:43 +00:00 
			
		
		
		
	 7070713ec8
			
		
	
	
		7070713ec8
		
	
	
	
	
		
			
			https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
		
			
				
	
	
		
			36 lines
		
	
	
	
		
			956 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			956 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
 | |
|  * Copyright (c) 2022, the SerenityOS developers.
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibGUI/ListView.h>
 | |
| #include <LibGfx/Bitmap.h>
 | |
| 
 | |
| namespace HackStudio {
 | |
| 
 | |
| // A "GitFileAction" is either the staging or the unstaging of a file.
 | |
| using GitFileActionCallback = Function<void(String const& file)>;
 | |
| 
 | |
| class GitFilesView : public GUI::ListView {
 | |
|     C_OBJECT(GitFilesView)
 | |
| public:
 | |
|     virtual ~GitFilesView() override = default;
 | |
| 
 | |
| protected:
 | |
|     GitFilesView(GitFileActionCallback, NonnullRefPtr<Gfx::Bitmap> action_icon);
 | |
| 
 | |
| private:
 | |
|     virtual void paint_list_item(GUI::Painter& painter, int row_index, int painted_item_index) override;
 | |
| 
 | |
|     virtual void mousedown_event(GUI::MouseEvent&) override;
 | |
|     virtual Gfx::IntRect action_icon_rect(size_t painted_item_index);
 | |
| 
 | |
|     GitFileActionCallback m_action_callback;
 | |
|     NonnullRefPtr<Gfx::Bitmap> m_action_icon;
 | |
| };
 | |
| 
 | |
| }
 |