1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * @brief A dialog for the start screen
6 * Copyright (C) Martin Owens 2020 <doctormo@gmail.com>
8 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
14 #include <string> // for string
15 #include <gdk/gdk.h> // for GdkModifierType
16 #include <glibmm/refptr.h> // for RefPtr
17 #include <glibmm/ustring.h> // for ustring
18 #include <gtk/gtk.h> // for GtkEventControllerKey
19 #include <gtkmm/dialog.h> // for Dialog
20 #include <gtkmm/treemodel.h> // for TreeModel
21 #include <sigc++/scoped_connection.h>
23 #include "ui/widget/template-list.h"
37 namespace Inkscape::UI::Dialog
{
39 class StartScreen
: public Gtk::Dialog
{
42 ~StartScreen() override
;
44 SPDocument
* get_document() { return _document
; }
47 void on_response(int response_id
) override
;
50 void notebook_next(Gtk::Widget
*button
);
51 bool on_key_pressed(unsigned keyval
, unsigned keycode
, Gdk::ModifierType state
);
52 Gtk::TreeModel::Row
active_combo(std::string widget_name
);
53 void set_active_combo(std::string widget_name
, std::string unique_id
);
55 void refresh_keys_warning();
56 void enlist_recent_files();
59 void keyboard_changed();
60 void notebook_switch(Gtk::Widget
*tab
, unsigned page_num
);
63 void canvas_changed();
64 void refresh_theme(Glib::ustring theme_name
);
65 void refresh_dark_switch();
69 void on_recent_changed();
70 void on_kind_changed(const Glib::ustring
& name
);
72 Glib::RefPtr
<Gtk::Builder
> builder
;
74 Gtk::Overlay
&banners
;
75 Gtk::ComboBox
&themes
;
76 Gtk::TreeView
&recent_treeview
;
77 Gtk::Button
&load_btn
;
78 Inkscape::UI::Widget::TemplateList templates
;
79 Gtk::Notebook
& _kinds
;
81 SPDocument
* _document
= nullptr;
82 sigc::scoped_connection _tabs_switch_page_conn
;
83 sigc::scoped_connection _templates_switch_page_conn
;
86 } // namespace Inkscape::UI::Dialog
88 #endif // STARTSCREEN_H
93 c-file-style:"stroustrup"
94 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
99 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :