summaryrefslogtreecommitdiff
path: root/Applications/Taskbar
diff options
context:
space:
mode:
authorTibor Nagy <xnagytibor@gmail.com>2020-03-30 08:58:28 +0200
committerAndreas Kling <kling@serenityos.org>2020-03-30 10:52:09 +0200
commit7a61ed4178ba99b1b0f452cfd924a309dbe20d02 (patch)
tree357fc529a931b5029175b3a3c4f3142541be9f38 /Applications/Taskbar
parent8c5fa05c39c65b685e885b5c850ddd8e1d4bd442 (diff)
downloadserenity-7a61ed4178ba99b1b0f452cfd924a309dbe20d02.zip
Taskbar: Show default window icons when no icons are set
To be consistent with WindowServer.
Diffstat (limited to 'Applications/Taskbar')
-rw-r--r--Applications/Taskbar/TaskbarWindow.cpp3
-rw-r--r--Applications/Taskbar/TaskbarWindow.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/Applications/Taskbar/TaskbarWindow.cpp b/Applications/Taskbar/TaskbarWindow.cpp
index e4b39d4b0b..ea7db5a4bc 100644
--- a/Applications/Taskbar/TaskbarWindow.cpp
+++ b/Applications/Taskbar/TaskbarWindow.cpp
@@ -56,6 +56,8 @@ TaskbarWindow::TaskbarWindow()
widget.set_frame_shape(Gfx::FrameShape::Panel);
widget.set_frame_shadow(Gfx::FrameShadow::Raised);
+ m_default_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png");
+
WindowList::the().aid_create_button = [this](auto& identifier) {
return create_button(identifier);
};
@@ -137,6 +139,7 @@ NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(const WindowIdentifier&
button.set_preferred_size(140, 22);
button.set_checkable(true);
button.set_text_alignment(Gfx::TextAlignment::CenterLeft);
+ button.set_icon(*m_default_icon);
return button;
}
diff --git a/Applications/Taskbar/TaskbarWindow.h b/Applications/Taskbar/TaskbarWindow.h
index 8b31eeac05..5825012439 100644
--- a/Applications/Taskbar/TaskbarWindow.h
+++ b/Applications/Taskbar/TaskbarWindow.h
@@ -42,4 +42,6 @@ private:
NonnullRefPtr<GUI::Button> create_button(const WindowIdentifier&);
virtual void wm_event(GUI::WMEvent&) override;
+
+ RefPtr<Gfx::Bitmap> m_default_icon;
};