mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
Help: Convert to GML and propagate more errors
Converts Help's layout to GML, propagates model and icon creation errors, and switches to the MainWidget-namespace organization pattern seen in more up-to-date apps like TextEditor to make things easier to maintain going forward.
This commit is contained in:
parent
6879465725
commit
8825abe7ed
6 changed files with 439 additions and 320 deletions
52
Userland/Applications/Help/MainWidget.h
Normal file
52
Userland/Applications/Help/MainWidget.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "History.h"
|
||||
#include "ManualModel.h"
|
||||
#include <LibWeb/OutOfProcessWebView.h>
|
||||
|
||||
namespace Help {
|
||||
|
||||
class MainWidget final : public GUI::Widget {
|
||||
C_OBJECT(MainWidget);
|
||||
|
||||
public:
|
||||
virtual ~MainWidget() override = default;
|
||||
|
||||
ErrorOr<void> initialize_fallibles(GUI::Window&);
|
||||
void set_start_page(String const& page, int section);
|
||||
|
||||
private:
|
||||
MainWidget();
|
||||
|
||||
void open_url(URL const&);
|
||||
void open_page(String const& path);
|
||||
void open_external(URL const&);
|
||||
|
||||
History m_history;
|
||||
RefPtr<GUI::Menu> m_context_menu;
|
||||
RefPtr<ManualModel> m_manual_model;
|
||||
|
||||
RefPtr<GUI::Action> m_go_back_action;
|
||||
RefPtr<GUI::Action> m_go_forward_action;
|
||||
RefPtr<GUI::Action> m_go_home_action;
|
||||
RefPtr<GUI::Action> m_copy_action;
|
||||
RefPtr<GUI::Action> m_select_all_action;
|
||||
|
||||
RefPtr<GUI::TabWidget> m_tab_widget;
|
||||
RefPtr<GUI::Widget> m_search_container;
|
||||
RefPtr<GUI::TextBox> m_search_box;
|
||||
RefPtr<GUI::ListView> m_search_view;
|
||||
RefPtr<GUI::TreeView> m_browse_view;
|
||||
RefPtr<Web::OutOfProcessWebView> m_web_view;
|
||||
|
||||
RefPtr<GUI::Toolbar> m_toolbar;
|
||||
RefPtr<GUI::Statusbar> m_statusbar;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue