1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:57:44 +00:00

ModelGallery: Add the new Model Gallery application :^)

This is an application analogous to WidgetGallery, in that it tests
various capabilities of LibGUI models. Right now it is pretty bare, but
as more work towards LibGUI models is done regarding persistent model
indices, more demos will be added.
This commit is contained in:
sin-ack 2021-08-16 22:09:58 +00:00 committed by Ali Mohammad Pur
parent a8967388d3
commit b30b7de2d2
11 changed files with 327 additions and 0 deletions

View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "BasicModel.h"
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Button.h>
#include <LibGUI/Statusbar.h>
#include <LibGUI/TabWidget.h>
#include <LibGUI/TableView.h>
#include <LibGUI/TextBox.h>
#include <LibGUI/Widget.h>
class GalleryWidget final : public GUI::Widget {
C_OBJECT(GalleryWidget)
private:
GalleryWidget();
void load_basic_model_tab();
void load_sorting_filtering_tab();
void add_textbox_contents_to_basic_model();
RefPtr<GUI::TabWidget> m_tab_widget;
RefPtr<GUI::Statusbar> m_statusbar;
size_t m_invalidation_count { 0 };
RefPtr<BasicModel> m_basic_model;
RefPtr<GUI::TableView> m_basic_model_table;
RefPtr<GUI::TextBox> m_new_item_name;
RefPtr<GUI::Button> m_add_new_item;
RefPtr<GUI::Button> m_remove_selected_item;
};