mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:07:45 +00:00
Browser: Consolidate StorageWidget tabs into a single gml file
This patch removes the separate CookiesTab.gml file used to define the layout of the cookies and local storage tabs and moves those defintions into the StorageWidget.gml file.
This commit is contained in:
parent
e5196c8e3d
commit
f3f19f8321
4 changed files with 36 additions and 27 deletions
|
@ -6,7 +6,6 @@ serenity_component(
|
||||||
)
|
)
|
||||||
|
|
||||||
compile_gml(BrowserWindow.gml BrowserWindowGML.h browser_window_gml)
|
compile_gml(BrowserWindow.gml BrowserWindowGML.h browser_window_gml)
|
||||||
compile_gml(CookiesTab.gml CookiesTabGML.h cookies_tab_gml)
|
|
||||||
compile_gml(EditBookmark.gml EditBookmarkGML.h edit_bookmark_gml)
|
compile_gml(EditBookmark.gml EditBookmarkGML.h edit_bookmark_gml)
|
||||||
compile_gml(StorageWidget.gml StorageWidgetGML.h storage_widget_gml)
|
compile_gml(StorageWidget.gml StorageWidgetGML.h storage_widget_gml)
|
||||||
compile_gml(Tab.gml TabGML.h tab_gml)
|
compile_gml(Tab.gml TabGML.h tab_gml)
|
||||||
|
@ -18,7 +17,6 @@ set(SOURCES
|
||||||
ConsoleWidget.cpp
|
ConsoleWidget.cpp
|
||||||
CookieJar.cpp
|
CookieJar.cpp
|
||||||
CookiesModel.cpp
|
CookiesModel.cpp
|
||||||
CookiesTabGML.h
|
|
||||||
DownloadWidget.cpp
|
DownloadWidget.cpp
|
||||||
EditBookmarkGML.h
|
EditBookmarkGML.h
|
||||||
ElementSizePreviewWidget.cpp
|
ElementSizePreviewWidget.cpp
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
@GUI::Widget {
|
|
||||||
name: "cookies_tab"
|
|
||||||
layout: @GUI::VerticalBoxLayout {
|
|
||||||
margins: [4]
|
|
||||||
}
|
|
||||||
|
|
||||||
@GUI::GroupBox {
|
|
||||||
layout: @GUI::VerticalBoxLayout {
|
|
||||||
margins: [6]
|
|
||||||
}
|
|
||||||
|
|
||||||
@GUI::TableView {
|
|
||||||
name: "cookies_tableview"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "CookiesModel.h"
|
#include "CookiesModel.h"
|
||||||
#include "LocalStorageModel.h"
|
#include "LocalStorageModel.h"
|
||||||
#include <AK/Variant.h>
|
#include <AK/Variant.h>
|
||||||
#include <Applications/Browser/CookiesTabGML.h>
|
|
||||||
#include <Applications/Browser/StorageWidgetGML.h>
|
#include <Applications/Browser/StorageWidgetGML.h>
|
||||||
#include <LibGUI/TabWidget.h>
|
#include <LibGUI/TabWidget.h>
|
||||||
#include <LibGUI/TableView.h>
|
#include <LibGUI/TableView.h>
|
||||||
|
@ -21,10 +20,7 @@ StorageWidget::StorageWidget()
|
||||||
load_from_gml(storage_widget_gml);
|
load_from_gml(storage_widget_gml);
|
||||||
auto& tab_widget = *find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
|
auto& tab_widget = *find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
|
||||||
|
|
||||||
auto cookies_tab = tab_widget.try_add_tab<GUI::Widget>("Cookies").release_value_but_fixme_should_propagate_errors();
|
m_cookies_table_view = tab_widget.find_descendant_of_type_named<GUI::TableView>("cookies_tableview");
|
||||||
cookies_tab->load_from_gml(cookies_tab_gml);
|
|
||||||
|
|
||||||
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_cookie_sorting_model = MUST(GUI::SortingProxyModel::create(*m_cookies_model));
|
m_cookie_sorting_model = MUST(GUI::SortingProxyModel::create(*m_cookies_model));
|
||||||
|
@ -34,10 +30,7 @@ StorageWidget::StorageWidget()
|
||||||
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);
|
||||||
|
|
||||||
auto local_storage_tab = tab_widget.try_add_tab<GUI::Widget>("Local Storage").release_value_but_fixme_should_propagate_errors();
|
m_local_storage_table_view = tab_widget.find_descendant_of_type_named<GUI::TableView>("local_storage_tableview");
|
||||||
local_storage_tab->load_from_gml(cookies_tab_gml);
|
|
||||||
|
|
||||||
m_local_storage_table_view = local_storage_tab->find_descendant_of_type_named<GUI::TableView>("cookies_tableview");
|
|
||||||
m_local_storage_model = adopt_ref(*new LocalStorageModel());
|
m_local_storage_model = adopt_ref(*new LocalStorageModel());
|
||||||
|
|
||||||
m_local_storage_sorting_model = MUST(GUI::SortingProxyModel::create(*m_local_storage_model));
|
m_local_storage_sorting_model = MUST(GUI::SortingProxyModel::create(*m_local_storage_model));
|
||||||
|
|
|
@ -6,5 +6,39 @@
|
||||||
|
|
||||||
@GUI::TabWidget {
|
@GUI::TabWidget {
|
||||||
name: "tab_widget"
|
name: "tab_widget"
|
||||||
|
|
||||||
|
@GUI::Widget {
|
||||||
|
title: "Cookies"
|
||||||
|
layout: @GUI::VerticalBoxLayout {
|
||||||
|
margins: [4]
|
||||||
|
}
|
||||||
|
|
||||||
|
@GUI::GroupBox {
|
||||||
|
layout: @GUI::VerticalBoxLayout {
|
||||||
|
margins: [6]
|
||||||
|
}
|
||||||
|
|
||||||
|
@GUI::TableView {
|
||||||
|
name: "cookies_tableview"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GUI::Widget {
|
||||||
|
title: "Local Storage"
|
||||||
|
layout: @GUI::VerticalBoxLayout {
|
||||||
|
margins: [4]
|
||||||
|
}
|
||||||
|
|
||||||
|
@GUI::GroupBox {
|
||||||
|
layout: @GUI::VerticalBoxLayout {
|
||||||
|
margins: [6]
|
||||||
|
}
|
||||||
|
|
||||||
|
@GUI::TableView {
|
||||||
|
name: "local_storage_tableview"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue