mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:27:45 +00:00
Taskbar: Make quicklaunch bar editable
This change adds a ConfigServer Listener to TaskbarWindow. Items in the quicklaunch bar may be added or removed by editing the Taskbar config.
This commit is contained in:
parent
06cb526feb
commit
480903fe8a
4 changed files with 83 additions and 38 deletions
|
@ -7,11 +7,15 @@
|
|||
#pragma once
|
||||
|
||||
#include "WindowList.h"
|
||||
#include <LibConfig/Listener.h>
|
||||
#include <LibDesktop/AppFile.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/ShareableBitmap.h>
|
||||
#include <WindowServer/ScreenLayout.h>
|
||||
|
||||
class TaskbarWindow final : public GUI::Window {
|
||||
class TaskbarWindow final : public GUI::Window
|
||||
, public Config::Listener {
|
||||
C_OBJECT(TaskbarWindow);
|
||||
|
||||
public:
|
||||
|
@ -20,10 +24,14 @@ public:
|
|||
static int taskbar_height() { return 27; }
|
||||
static int taskbar_icon_size() { return 16; }
|
||||
|
||||
virtual void config_key_was_removed(String const&, String const&, String const&) override;
|
||||
virtual void config_string_did_change(String const&, String const&, String const&, String const&) override;
|
||||
|
||||
private:
|
||||
explicit TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu);
|
||||
static void show_desktop_button_clicked(unsigned);
|
||||
void create_quick_launch_bar();
|
||||
void set_quick_launch_button_data(GUI::Button&, String const&, NonnullRefPtr<Desktop::AppFile>);
|
||||
void on_screen_rects_change(const Vector<Gfx::IntRect, 4>&, size_t);
|
||||
NonnullRefPtr<GUI::Button> create_button(const WindowIdentifier&);
|
||||
void add_window_button(::Window&, const WindowIdentifier&);
|
||||
|
@ -45,6 +53,7 @@ private:
|
|||
NonnullRefPtr<GUI::Menu> m_start_menu;
|
||||
RefPtr<GUI::Widget> m_task_button_container;
|
||||
RefPtr<Gfx::Bitmap> m_default_icon;
|
||||
RefPtr<GUI::Frame> m_quick_launch_bar;
|
||||
|
||||
Gfx::IntSize m_applet_area_size;
|
||||
RefPtr<GUI::Frame> m_applet_area_container;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue