mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:57:34 +00:00
GMLPlayground: Extract most logic into a MainWidget class
This commit is contained in:
parent
3c13faff57
commit
8c00e57f56
4 changed files with 361 additions and 279 deletions
46
Userland/DevTools/GMLPlayground/MainWidget.h
Normal file
46
Userland/DevTools/GMLPlayground/MainWidget.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Julius Heijmen <julius.heijmen@gmail.com>
|
||||
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
||||
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2023, Karol Kosek <krkk@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibFileSystemAccessClient/Client.h>
|
||||
#include <LibGUI/ActionGroup.h>
|
||||
#include <LibGUI/Icon.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
||||
class MainWidget final : public GUI::Widget {
|
||||
C_OBJECT_ABSTRACT(MainWidget)
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<MainWidget>> try_create(GUI::Icon const&);
|
||||
ErrorOr<void> initialize_menubar(GUI::Window&);
|
||||
GUI::Window::CloseRequestDecision request_close();
|
||||
|
||||
void load_file(FileSystemAccessClient::File);
|
||||
void update_title();
|
||||
|
||||
GUI::TextEditor& editor() const { return *m_editor; }
|
||||
|
||||
private:
|
||||
RefPtr<GUI::Action> m_save_action;
|
||||
RefPtr<GUI::TextEditor> m_editor;
|
||||
RefPtr<GUI::Toolbar> m_toolbar;
|
||||
RefPtr<GUI::Splitter> m_splitter;
|
||||
|
||||
RefPtr<GUI::Frame> m_preview_frame_widget;
|
||||
RefPtr<GUI::Window> m_preview_window;
|
||||
RefPtr<GUI::Widget> m_preview_window_widget;
|
||||
GUI::Widget* m_preview;
|
||||
GUI::ActionGroup m_views_group;
|
||||
|
||||
GUI::Icon m_icon;
|
||||
DeprecatedString m_file_path;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue