mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:47:35 +00:00
HexEditor: Convert panels to DynamicWidgetContainer
This lets the user swap them around and pop them out as separate windows as desired. We do lose the ability to individually resize them though, until DynamicWidgetContainer supports that.
This commit is contained in:
parent
6850ef9014
commit
a5d11c0a26
3 changed files with 23 additions and 9 deletions
|
@ -56,10 +56,13 @@ ErrorOr<void> HexEditorWidget::setup()
|
||||||
m_annotations_container = *find_descendant_of_type_named<GUI::Widget>("annotations_container");
|
m_annotations_container = *find_descendant_of_type_named<GUI::Widget>("annotations_container");
|
||||||
m_search_results = *find_descendant_of_type_named<GUI::TableView>("search_results");
|
m_search_results = *find_descendant_of_type_named<GUI::TableView>("search_results");
|
||||||
m_search_results_container = *find_descendant_of_type_named<GUI::Widget>("search_results_container");
|
m_search_results_container = *find_descendant_of_type_named<GUI::Widget>("search_results_container");
|
||||||
m_side_panel_container = *find_descendant_of_type_named<GUI::Widget>("side_panel_container");
|
m_side_panel_container = *find_descendant_of_type_named<GUI::DynamicWidgetContainer>("side_panel_container");
|
||||||
m_value_inspector_container = *find_descendant_of_type_named<GUI::Widget>("value_inspector_container");
|
m_value_inspector_container = *find_descendant_of_type_named<GUI::Widget>("value_inspector_container");
|
||||||
m_value_inspector = *find_descendant_of_type_named<GUI::TableView>("value_inspector");
|
m_value_inspector = *find_descendant_of_type_named<GUI::TableView>("value_inspector");
|
||||||
|
|
||||||
|
// FIXME: Set this in GML once the compiler supports it.
|
||||||
|
m_side_panel_container->set_container_with_individual_order(true);
|
||||||
|
|
||||||
m_value_inspector->on_activation = [this](GUI::ModelIndex const& index) {
|
m_value_inspector->on_activation = [this](GUI::ModelIndex const& index) {
|
||||||
if (!index.is_valid())
|
if (!index.is_valid())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -20,24 +20,32 @@
|
||||||
name: "editor"
|
name: "editor"
|
||||||
}
|
}
|
||||||
|
|
||||||
@GUI::VerticalSplitter {
|
@GUI::DynamicWidgetContainer {
|
||||||
name: "side_panel_container"
|
name: "side_panel_container"
|
||||||
visible: false
|
visible: false
|
||||||
|
section_label: "Panels"
|
||||||
|
config_domain: "HexEditor"
|
||||||
|
preferred_height: "grow"
|
||||||
|
show_controls: false
|
||||||
|
|
||||||
@GUI::Widget {
|
@GUI::DynamicWidgetContainer {
|
||||||
name: "search_results_container"
|
name: "search_results_container"
|
||||||
|
section_label: "Search Results"
|
||||||
|
config_domain: "HexEditor"
|
||||||
|
preferred_height: "grow"
|
||||||
visible: false
|
visible: false
|
||||||
layout: @GUI::VerticalBoxLayout {}
|
|
||||||
|
|
||||||
@GUI::TableView {
|
@GUI::TableView {
|
||||||
name: "search_results"
|
name: "search_results"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GUI::Widget {
|
@GUI::DynamicWidgetContainer {
|
||||||
name: "value_inspector_container"
|
name: "value_inspector_container"
|
||||||
|
section_label: "Value Inspector"
|
||||||
|
config_domain: "HexEditor"
|
||||||
|
preferred_height: "grow"
|
||||||
visible: false
|
visible: false
|
||||||
layout: @GUI::VerticalBoxLayout {}
|
|
||||||
|
|
||||||
@GUI::TableView {
|
@GUI::TableView {
|
||||||
name: "value_inspector"
|
name: "value_inspector"
|
||||||
|
@ -45,10 +53,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GUI::Widget {
|
@GUI::DynamicWidgetContainer {
|
||||||
name: "annotations_container"
|
name: "annotations_container"
|
||||||
|
section_label: "Annotations"
|
||||||
|
config_domain: "HexEditor"
|
||||||
|
preferred_height: "grow"
|
||||||
visible: false
|
visible: false
|
||||||
layout: @GUI::VerticalBoxLayout {}
|
|
||||||
|
|
||||||
@GUI::TableView {
|
@GUI::TableView {
|
||||||
name: "annotations"
|
name: "annotations"
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include <AK/LexicalPath.h>
|
#include <AK/LexicalPath.h>
|
||||||
#include <LibGUI/ActionGroup.h>
|
#include <LibGUI/ActionGroup.h>
|
||||||
#include <LibGUI/Application.h>
|
#include <LibGUI/Application.h>
|
||||||
|
#include <LibGUI/DynamicWidgetContainer.h>
|
||||||
#include <LibGUI/TextEditor.h>
|
#include <LibGUI/TextEditor.h>
|
||||||
#include <LibGUI/Widget.h>
|
#include <LibGUI/Widget.h>
|
||||||
#include <LibGUI/Window.h>
|
#include <LibGUI/Window.h>
|
||||||
|
@ -93,7 +94,7 @@ private:
|
||||||
RefPtr<GUI::ToolbarContainer> m_toolbar_container;
|
RefPtr<GUI::ToolbarContainer> m_toolbar_container;
|
||||||
RefPtr<GUI::TableView> m_search_results;
|
RefPtr<GUI::TableView> m_search_results;
|
||||||
RefPtr<GUI::Widget> m_search_results_container;
|
RefPtr<GUI::Widget> m_search_results_container;
|
||||||
RefPtr<GUI::Widget> m_side_panel_container;
|
RefPtr<GUI::DynamicWidgetContainer> m_side_panel_container;
|
||||||
RefPtr<GUI::Widget> m_value_inspector_container;
|
RefPtr<GUI::Widget> m_value_inspector_container;
|
||||||
RefPtr<GUI::TableView> m_value_inspector;
|
RefPtr<GUI::TableView> m_value_inspector;
|
||||||
RefPtr<GUI::Widget> m_annotations_container;
|
RefPtr<GUI::Widget> m_annotations_container;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue