LeechCraft
0.6.70-10870-g558588d6ec
Modular cross-platform feature rich live environment.
massfontchangedialog.cpp
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Boost Software License - Version 1.0 - August 17th, 2003
6
*
7
* Permission is hereby granted, free of charge, to any person or organization
8
* obtaining a copy of the software and accompanying documentation covered by
9
* this license (the "Software") to use, reproduce, display, distribute,
10
* execute, and transmit the Software, and to prepare derivative works of the
11
* Software, and to permit third-parties to whom the Software is furnished to
12
* do so, all subject to the following:
13
*
14
* The copyright notices in the Software and this entire statement, including
15
* the above license grant, this restriction and the following disclaimer,
16
* must be included in all copies of the Software, in whole or in part, and
17
* all derivative works of the Software, unless such copies or derivative
18
* works are solely in the form of machine-executable object code generated by
19
* a source language processor.
20
*
21
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
* DEALINGS IN THE SOFTWARE.
28
**********************************************************************/
29
30
#include "
massfontchangedialog.h
"
31
#include <
util/sll/qtutil.h
>
32
33
namespace
LeechCraft
34
{
35
namespace
Util
36
{
37
MassFontChangeDialog::MassFontChangeDialog
(
const
QFont& font,
38
const
QList<IWkFontsSettable::FontFamily>
& families, QWidget *parent)
39
: QDialog { parent }
40
{
41
Ui_.setupUi (
this
);
42
43
Family2Box_ [
IWkFontsSettable::FontFamily::StandardFont
] = Ui_.StandardBox_;
44
Family2Box_ [
IWkFontsSettable::FontFamily::FixedFont
] = Ui_.FixedBox_;
45
Family2Box_ [
IWkFontsSettable::FontFamily::SerifFont
] = Ui_.SerifBox_;
46
Family2Box_ [
IWkFontsSettable::FontFamily::SansSerifFont
] = Ui_.SansSerifBox_;
47
Family2Box_ [
IWkFontsSettable::FontFamily::CursiveFont
] = Ui_.CursiveBox_;
48
Family2Box_ [
IWkFontsSettable::FontFamily::FantasyFont
] = Ui_.FantasyBox_;
49
50
for
(
const
auto
family : families)
51
Family2Box_ [family]->setCheckState (Qt::Checked);
52
53
Ui_.FontChooser_->SetFont (font);
54
}
55
56
QFont
MassFontChangeDialog::GetFont
()
const
57
{
58
return
Ui_.FontChooser_->GetFont ();
59
}
60
61
QList<IWkFontsSettable::FontFamily>
MassFontChangeDialog::GetFamilies
()
const
62
{
63
QList<IWkFontsSettable::FontFamily>
result;
64
for
(
const
auto
& pair :
Util::Stlize
(Family2Box_))
65
if
(pair.second->checkState () == Qt::Checked)
66
result << pair.first;
67
return
result;
68
}
69
}
70
}
IWkFontsSettable::FontFamily::FantasyFont
LeechCraft::Util::Stlize
auto Stlize(Assoc &&assoc) -> detail::StlAssocRange< detail::Identity, detail::Identity, decltype(assoc.begin()), Assoc, PairType >
Converts an Qt's associative sequence assoc to an STL-like iteratable range.
Definition:
qtutil.h:166
IWkFontsSettable::FontFamily::StandardFont
IWkFontsSettable::FontFamily::SansSerifFont
LeechCraft
Definition:
constants.h:35
LeechCraft::Util::MassFontChangeDialog::GetFamilies
QList< IWkFontsSettable::FontFamily > GetFamilies() const
Definition:
massfontchangedialog.cpp:61
massfontchangedialog.h
qtutil.h
IWkFontsSettable::FontFamily::CursiveFont
QList
Definition:
ianrulesstorage.h:35
LeechCraft::Util::MassFontChangeDialog::MassFontChangeDialog
MassFontChangeDialog(const QFont &, const QList< IWkFontsSettable::FontFamily > &, QWidget *=nullptr)
Definition:
massfontchangedialog.cpp:37
IWkFontsSettable::FontFamily::FixedFont
IWkFontsSettable::FontFamily::SerifFont
LeechCraft::Util::MassFontChangeDialog::GetFont
QFont GetFont() const
Definition:
massfontchangedialog.cpp:56
src
util
xsd
massfontchangedialog.cpp
Generated by
1.8.14