ui: made icon buttons self updating on color scheme change

* fixed hatching not replaced in single file view title bar on color scheme change
This commit is contained in:
Eberhard Graether
2018-03-19 22:44:45 +01:00
parent 66ac70850b
commit 166d82b44f
41 changed files with 386 additions and 505 deletions
@@ -0,0 +1,25 @@
#include "qt/element/QtSearchBarButton.h"
#include "settings/ApplicationSettings.h"
QtSearchBarButton::QtSearchBarButton(const FilePath& iconPath, bool small, QWidget* parent)
: QtSelfRefreshIconButton("", iconPath, "search/button", parent)
, m_small(small)
{
}
void QtSearchBarButton::refresh()
{
QtSelfRefreshIconButton::refresh();
int size = m_small ? 10 : 16;
float height = std::max(ApplicationSettings::getInstance()->getFontSize() + size, size + 14);
setFixedHeight(height);
if (!m_small)
{
int iconSize = int(height / 4) * 2 + 2;
setIconSize(QSize(iconSize, iconSize));
}
}