/* * Copyright (c) 2021, Matthew Olsson * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "OutlineModel.h" #include #include class SidebarWidget final : public GUI::Widget { C_OBJECT(SidebarWidget) public: ~SidebarWidget() override = default; void set_outline(RefPtr outline) { if (outline) { m_model = OutlineModel::create(outline.release_nonnull()); m_outline_tree_view->set_model(m_model); } else { m_model = RefPtr {}; m_outline_tree_view->set_model({}); } } private: SidebarWidget(); RefPtr m_model; RefPtr m_outline_tree_view; };