diff --git a/src/libcalamaresui/widgets/ClickableLabel.cpp b/src/libcalamaresui/widgets/ClickableLabel.cpp index 6e6f54459..8f2323fa4 100644 --- a/src/libcalamaresui/widgets/ClickableLabel.cpp +++ b/src/libcalamaresui/widgets/ClickableLabel.cpp @@ -18,7 +18,10 @@ #include "ClickableLabel.h" -#include +#include // for doubleClickInterval() + +namespace Calamares +{ ClickableLabel::ClickableLabel( QWidget* parent ) @@ -53,3 +56,5 @@ ClickableLabel::mouseReleaseEvent( QMouseEvent* event ) emit clicked(); } } + +} // namespace Calamares diff --git a/src/libcalamaresui/widgets/ClickableLabel.h b/src/libcalamaresui/widgets/ClickableLabel.h index 5a3265c13..f60a247ca 100644 --- a/src/libcalamaresui/widgets/ClickableLabel.h +++ b/src/libcalamaresui/widgets/ClickableLabel.h @@ -20,8 +20,13 @@ #ifndef LIBCALAMARESUI_CLICKABLELABEL_H #define LIBCALAMARESUI_CLICKABLELABEL_H -#include #include +#include + +#include "DllMacro.h" + +namespace Calamares +{ /** @brief A Label where the whole label area is clickable * @@ -30,7 +35,7 @@ * buttons or other clickable things where you want mouse interaction * with the label, to be the same as mouse interaction with the control. */ -class ClickableLabel : public QLabel +class UIDLLEXPORT ClickableLabel : public QLabel { Q_OBJECT public: @@ -49,4 +54,6 @@ private: QElapsedTimer m_time; }; +} // namespace Calamares + #endif // LIBCALAMARESUI_CLICKABLELABEL_H diff --git a/src/libcalamaresui/widgets/PrettyRadioButton.cpp b/src/libcalamaresui/widgets/PrettyRadioButton.cpp index 18627f41c..31b74e9e2 100644 --- a/src/libcalamaresui/widgets/PrettyRadioButton.cpp +++ b/src/libcalamaresui/widgets/PrettyRadioButton.cpp @@ -26,6 +26,8 @@ #include #include +namespace Calamares +{ PrettyRadioButton::PrettyRadioButton( QWidget* parent ) : QWidget( parent ) @@ -45,10 +47,8 @@ PrettyRadioButton::PrettyRadioButton( QWidget* parent ) m_mainLayout->addWidget( m_label, 0, 1 ); m_mainLayout->setContentsMargins( 0, 0, 0, 0 ); - connect( m_label, &ClickableLabel::clicked, - m_radio, &QRadioButton::click ); - connect( m_radio, &QRadioButton::toggled, - this, &PrettyRadioButton::toggleOptions ); + connect( m_label, &ClickableLabel::clicked, m_radio, &QRadioButton::click ); + connect( m_radio, &QRadioButton::toggled, this, &PrettyRadioButton::toggleOptions ); } @@ -90,7 +90,9 @@ void PrettyRadioButton::addOptionsComboBox( QComboBox* box ) { if ( !box ) + { return; + } if ( !m_optionsLayout ) { @@ -105,12 +107,16 @@ PrettyRadioButton::addOptionsComboBox( QComboBox* box ) toggleOptions( m_radio->isChecked() ); } - m_optionsLayout->insertWidget( m_optionsLayout->count()-1, box ); + m_optionsLayout->insertWidget( m_optionsLayout->count() - 1, box ); } void PrettyRadioButton::toggleOptions( bool toggle ) { if ( m_optionsLayout ) + { m_optionsLayout->parentWidget()->setVisible( toggle ); + } } + +} // namespace Calamares diff --git a/src/libcalamaresui/widgets/PrettyRadioButton.h b/src/libcalamaresui/widgets/PrettyRadioButton.h index efc4be70c..dbaa88707 100644 --- a/src/libcalamaresui/widgets/PrettyRadioButton.h +++ b/src/libcalamaresui/widgets/PrettyRadioButton.h @@ -19,13 +19,18 @@ #ifndef LIBCALAMARESUI_PRETTYRADIOBUTTON_H #define LIBCALAMARESUI_PRETTYRADIOBUTTON_H +#include "DllMacro.h" + #include -class ClickableLabel; class QComboBox; class QGridLayout; class QHBoxLayout; +namespace Calamares +{ +class ClickableLabel; + /** @brief A radio button with fancy label next to it. * * The radio button itself can be retrieved with buttonWidget(), @@ -33,12 +38,12 @@ class QHBoxLayout; * added to the display (options are hidden when the button is * not selected) with addOptionsComboBox(). */ -class PrettyRadioButton : public QWidget +class UIDLLEXPORT PrettyRadioButton : public QWidget { Q_OBJECT public: explicit PrettyRadioButton( QWidget* parent = nullptr ); - virtual ~PrettyRadioButton() {} + virtual ~PrettyRadioButton() { } virtual void setText( const QString& text ); @@ -64,4 +69,5 @@ protected: QHBoxLayout* m_optionsLayout; }; -#endif // LIBCALAMARESUI_PRETTYRADIOBUTTON_H +} // namespace Calamares +#endif // LIBCALAMARESUI_PRETTYRADIOBUTTON_H