mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:57:44 +00:00
FileManager: Make DirectoryView listen for configuration changes
DirectoryView now inherits from Config::Listener and will update its view mode immediately if changed from elsewhere. This is pretty neat. :^)
This commit is contained in:
parent
c8c58626e9
commit
696dbc889f
3 changed files with 18 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/URL.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibConfig/Listener.h>
|
||||
#include <LibDesktop/Launcher.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/ColumnsView.h>
|
||||
|
@ -38,7 +39,8 @@ private:
|
|||
|
||||
class DirectoryView final
|
||||
: public GUI::StackWidget
|
||||
, private GUI::ModelClient {
|
||||
, private GUI::ModelClient
|
||||
, public Config::Listener {
|
||||
C_OBJECT(DirectoryView);
|
||||
|
||||
public:
|
||||
|
@ -130,6 +132,9 @@ public:
|
|||
GUI::Action& view_as_table_action() { return *m_view_as_table_action; }
|
||||
GUI::Action& view_as_columns_action() { return *m_view_as_columns_action; }
|
||||
|
||||
// ^Config::Listener
|
||||
virtual void config_string_did_change(String const& domain, String const& group, String const& key, String const& value) override;
|
||||
|
||||
private:
|
||||
explicit DirectoryView(Mode);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue