mirror of
https://github.com/dashpay/dash.git
synced 2024-12-30 22:35:51 +01:00
3a1d168a33
* qt: Add missing -font-family overridden check * qt: Add missing `QFont::ExtraBold` * qt: Remove settings depencency from GUIUtil::loadFonts and load earlier * qt: Modify supportedWeightToIndex Return -1 in case of failure * qt: Add GUIUtil::isSupportedWeight * qt: Make sure there are always supported weights in the settings * qt: Add "supported defaults" + store weights based on font family * qt: Use supported defaults in update weight sliders * qt: Use supported defaults when updating weight sliders * qt: Fix tests
60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
// Copyright (c) 2020 The Dash Core developers
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_QT_APPEARANCEWIDGET_H
|
|
#define BITCOIN_QT_APPEARANCEWIDGET_H
|
|
|
|
#include <QWidget>
|
|
|
|
#include <qt/guiutil.h>
|
|
|
|
namespace Ui {
|
|
class AppearanceWidget;
|
|
}
|
|
|
|
class OptionsModel;
|
|
|
|
class QDataWidgetMapper;
|
|
class QSlider;
|
|
class QComboBox;
|
|
|
|
class AppearanceWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AppearanceWidget(QWidget* parent = 0);
|
|
~AppearanceWidget();
|
|
|
|
void setModel(OptionsModel* model);
|
|
|
|
Q_SIGNALS:
|
|
void appearanceChanged();
|
|
|
|
public Q_SLOTS:
|
|
void accept();
|
|
|
|
private Q_SLOTS:
|
|
void updateTheme(const QString& toTheme = QString());
|
|
void updateFontFamily(int index);
|
|
void updateFontScale(int nScale);
|
|
void updateFontWeightNormal(int nValue, bool fForce = false);
|
|
void updateFontWeightBold(int nValue, bool fForce = false);
|
|
|
|
private:
|
|
Ui::AppearanceWidget* ui;
|
|
QDataWidgetMapper* mapper;
|
|
OptionsModel* model;
|
|
bool fAcceptChanges;
|
|
QString prevTheme;
|
|
int prevScale;
|
|
GUIUtil::FontFamily prevFontFamily;
|
|
QFont::Weight prevWeightNormal;
|
|
QFont::Weight prevWeightBold;
|
|
|
|
void updateWeightSlider(bool fForce = false);
|
|
};
|
|
|
|
#endif // BITCOIN_QT_APPEARANCEWIDGET_H
|