LeechCraft 0.6.70-16373-g319c272718
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::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, std::string_view> Family2Name_;
75 QHash<IWkFontsSettable::FontFamily, QFont> PendingFontChanges_;
76
77 QHash<IWkFontsSettable::FontSize, QSpinBox*> Size2Spinbox_;
78 QHash<IWkFontsSettable::FontSize, std::string_view> 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
137
142 void sizeMultiplierChanged (qreal factor);
143 };
144}
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.
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.
#define UTIL_XSD_API
Definition xsdconfig.h:16