mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 02:26:10 +00:00
LibGUI: Add ModelClient abstract class and allow registering clients
This solves a problem where the SortingProxyModel doesn't receive the on_update call because other code overwrote the handler later on.
This commit is contained in:
parent
0e10a92ebc
commit
b778804d20
Notes:
sideshowbarker
2024-07-19 04:51:04 +09:00
Author: https://github.com/tomuta
Commit: b778804d20
Pull-request: https://github.com/SerenityOS/serenity/pull/2761
Reviewed-by: https://github.com/Dexesttp
13 changed files with 144 additions and 60 deletions
|
@ -27,11 +27,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/Forward.h>
|
||||
#include <LibGUI/Model.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
class BookmarksBarWidget final : public GUI::Widget {
|
||||
class BookmarksBarWidget final : public GUI::Widget
|
||||
, private GUI::ModelClient {
|
||||
C_OBJECT(BookmarksBarWidget)
|
||||
public:
|
||||
static BookmarksBarWidget& the();
|
||||
|
@ -52,7 +54,7 @@ public:
|
|||
private:
|
||||
BookmarksBarWidget(const String&, bool enabled);
|
||||
|
||||
virtual void did_update_model();
|
||||
virtual void on_model_update(unsigned) override;
|
||||
virtual void resize_event(GUI::ResizeEvent&) override;
|
||||
|
||||
void update_content_size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue