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
Notes:
sideshowbarker
2024-07-17 18:13:59 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/a5d11c0a26 Pull-request: https://github.com/SerenityOS/serenity/pull/23096
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_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_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 = *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) {
|
||||
if (!index.is_valid())
|
||||
return;
|
||||
|
|
|
@ -20,24 +20,32 @@
|
|||
name: "editor"
|
||||
}
|
||||
|
||||
@GUI::VerticalSplitter {
|
||||
@GUI::DynamicWidgetContainer {
|
||||
name: "side_panel_container"
|
||||
visible: false
|
||||
section_label: "Panels"
|
||||
config_domain: "HexEditor"
|
||||
preferred_height: "grow"
|
||||
show_controls: false
|
||||
|
||||
@GUI::Widget {
|
||||
@GUI::DynamicWidgetContainer {
|
||||
name: "search_results_container"
|
||||
section_label: "Search Results"
|
||||
config_domain: "HexEditor"
|
||||
preferred_height: "grow"
|
||||
visible: false
|
||||
layout: @GUI::VerticalBoxLayout {}
|
||||
|
||||
@GUI::TableView {
|
||||
name: "search_results"
|
||||
}
|
||||
}
|
||||
|
||||
@GUI::Widget {
|
||||
@GUI::DynamicWidgetContainer {
|
||||
name: "value_inspector_container"
|
||||
section_label: "Value Inspector"
|
||||
config_domain: "HexEditor"
|
||||
preferred_height: "grow"
|
||||
visible: false
|
||||
layout: @GUI::VerticalBoxLayout {}
|
||||
|
||||
@GUI::TableView {
|
||||
name: "value_inspector"
|
||||
|
@ -45,10 +53,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
@GUI::Widget {
|
||||
@GUI::DynamicWidgetContainer {
|
||||
name: "annotations_container"
|
||||
section_label: "Annotations"
|
||||
config_domain: "HexEditor"
|
||||
preferred_height: "grow"
|
||||
visible: false
|
||||
layout: @GUI::VerticalBoxLayout {}
|
||||
|
||||
@GUI::TableView {
|
||||
name: "annotations"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <AK/LexicalPath.h>
|
||||
#include <LibGUI/ActionGroup.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/DynamicWidgetContainer.h>
|
||||
#include <LibGUI/TextEditor.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
@ -93,7 +94,7 @@ private:
|
|||
RefPtr<GUI::ToolbarContainer> m_toolbar_container;
|
||||
RefPtr<GUI::TableView> m_search_results;
|
||||
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::TableView> m_value_inspector;
|
||||
RefPtr<GUI::Widget> m_annotations_container;
|
||||
|
|
Loading…
Add table
Reference in a new issue