mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
Browser: Make storage inspector columns sortable
This commit is contained in:
parent
62fbf282b1
commit
02e2f11380
2 changed files with 6 additions and 1 deletions
|
@ -26,7 +26,10 @@ StorageWidget::StorageWidget()
|
||||||
m_cookies_table_view = cookies_tab->find_descendant_of_type_named<GUI::TableView>("cookies_tableview");
|
m_cookies_table_view = cookies_tab->find_descendant_of_type_named<GUI::TableView>("cookies_tableview");
|
||||||
m_cookies_model = adopt_ref(*new CookiesModel());
|
m_cookies_model = adopt_ref(*new CookiesModel());
|
||||||
|
|
||||||
m_cookies_table_view->set_model(*m_cookies_model);
|
m_sorting_model = MUST(GUI::SortingProxyModel::create(*m_cookies_model));
|
||||||
|
m_sorting_model->set_sort_role(GUI::ModelRole::Display);
|
||||||
|
|
||||||
|
m_cookies_table_view->set_model(m_sorting_model);
|
||||||
m_cookies_table_view->set_column_headers_visible(true);
|
m_cookies_table_view->set_column_headers_visible(true);
|
||||||
m_cookies_table_view->set_alternating_row_colors(true);
|
m_cookies_table_view->set_alternating_row_colors(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "CookiesModel.h"
|
#include "CookiesModel.h"
|
||||||
#include "Tab.h"
|
#include "Tab.h"
|
||||||
|
#include <LibGUI/SortingProxyModel.h>
|
||||||
#include <LibGUI/Widget.h>
|
#include <LibGUI/Widget.h>
|
||||||
#include <LibWeb/Cookie/Cookie.h>
|
#include <LibWeb/Cookie/Cookie.h>
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ private:
|
||||||
|
|
||||||
RefPtr<GUI::TableView> m_cookies_table_view;
|
RefPtr<GUI::TableView> m_cookies_table_view;
|
||||||
RefPtr<CookiesModel> m_cookies_model;
|
RefPtr<CookiesModel> m_cookies_model;
|
||||||
|
RefPtr<GUI::SortingProxyModel> m_sorting_model;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue