mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
ClipboardHistory: Add Time column
Add a Time column to ClipboardHistory that shows the time when each item in the list was copied.
This commit is contained in:
parent
9d94c85b6a
commit
eebdd86fbd
3 changed files with 20 additions and 7 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <AK/Vector.h>
|
||||
#include <LibConfig/Listener.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibGUI/Model.h>
|
||||
|
||||
|
@ -23,12 +24,18 @@ public:
|
|||
Data,
|
||||
Type,
|
||||
Size,
|
||||
Time,
|
||||
__Count
|
||||
};
|
||||
|
||||
struct ClipboardItem {
|
||||
GUI::Clipboard::DataAndType data_and_type;
|
||||
Core::DateTime time;
|
||||
};
|
||||
|
||||
virtual ~ClipboardHistoryModel() override = default;
|
||||
|
||||
const GUI::Clipboard::DataAndType& item_at(int index) const { return m_history_items[index]; }
|
||||
const ClipboardItem& item_at(int index) const { return m_history_items[index]; }
|
||||
void remove_item(int index);
|
||||
|
||||
// ^GUI::Model
|
||||
|
@ -49,6 +56,6 @@ private:
|
|||
// ^GUI::Clipboard::ClipboardClient
|
||||
virtual void clipboard_content_did_change(const String&) override { add_item(GUI::Clipboard::the().fetch_data_and_type()); }
|
||||
|
||||
Vector<GUI::Clipboard::DataAndType> m_history_items;
|
||||
Vector<ClipboardItem> m_history_items;
|
||||
size_t m_history_limit;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue