mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 14:54:57 +00:00

This option is already enabled when building Lagom, so let's enable it for the main build too. We will no longer be surprised by Lagom Clang CI builds failing while everything compiles locally. Furthermore, the stronger `-Wsuggest-override` warning is enabled in this commit, which enforces the use of the `override` keyword in all classes, not just those which already have some methods marked as `override`. This works with both GCC and Clang.
36 lines
929 B
C++
36 lines
929 B
C++
/*
|
|
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/LexicalPath.h>
|
|
#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(const LexicalPath& file)>;
|
|
|
|
class GitFilesView : public GUI::ListView {
|
|
C_OBJECT(GitFilesView)
|
|
public:
|
|
virtual ~GitFilesView() override;
|
|
|
|
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;
|
|
};
|
|
|
|
}
|