2019-02-26 21:52:02 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the 3-clause BSD License
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef MY_TOGGLE_BUTTON_H
|
|
|
|
#define MY_TOGGLE_BUTTON_H
|
|
|
|
|
|
|
|
#include <QskAbstractButton.h>
|
|
|
|
|
|
|
|
class QskGraphic;
|
|
|
|
class QskTextOptions;
|
|
|
|
|
|
|
|
class MyToggleButton : public QskAbstractButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
using Inherited = QskAbstractButton;
|
|
|
|
|
|
|
|
public:
|
|
|
|
QSK_SUBCONTROLS( Panel, Cursor, CheckedPanel, CheckedLabel, CheckedIcon,
|
|
|
|
UncheckedPanel, UncheckedLabel, UncheckedIcon )
|
|
|
|
|
|
|
|
MyToggleButton( QQuickItem* parent = nullptr );
|
|
|
|
~MyToggleButton() override;
|
|
|
|
|
2021-08-04 08:24:36 +02:00
|
|
|
bool isCheckable() const override final;
|
|
|
|
|
2019-02-26 21:52:02 +01:00
|
|
|
void setTextAt( int index, const QString& );
|
|
|
|
QString textAt( int index ) const;
|
|
|
|
|
|
|
|
void setIconAt( int index, const QString& icon );
|
|
|
|
QString iconAt( int index ) const;
|
|
|
|
|
|
|
|
void setTextOptions( const QskTextOptions& );
|
|
|
|
QskTextOptions textOptions() const;
|
|
|
|
|
|
|
|
QskGraphic graphicAt( int index ) const;
|
|
|
|
|
|
|
|
void setInverted( bool );
|
|
|
|
bool isInverted() const;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void invertedChanged( bool );
|
|
|
|
|
|
|
|
protected:
|
2019-12-15 13:34:07 +01:00
|
|
|
void updateResources() override;
|
2019-02-26 21:52:02 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
class PrivateData;
|
|
|
|
std::unique_ptr< PrivateData > m_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|