MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / ElaIconButton

Method ElaIconButton

ElaWidgetTools/ElaIconButton.cpp:20–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, LightIconColor);
19ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, DarkIconColor);
20ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, LightHoverIconColor);
21ELA_PROPERTY_Q_CPP(ElaIconButton, QColor, DarkHoverIconColor);
22ELA_PROPERTY_Q_CPP(ElaIconButton, bool, IsSelected);
23ElaIconButton::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}

Callers

nothing calls this directly

Calls 2

getThemeModeMethod · 0.80
setFixedSizeMethod · 0.80

Tested by

no test coverage detected