mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibGUI: Show hours and minutes in "unsaved changes" dialogs
This commit is contained in:
parent
0012c03eb5
commit
3132ce1d36
Notes:
sideshowbarker
2024-07-17 21:16:33 +09:00
Author: https://github.com/Sauler
Commit: 3132ce1d36
Pull-request: https://github.com/SerenityOS/serenity/pull/11627
Reviewed-by: https://github.com/trflynn89
1 changed files with 3 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/NumberFormat.h>
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/Button.h>
|
||||
#include <LibGUI/ImageWidget.h>
|
||||
|
@ -39,7 +40,8 @@ int MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path
|
|||
|
||||
if (!path.is_empty() && last_unmodified_timestamp.has_value()) {
|
||||
auto age = (Time::now_monotonic() - *last_unmodified_timestamp).to_seconds();
|
||||
builder.appendff("\nLast saved {} second{} ago.", age, age == 1 ? "" : "s");
|
||||
auto readable_time = human_readable_time(age);
|
||||
builder.appendff("\nLast saved {} ago.", readable_time);
|
||||
}
|
||||
|
||||
auto box = MessageBox::construct(parent_window, builder.string_view(), "Unsaved changes", Type::Warning, InputType::YesNoCancel);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue