Skip to content
Snippets Groups Projects
Commit 7ef936e3 authored by dmitriy.gerasimov's avatar dmitriy.gerasimov
Browse files

Merge branch 'bugs-3437' into 'master'

bugs-3437 | Fixed tab-focus control

See merge request !30
parents 2f9db7cf 66dfd1e3
No related branches found
No related tags found
2 merge requests!32Features 3487,!30bugs-3437 | Fixed tab-focus control
......@@ -41,6 +41,22 @@ CustomPlacementButton::CustomPlacementButton(QWidget *a_parent)
connect(this, &QAbstractButton::toggled, [=]() {
this->updateAppearance();
});
connect(this, &CustomPlacementButton::tabFocusIn, [=]() {
this->updateAppearanceForFocus(true);
});
connect(this, &CustomPlacementButton::tabFocusOut, [=]() {
this->updateAppearanceForFocus(false);
});
}
void CustomPlacementButton::emitTabFocus(bool isActiv)
{
isActiv ? emit tabFocusIn() : emit tabFocusOut();
}
/** @brief Reimplemented QPushButton::setText method. Sets text property of text subcontrol.
......@@ -93,6 +109,17 @@ void CustomPlacementButton::updateAppearance()
update();//for appliyng hover/normal stylesheet of button
}
/** @brief Updates appearance of image and text
*/
void CustomPlacementButton::updateAppearanceForFocus(bool target)
{
for (StyledSubcontrol *subcontrol: m_subcontrols){
subcontrol->setStylesheet(target, true);
}
update();//for appliyng hover/normal stylesheet of button
}
/** @brief add new subcontrol and place it in layout
* @param a_id text id of subcontrol wich is using in CSS file
*/
......
......@@ -57,8 +57,14 @@ public:
void updateStyleSheets();
void updateAppearance();
void updateAppearanceForFocus(bool);
void addSubcontrol(QString a_id);
void emitTabFocus(bool isActiv);
signals:
void tabFocusIn();
void tabFocusOut();
private:
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment