LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
wkfontswidget.h
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
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#pragma once
10
11
#include <memory>
12
#include <QWidget>
13
#include <QHash>
14
#include <
interfaces/iwkfontssettable.h
>
15
#include "
xsdconfig.h
"
16
17
class
QSpinBox;
18
19
namespace
Ui
20
{
21
class
WkFontsWidget;
22
}
23
24
namespace
LC::Util
25
{
26
class
BaseSettingsManager;
27
class
FontChooserWidget
;
28
66
class
UTIL_XSD_API
WkFontsWidget
:
public
QWidget
67
{
68
Q_OBJECT
69
70
std::shared_ptr<Ui::WkFontsWidget> Ui_;
71
BaseSettingsManager *
const
BSM_;
72
73
QHash<IWkFontsSettable::FontFamily, FontChooserWidget*> Family2Chooser_;
74
QHash<IWkFontsSettable::FontFamily, QByteArray> Family2Name_;
75
QHash<IWkFontsSettable::FontFamily, QFont> PendingFontChanges_;
76
77
QHash<IWkFontsSettable::FontSize, QSpinBox*> Size2Spinbox_;
78
QHash<IWkFontsSettable::FontSize, QByteArray> Size2Name_;
79
QHash<IWkFontsSettable::FontSize, int> PendingSizeChanges_;
80
81
QList<IWkFontsSettable*>
Settables_;
82
public
:
89
WkFontsWidget
(Util::BaseSettingsManager *bsm, QWidget *parent =
nullptr
);
90
98
void
RegisterSettable
(
IWkFontsSettable
*settable);
99
108
void
SetSize
(
IWkFontsSettable::FontSize
type,
int
size);
109
private
:
110
void
ResetFontChoosers ();
111
void
ResetSizeChoosers ();
112
113
void
ApplyPendingSizeChanges ();
114
115
void
ChangeAllFonts ();
116
public
slots:
117
void
accept
();
118
void
reject
();
119
signals:
127
void
fontChanged
(
IWkFontsSettable::FontFamily
family,
const
QFont& font);
128
136
void
sizeChanged
(
IWkFontsSettable::FontSize
type,
int
size);
137
142
void
sizeMultiplierChanged
(qreal factor);
143
};
144
}
IWkFontsSettable
Interface to aid WebKit-like-view-containing tabs to expose the view fonts configuration to the user.
Definition
iwkfontssettable.h:25
IWkFontsSettable::FontFamily
FontFamily
Enumeration for possible font families.
Definition
iwkfontssettable.h:33
IWkFontsSettable::FontSize
FontSize
Enumeration for possible font sizes.
Definition
iwkfontssettable.h:45
LC::Util::FontChooserWidget
Provides a widget for choosing a font.
Definition
fontchooserwidget.h:22
LC::Util::WkFontsWidget::RegisterSettable
void RegisterSettable(IWkFontsSettable *settable)
Registers an object to be automatically updated whenever font settings change.
Definition
wkfontswidget.cpp:69
LC::Util::WkFontsWidget::sizeChanged
void sizeChanged(IWkFontsSettable::FontSize type, int size)
Notifies the size for the given font type has been changed.
LC::Util::WkFontsWidget::SetSize
void SetSize(IWkFontsSettable::FontSize type, int size)
Sets the size for the given font size type.
Definition
wkfontswidget.cpp:83
LC::Util::WkFontsWidget::sizeMultiplierChanged
void sizeMultiplierChanged(qreal factor)
Notifies the text zoom factor has been changed.
LC::Util::WkFontsWidget::accept
void accept()
Definition
wkfontswidget.cpp:151
LC::Util::WkFontsWidget::WkFontsWidget
WkFontsWidget(Util::BaseSettingsManager *bsm, QWidget *parent=nullptr)
Creates the fonts settings widget.
Definition
wkfontswidget.cpp:20
LC::Util::WkFontsWidget::reject
void reject()
Definition
wkfontswidget.cpp:167
LC::Util::WkFontsWidget::fontChanged
void fontChanged(IWkFontsSettable::FontFamily family, const QFont &font)
Notifies the font for the given family has been changed.
QList
Definition
ianrulesstorage.h:14
iwkfontssettable.h
LC::Util
Definition
icoreproxy.h:34
Ui
Definition
findnotification.h:19
xsdconfig.h
UTIL_XSD_API
#define UTIL_XSD_API
Definition
xsdconfig.h:16
src
util
xsd
wkfontswidget.h
Generated by
1.17.0