summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-03-25 23:32:00 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-25 23:32:00 +0100
commitbaae3f706a1d50b7b128e95e1a9c37ecf03f3a80 (patch)
tree799b9da9c532d60fb50083f51e7d9b1db0f898fd /Userland
parente9db10e3a96eae955ebb84751fd6d468de9c3078 (diff)
downloadserenity-baae3f706a1d50b7b128e95e1a9c37ecf03f3a80.zip
Taskbar: Only show H:M:S by default, move date to tooltip
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Services/Taskbar/ClockWidget.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Services/Taskbar/ClockWidget.cpp b/Userland/Services/Taskbar/ClockWidget.cpp
index f9b1de5987..c8968eef07 100644
--- a/Userland/Services/Taskbar/ClockWidget.cpp
+++ b/Userland/Services/Taskbar/ClockWidget.cpp
@@ -40,9 +40,9 @@ ClockWidget::ClockWidget()
set_frame_shadow(Gfx::FrameShadow::Sunken);
set_frame_thickness(1);
- m_time_width = font().width("2222-22-22 22:22:22");
+ m_time_width = font().width("22:22:22");
- set_fixed_size(m_time_width + 8, 22);
+ set_fixed_size(m_time_width + 20, 22);
m_timer = add<Core::Timer>(1000, [this] {
static time_t last_update_time;
@@ -50,6 +50,7 @@ ClockWidget::ClockWidget()
if (now != last_update_time) {
tick_clock();
last_update_time = now;
+ set_tooltip(Core::DateTime::now().to_string("%Y-%m-%d"));
}
});
@@ -204,7 +205,7 @@ ClockWidget::~ClockWidget()
void ClockWidget::paint_event(GUI::PaintEvent& event)
{
GUI::Frame::paint_event(event);
- auto time_text = Core::DateTime::now().to_string();
+ auto time_text = Core::DateTime::now().to_string("%T");
GUI::Painter painter(*this);
painter.add_clip_rect(frame_inner_rect());
painter.draw_text(event.rect(), time_text, Gfx::FontDatabase::default_font(), Gfx::TextAlignment::Center, palette().window_text());