1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Inkflow-box widget. 4 * This widget allow pack widgets in a flowbox with a controller to show-hide 5 * 6 * Author: 7 * Jabier Arraiza <jabier.arraiza@marker.es> 8 * 9 * Copyright (C) 2018 Jabier Arraiza 10 * 11 * Released under GNU GPL v2+, read the file 'COPYING' for more information. 12 */ 13 14 #ifndef INKSCAPE_INK_FLOW_BOX_H 15 #define INKSCAPE_INK_FLOW_BOX_H 16 17 #include <gtkmm/actionbar.h> 18 #include <gtkmm/box.h> 19 #include <gtkmm/flowbox.h> 20 #include <gtkmm/flowboxchild.h> 21 #include <gtkmm/togglebutton.h> 22 #include <sigc++/signal.h> 23 24 namespace Inkscape { 25 namespace UI { 26 namespace Widget { 27 28 /** 29 * A flowbox widget with filter controller for dialogs. 30 */ 31 32 class InkFlowBox : public Gtk::Box { 33 public: 34 InkFlowBox(const gchar *name); 35 ~InkFlowBox() override; 36 void insert(Gtk::Widget *widget, Glib::ustring label, gint pos, bool active, int minwidth); 37 void on_toggle(gint pos, Gtk::ToggleButton *tbutton); 38 void on_global_toggle(Gtk::ToggleButton *tbutton); 39 void set_visible(gint pos, bool visible); 40 bool on_filter(Gtk::FlowBoxChild *child); 41 Glib::ustring getPrefsPath(gint pos); 42 /** 43 * Construct a InkFlowBox. 44 */ 45 46 private: 47 Gtk::FlowBox _flowbox; 48 Gtk::ActionBar _controller; 49 gint showing; 50 bool sensitive; 51 }; 52 53 } // namespace Widget 54 } // namespace UI 55 } // namespace Inkscape 56 57 #endif // INKSCAPE_INK_FLOW_BOX_H 58 59 /* 60 Local Variables: 61 mode:c++ 62 c-file-style:"stroustrup" 63 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) 64 indent-tabs-mode:nil 65 fill-column:99 66 End: 67 */ 68 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : 69