LeechCraft 0.6.70-14794-g33744ae6ce
Modular cross-platform feature rich live environment.
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>
15#include "xsdconfig.h"
16
17class QSpinBox;
18
19namespace Ui
20{
21 class WkFontsWidget;
22}
23
24namespace LC
25{
26namespace Util
27{
28 class BaseSettingsManager;
29 class FontChooserWidget;
30
68 class UTIL_XSD_API WkFontsWidget : public QWidget
69 {
70 Q_OBJECT
71
72 std::shared_ptr<Ui::WkFontsWidget> Ui_;
73 BaseSettingsManager * const BSM_;
74
75 QHash<IWkFontsSettable::FontFamily, FontChooserWidget*> Family2Chooser_;
76 QHash<IWkFontsSettable::FontFamily, std::string_view> Family2Name_;
77 QHash<IWkFontsSettable::FontFamily, QFont> PendingFontChanges_;
78
79 QHash<IWkFontsSettable::FontSize, QSpinBox*> Size2Spinbox_;
80 QHash<IWkFontsSettable::FontSize, std::string_view> Size2Name_;
81 QHash<IWkFontsSettable::FontSize, int> PendingSizeChanges_;
82
83 QList<IWkFontsSettable*> Settables_;
84 public:
91 WkFontsWidget (Util::BaseSettingsManager *bsm, QWidget *parent = nullptr);
92
100 void RegisterSettable (IWkFontsSettable *settable);
101
110 void SetSize (IWkFontsSettable::FontSize type, int size);
111 private:
112 void ResetFontChoosers ();
113 void ResetSizeChoosers ();
114
115 void ApplyPendingSizeChanges ();
116 private slots:
117 void on_ChangeAll__released ();
118 public slots:
119 void accept ();
120 void reject ();
121 signals:
129 void fontChanged (IWkFontsSettable::FontFamily family, const QFont& font);
130
139
144 void sizeMultiplierChanged (qreal factor);
145 };
146}
147}
Interface to aid WebKit-like-view-containing tabs to expose the view fonts configuration to the user.
FontFamily
Enumeration for possible font families.
FontSize
Enumeration for possible font sizes.
A settings widget for configuring WebKit fonts.
Definition: wkfontswidget.h:69
void sizeChanged(IWkFontsSettable::FontSize type, int size)
Notifies the size for the given font type has been changed.
void sizeMultiplierChanged(qreal factor)
Notifies the text zoom factor has been changed.
void fontChanged(IWkFontsSettable::FontFamily family, const QFont &font)
Notifies the font for the given family has been changed.
Definition: constants.h:15
#define UTIL_XSD_API
Definition: xsdconfig.h:16