Inkscape
Vector Graphics Editor
font-button.cpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
/*
3
*
4
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
5
*/
6
7
#include "
font-button.h
"
8
9
#include <utility>
10
#include <gtkmm/fontbutton.h>
11
12
namespace
Inkscape::UI::Widget
{
13
14
FontButton::FontButton
(Glib::ustring
const
&label, Glib::ustring
const
&tooltip,
15
Glib::ustring
const
&icon,
bool
mnemonic)
16
:
Labelled
{label, tooltip, new
Gtk
::
FontButton
{
"Sans 10"
}, icon, mnemonic}
17
{
18
}
19
20
Glib::ustring
FontButton::getValue
()
const
21
{
22
return
getFontButton
().get_font();
23
}
24
25
void
FontButton::setValue
(Glib::ustring
const
&fontspec)
26
{
27
getFontButton
().set_font(fontspec);
28
}
29
30
Glib::SignalProxy<void()>
FontButton::signal_font_value_changed
()
31
{
32
return
getFontButton
().signal_font_set();
33
}
34
35
Gtk::FontButton
const
&
FontButton::getFontButton
()
const
36
{
37
auto
const
fontButton =
dynamic_cast<
Gtk::FontButton
const
*
>
(
getWidget
());
38
g_assert(fontButton);
39
return
*fontButton;
40
}
41
42
Gtk::FontButton &
FontButton::getFontButton
()
43
{
44
return
const_cast<
Gtk::FontButton &
>
(std::as_const(*this).getFontButton());
45
}
46
47
}
// namespace Inkscape::UI::Widget
48
49
/*
50
Local Variables:
51
mode:c++
52
c-file-style:"stroustrup"
53
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
54
indent-tabs-mode:nil
55
fill-column:99
56
End:
57
*/
58
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
Inkscape::UI::Widget::FontButton
A labelled font button for entering font values.
Definition:
font-button.h:24
Inkscape::UI::Widget::FontButton::getFontButton
Gtk::FontButton const & getFontButton() const
Definition:
font-button.cpp:35
Inkscape::UI::Widget::FontButton::FontButton
FontButton(Glib::ustring const &label, Glib::ustring const &tooltip, Glib::ustring const &icon={}, bool mnemonic=true)
Construct a FontButton Widget.
Definition:
font-button.cpp:14
Inkscape::UI::Widget::FontButton::getValue
Glib::ustring getValue() const
Definition:
font-button.cpp:20
Inkscape::UI::Widget::FontButton::setValue
void setValue(Glib::ustring const &fontspec)
Definition:
font-button.cpp:25
Inkscape::UI::Widget::FontButton::signal_font_value_changed
Glib::SignalProxy< void()> signal_font_value_changed()
Signal raised when the font button's value changes.
Definition:
font-button.cpp:30
Inkscape::UI::Widget::Labelled
Adds a label with optional icon to another widget.
Definition:
labelled.h:31
Inkscape::UI::Widget::Labelled::getWidget
Gtk::Widget const * getWidget() const
Definition:
labelled.h:48
font-button.h
Gtk
Definition:
desktop.h:51
Inkscape::UI::Widget
Custom widgets.
Definition:
desktop.h:127
src
ui
widget
font-button.cpp
Generated on Sun Apr 7 2024 04:01:33 for Inkscape by
1.9.4