mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-25 23:06:11 +00:00
Userland: Use AK::human_readable_digital_time() instead of custom code
Use this handy AK function instead of reimplementing the formatting code several times. The one minor difference is that now, hours are only shown if the duration is at least an hour long, but that seems like an improvement to me. :^)
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "SampleWidget.h"
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/NumberFormat.h>
|
||||
#include <AK/SIMD.h>
|
||||
#include <LibConfig/Client.h>
|
||||
#include <LibGUI/Action.h>
|
||||
@@ -243,7 +244,7 @@ void SoundPlayerWidgetAdvancedView::shuffle_mode_changed(Player::ShuffleMode)
|
||||
|
||||
void SoundPlayerWidgetAdvancedView::time_elapsed(int seconds)
|
||||
{
|
||||
m_timestamp_label->set_text(String::formatted("Elapsed: {:02}:{:02}:{:02}", seconds / 3600, seconds / 60, seconds % 60).release_value_but_fixme_should_propagate_errors());
|
||||
m_timestamp_label->set_text(String::formatted("Elapsed: {}", human_readable_digital_time(seconds)).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
|
||||
void SoundPlayerWidgetAdvancedView::file_name_changed(StringView name)
|
||||
|
||||
Reference in New Issue
Block a user