|
|
|
@ -23,6 +23,7 @@
|
|
|
|
|
|
|
|
|
|
#include <QRadioButton>
|
|
|
|
|
|
|
|
|
|
class QButtonGroup;
|
|
|
|
|
class QComboBox;
|
|
|
|
|
class QGridLayout;
|
|
|
|
|
class QHBoxLayout;
|
|
|
|
@ -32,6 +33,9 @@ namespace Calamares
|
|
|
|
|
class ClickableLabel;
|
|
|
|
|
|
|
|
|
|
/** @brief A radio button with fancy label next to it.
|
|
|
|
|
*
|
|
|
|
|
* The fancy label is used so that the text alongside the radio
|
|
|
|
|
* button can word-wrap, be multi-line, and support rich text.
|
|
|
|
|
*
|
|
|
|
|
* The radio button itself can be retrieved with buttonWidget(),
|
|
|
|
|
* and the whole behaves a lot like a label. Extra options can be
|
|
|
|
@ -45,17 +49,26 @@ public:
|
|
|
|
|
explicit PrettyRadioButton( QWidget* parent = nullptr );
|
|
|
|
|
virtual ~PrettyRadioButton() { }
|
|
|
|
|
|
|
|
|
|
virtual void setText( const QString& text );
|
|
|
|
|
|
|
|
|
|
virtual void setIconSize( const QSize& size );
|
|
|
|
|
/// @brief Passes @p text on to the ClickableLabel
|
|
|
|
|
void setText( const QString& text );
|
|
|
|
|
|
|
|
|
|
virtual void setIcon( const QIcon& icon );
|
|
|
|
|
// Icon applies to the radio-button part
|
|
|
|
|
void setIconSize( const QSize& size );
|
|
|
|
|
QSize iconSize() const;
|
|
|
|
|
void setIcon( const QIcon& icon );
|
|
|
|
|
|
|
|
|
|
virtual QSize iconSize() const;
|
|
|
|
|
// Applies to the radio-button part
|
|
|
|
|
void setChecked( bool checked );
|
|
|
|
|
bool isChecked() const;
|
|
|
|
|
|
|
|
|
|
virtual QRadioButton* buttonWidget() const;
|
|
|
|
|
/** @brief Adds the radio-button part to the given @p group
|
|
|
|
|
*
|
|
|
|
|
* For managing the pretty-radio-button in button groups like normal
|
|
|
|
|
* radio buttons, call addToGroup() rather that group->addButton().
|
|
|
|
|
*/
|
|
|
|
|
void addToGroup( QButtonGroup* group, int id = -1 );
|
|
|
|
|
|
|
|
|
|
/** @brief Add an options drop-down to this button. */
|
|
|
|
|
/// @brief Add an options drop-down to this button.
|
|
|
|
|
void addOptionsComboBox( QComboBox* );
|
|
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|