| 18 | ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, LightIconColor); |
| 19 | ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, DarkIconColor); |
| 20 | ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, LightHoverIconColor); |
| 21 | ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, DarkHoverIconColor); |
| 22 | ELA_PROPERTY_Q_CPP(ElaIconButton, bool, IsSelected); |
| 23 | ElaIconButton::ElaIconButton(const QPixmap& pix, QWidget* parent) |
| 24 | : QPushButton(parent), d_ptr(new ElaIconButtonPrivate()) |
| 25 | { |
| 26 | Q_D(ElaIconButton); |
| 27 | d->q_ptr = this; |
| 28 | setFixedHeight(ElaWidgetToolsSize::DefaultControlHeight); |
| 29 | d->_iconPix = pix.copy(); |
| 30 | d->_pOpacity = 1; |
| 31 | d->_pLightHoverColor = ElaThemeColor(ElaThemeType::Light, BasicHoverAlpha); |
| 32 | d->_pDarkHoverColor = ElaThemeColor(ElaThemeType::Dark, BasicHoverAlpha); |
| 33 | d->_pLightIconColor = ElaThemeColor(ElaThemeType::Light, BasicText); |
| 34 | d->_pDarkIconColor = ElaThemeColor(ElaThemeType::Dark, BasicText); |
| 35 | d->_pLightHoverIconColor = ElaThemeColor(ElaThemeType::Light, BasicText); |
| 36 | d->_pDarkHoverIconColor = ElaThemeColor(ElaThemeType::Dark, BasicText); |
| 37 | d->_pIsSelected = false; |
| 38 | d->_pBorderRadius = 0; |
| 39 | d->_themeMode = eTheme->getThemeMode(); |
| 40 | connect(this, &ElaIconButton::pIsSelectedChanged, this, [=]() { |
| 41 | update(); |
| 42 | }); |
| 43 | connect(eTheme, &ElaTheme::themeModeChanged, this, [=](ElaThemeType::ThemeMode themeMode) { |
| 44 | d->_themeMode = themeMode; |
| 45 | }); |
| 46 | } |
nothing calls this directly
no test coverage detected