16#include "core/Window_p.h"
17#include "core/Utils_p.h"
18#include "core/View_p.h"
19#include "core/Logging_p.h"
20#include "core/TitleBar_p.h"
21#include "core/DockRegistry_p.h"
27#include <QStyleOptionDockWidget>
59 const QList<QSize> iconSizes = opt.icon.availableSizes();
71#if defined(Q_OS_LINUX)
73 const qreal combinedFactor = logicalFactor * dpr;
75 if (scalingFactorIsSupported(combinedFactor))
77 opt.iconSize = opt.iconSize * combinedFactor;
78#elif defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
82 && scalingFactorIsSupported(logicalFactor))
84 opt.iconSize = opt.iconSize * logicalFactor;
86 Q_UNUSED(logicalFactor);
104class KDDockWidgets::QtWidgets::TitleBar::Private
121 :
View(controller, Core::ViewType::
TitleBar, View_qt::asQWidget(parent))
122 , Core::TitleBarViewInterface(controller)
130 , Core::TitleBarViewInterface(static_cast<Core::
TitleBar *>(controller()))
204 d->screenChangedConnection =
DockRegistry::self()->
dptr()->windowChangedScreen.connect([
this](Core::Window::Ptr w) {
209 d->focusChangedConnection =
m_titleBar->
dptr()->isFocusedChanged.connect([
this] {
257 :
tr(
"Disable auto-hide"));
282 return QRect(0, 0, 0, 0);
284 return QRect(3, 3, 30, 30);
290 int smallestX =
width();
294 if (button && button->isVisible() && button->x() < smallestX)
295 smallestX = button->x();
298 return width() - smallestX;
339#ifdef DOCKS_DEVELOPER_MODE
341bool TitleBar::isCloseButtonVisible()
const
346bool TitleBar::isCloseButtonEnabled()
const
351bool TitleBar::isFloatButtonVisible()
const
A ScopedConnection is a RAII-style way to make sure a Connection is disconnected.
void addStretch(int stretch)
void setSpacing(int spacing)
bool testAttribute(Qt::ApplicationAttribute attribute)
Qt::FocusReason reason() const const
void setPixmap(const QPixmap &)
void setContentsMargins(int left, int top, int right, int bottom)
const T & constFirst() const const
bool isEmpty() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString tr(const char *sourceText, const char *disambiguation, int n)
qreal devicePixelRatioF() const const
int logicalDpiX() const const
void fillRect(const QRectF &rectangle, const QBrush &brush)
bool isEmpty() const const
virtual void drawComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const const=0
virtual void drawControl(QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const const=0
virtual void drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const const=0
virtual int pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const const=0
void initFrom(const QWidget *widget)