summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/frame.h
blob: b2934b6443b3adda51e4fda5a6e9acab031ee70b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Authors:
 *   Murray C
 *
 * Copyright (C) 2012 Authors
 *
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#ifndef INKSCAPE_UI_WIDGET_FRAME_H
#define INKSCAPE_UI_WIDGET_FRAME_H

#include <gtkmm/frame.h>
#include <gtkmm/label.h>

namespace Inkscape {
namespace UI {
namespace Widget {

/**
 * Creates a Gnome HIG style indented frame with bold label
 * See http://developer.gnome.org/hig-book/stable/controls-frames.html.en
 */
class Frame : public Gtk::Frame
{
public:

    /**
     * Construct a Frame Widget.
     *
     * @param label     The frame text.
     */
    Frame(Glib::ustring const &label = "", gboolean label_bold = TRUE);

    /**
     * Return the label widget
     */
    Gtk::Label const *get_label_widget() const;

    /**
     * Add a widget to this frame
     */
    void add(Widget& widget) override;

    /**
     * Set the frame label text and if bold or not
     */
    void set_label(const Glib::ustring &label, gboolean label_bold = TRUE);

    /**
     * Set the frame padding
     */
    void set_padding (guint padding_top, guint padding_bottom, guint padding_left, guint padding_right);

protected:
    Gtk::Label   _label;
};

} // namespace Widget
} // namespace UI
} // namespace Inkscape

#endif // INKSCAPE_UI_WIDGET_FRAME_H

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
  indent-tabs-mode:nil
  fill-column:99
  End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :