Files
Sourcetrail/src/lib_gui/qt/element/QtSearchBarButton.cpp
T
mlangkabel dfc6d88432 build: search headers in all source directories
* removed paths in include directives
* changed cmake to provide necessary header search paths
* changed name of version.h to productVersion.h due to name conflict
2018-09-18 19:00:18 +02:00

27 lines
593 B
C++

#include "QtSearchBarButton.h"
#include "ApplicationSettings.h"
QtSearchBarButton::QtSearchBarButton(const FilePath& iconPath, bool small, QWidget* parent)
: QtSelfRefreshIconButton("", iconPath, "search/button", parent)
, m_small(small)
{
refresh();
}
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));
}
}