mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
ClipboardHistory: Show the size (in bytes) of each remembered clipping
This commit is contained in:
parent
b8d73e259c
commit
0b051a5e15
2 changed files with 7 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include "ClipboardHistoryModel.h"
|
||||
#include <AK/NumberFormat.h>
|
||||
|
||||
NonnullRefPtr<ClipboardHistoryModel> ClipboardHistoryModel::create()
|
||||
{
|
||||
|
@ -42,6 +43,8 @@ String ClipboardHistoryModel::column_name(int column) const
|
|||
return "Data";
|
||||
case Column::Type:
|
||||
return "Type";
|
||||
case Column::Size:
|
||||
return "Size";
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
@ -59,6 +62,8 @@ GUI::Variant ClipboardHistoryModel::data(const GUI::ModelIndex& index, GUI::Mode
|
|||
return "<...>";
|
||||
case Column::Type:
|
||||
return data_and_type.mime_type;
|
||||
case Column::Size:
|
||||
return AK::human_readable_size(data_and_type.data.size());
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue