mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
Ref T30, font settings component and same as dialog
This commit is contained in:
committed by
Mathew Sutcliffe
parent
c0fb236b25
commit
bf573f0f20
75
src/blackgui/components/settingsfontcomponent.h
Normal file
75
src/blackgui/components/settingsfontcomponent.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* Copyright (C) 2017
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKGUI_COMPONENTS_SETTINGSFONTCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_SETTINGSFONTCOMPONENT_H
|
||||
|
||||
#include <QFrame>
|
||||
|
||||
namespace Ui { class CSettingsFontComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
/*!
|
||||
* Font settings
|
||||
*/
|
||||
class CSettingsFontComponent : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! How to update
|
||||
enum Mode
|
||||
{
|
||||
DirectUpdate,
|
||||
GenerateQssOnly
|
||||
};
|
||||
|
||||
//! Constructor
|
||||
explicit CSettingsFontComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CSettingsFontComponent();
|
||||
|
||||
//! Set mode
|
||||
void setMode(Mode m);
|
||||
|
||||
//! Get the stylesheet
|
||||
const QString &getQss() const { return m_qss; }
|
||||
|
||||
//! Set the current font
|
||||
void setCurrentFont(const QFont &font);
|
||||
|
||||
signals:
|
||||
//! To be used with dialogs
|
||||
void accept();
|
||||
|
||||
//! To be used with dialogs
|
||||
void reject();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CSettingsFontComponent> ui;
|
||||
QColor m_selectedColor;
|
||||
QColor m_cancelColor;
|
||||
QFont m_cancelFont;
|
||||
QString m_qss;
|
||||
Mode m_mode = DirectUpdate;
|
||||
|
||||
void changeFont();
|
||||
void resetFont();
|
||||
void fontColorDialog();
|
||||
void initUiValues();
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user