mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 18:35:06 +00:00
Taskbar: Start working on a taskbar app.
I originally thought I would do this inside WindowServer, but let's try to make it as a standalone app that communicates with WindowServer instead. That will allow us to use LibGUI. :^)
This commit is contained in:
parent
318db1e48e
commit
a22774ee3f
31 changed files with 577 additions and 18 deletions
29
Applications/Taskbar/TaskbarWindow.cpp
Normal file
29
Applications/Taskbar/TaskbarWindow.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "TaskbarWindow.h"
|
||||
#include "TaskbarWidget.h"
|
||||
#include <LibGUI/GWindow.h>
|
||||
#include <LibGUI/GDesktop.h>
|
||||
#include <stdio.h>
|
||||
|
||||
TaskbarWindow::TaskbarWindow()
|
||||
{
|
||||
set_window_type(GWindowType::Taskbar);
|
||||
set_title("Taskbar");
|
||||
set_should_exit_event_loop_on_close(true);
|
||||
|
||||
on_screen_rect_change(GDesktop::the().rect());
|
||||
|
||||
GDesktop::the().on_rect_change = [this] (const Rect& rect) { on_screen_rect_change(rect); };
|
||||
|
||||
auto* widget = new TaskbarWidget;
|
||||
set_main_widget(widget);
|
||||
}
|
||||
|
||||
TaskbarWindow::~TaskbarWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void TaskbarWindow::on_screen_rect_change(const Rect& rect)
|
||||
{
|
||||
Rect new_rect { rect.x(), rect.bottom() - taskbar_height() + 1, rect.width(), taskbar_height() };
|
||||
set_rect(new_rect);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue