Added support for focus styling of CFloatingWidgetTitleBra

This commit is contained in:
Uwe Kindler
2020-05-19 22:53:52 +02:00
parent ba94ef3493
commit 819f1effc5
6 changed files with 94 additions and 12 deletions

View File

@@ -115,7 +115,7 @@ void FloatingWidgetTitleBarPrivate::createLayout()
//============================================================================
CFloatingWidgetTitleBar::CFloatingWidgetTitleBar(CFloatingDockContainer *parent) :
QWidget(parent),
QFrame(parent),
d(new FloatingWidgetTitleBarPrivate(this))
{
d->FloatingWidget = parent;
@@ -172,16 +172,26 @@ void CFloatingWidgetTitleBar::mouseMoveEvent(QMouseEvent *ev)
Super::mouseMoveEvent(ev);
}
//============================================================================
void CFloatingWidgetTitleBar::enableCloseButton(bool Enable)
{
d->CloseButton->setEnabled(Enable);
}
//============================================================================
void CFloatingWidgetTitleBar::setTitle(const QString &Text)
{
d->TitleLabel->setText(Text);
}
//============================================================================
void CFloatingWidgetTitleBar::updateStyle()
{
internal::repolishStyle(this);
internal::repolishStyle(d->TitleLabel);
}
} // namespace ads

View File

@@ -29,7 +29,7 @@
//============================================================================
// INCLUDES
//============================================================================
#include <QWidget>
#include <QFrame>
namespace ads
{
@@ -45,7 +45,7 @@ struct FloatingWidgetTitleBarPrivate;
* for the docking system to work properly, we use our own titlebar here to
* capture the required mouse events.
*/
class CFloatingWidgetTitleBar : public QWidget
class CFloatingWidgetTitleBar : public QFrame
{
Q_OBJECT
private:
@@ -75,6 +75,11 @@ public:
*/
void setTitle(const QString &Text);
/**
* Update stylesheet style if a property changes
*/
void updateStyle();
signals:
/**
* This signal is emitted, if the close button is clicked.