added username in the titlebar

This commit is contained in:
fourtf
2018-02-05 23:32:38 +01:00
parent 9b1300212a
commit 6b483640cd
3 changed files with 22 additions and 2 deletions
+14 -1
View File
@@ -2,6 +2,7 @@
#include "singletons/settingsmanager.hpp"
#include "util/nativeeventhelper.hpp"
#include "widgets/helper/rippleeffectlabel.hpp"
#include "widgets/tooltipwidget.hpp"
#include <QApplication>
@@ -149,7 +150,6 @@ bool BaseWindow::hasCustomWindowFrame()
{
#ifdef Q_OS_WIN
return this->enableCustomFrame;
// return false;
#else
return false;
#endif
@@ -182,6 +182,19 @@ void BaseWindow::addTitleBarButton(const TitleBarButton::Style &style,
QObject::connect(button, &TitleBarButton::clicked, this, [onClicked] { onClicked(); });
}
RippleEffectLabel *BaseWindow::addTitleBarLabel(std::function<void()> onClicked)
{
RippleEffectLabel *button = new RippleEffectLabel;
button->setScaleIndependantHeight(30);
this->buttons.push_back(button);
this->titlebarBox->insertWidget(2, button);
QObject::connect(button, &RippleEffectLabel::clicked, this, [onClicked] { onClicked(); });
return button;
}
void BaseWindow::changeEvent(QEvent *)
{
TooltipWidget::getInstance()->hide();