1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

LibGUI: Start adding an automatic widget layout system.

My needs are really quite simple, so I'm just going to add what I need
as I go along. The first thing I needed was a simple box layout with
widgets being able to say whether they prefer fixed or fill for both
their vertical and horizontal sizes.

I also made a simple GStatusBar so FileManager can show how many bytes
worth of files are in the current directory.
This commit is contained in:
Andreas Kling 2019-02-10 11:07:13 +01:00
parent 2cf1dd5b6f
commit 2def3d8d3f
22 changed files with 411 additions and 29 deletions

View file

@ -15,6 +15,7 @@ public:
void reload();
Function<void(const String&)> on_path_change;
Function<void(String)> on_status_message;
int item_height() const { return 16; }
int item_count() const { return m_directories.size() + m_files.size(); }
@ -24,6 +25,8 @@ private:
virtual void resize_event(GResizeEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
void set_status_message(String&&);
Rect row_rect(int item_index) const;
struct Entry {