Files
Sourcetrail/src/lib_gui/qt/element/QtRefreshBar.cpp
T
Eberhard Graether 8e908c2a78 logic: Added Non-Commercial Use option and removed trial mode
* Added non-commercial use option to enter license window
* Show enter license window on first start and force license selection
* Added ApplicationSettings migration that removed private/academic license and switches user to non-commercial mode
* Added commandline option to choose non-commercial use and provide better hints to license selection
* Removed trial mode

fortune cookie message = A secret admirer will soon send you a sign of affection.
2017-10-19 16:58:47 +02:00

53 lines
1.2 KiB
C++

#include "qt/element/QtRefreshBar.h"
#include <QHBoxLayout>
#include <QPushButton>
#include "utility/messaging/type/MessageRefresh.h"
#include "utility/ResourcePaths.h"
#include "qt/utility/utilityQt.h"
#include "settings/ApplicationSettings.h"
QtRefreshBar::QtRefreshBar()
{
setObjectName("refresh_bar");
QBoxLayout* layout = new QHBoxLayout();
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setAlignment(Qt::AlignTop);
setLayout(layout);
m_refreshButton = new QPushButton(this);
m_refreshButton->setObjectName("refresh_button");
m_refreshButton->setToolTip("refresh");
m_refreshButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
layout->addWidget(m_refreshButton);
connect(m_refreshButton, &QPushButton::clicked, this, &QtRefreshBar::refreshClicked);
refreshStyle();
}
QtRefreshBar::~QtRefreshBar()
{
}
void QtRefreshBar::refreshClicked()
{
MessageRefresh().dispatch();
}
void QtRefreshBar::refreshStyle()
{
float height = std::max(ApplicationSettings::getInstance()->getFontSize() + 16, 30);
m_refreshButton->setFixedHeight(height);
m_refreshButton->setIcon(utility::createButtonIcon(
ResourcePaths::getGuiPath().str() + "refresh_view/images/refresh.png",
"search/button"
));
}