mirror of
https://github.com/RGBCube/serenity
synced 2025-06-21 16:02:07 +00:00
ProcessManager: Start working on a graphical process manager.
I need a table view widget for this thing, so I'm also using this to prototype a model/view thingy.
This commit is contained in:
parent
dda9b9ab1b
commit
166aadc4e1
14 changed files with 467 additions and 1 deletions
37
Applications/ProcessManager/ProcessView.h
Normal file
37
Applications/ProcessManager/ProcessView.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GWidget.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
|
||||
class GScrollBar;
|
||||
class ProcessTableModel;
|
||||
|
||||
class ProcessView final : public GWidget {
|
||||
public:
|
||||
ProcessView(GWidget* parent);
|
||||
virtual ~ProcessView() override;
|
||||
|
||||
void reload();
|
||||
|
||||
Function<void(String)> on_status_message;
|
||||
|
||||
int header_height() const { return 16; }
|
||||
int item_height() const { return 16; }
|
||||
int item_count() const;
|
||||
|
||||
pid_t selected_pid() const;
|
||||
|
||||
private:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void resize_event(GResizeEvent&) override;
|
||||
virtual void mousedown_event(GMouseEvent&) override;
|
||||
virtual void timer_event(GTimerEvent&) override;
|
||||
|
||||
void set_status_message(String&&);
|
||||
Rect row_rect(int item_index) const;
|
||||
|
||||
RetainPtr<GraphicsBitmap> m_process_icon;
|
||||
GScrollBar* m_scrollbar { nullptr };
|
||||
OwnPtr<ProcessTableModel> m_model;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue