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>
31#include <QScopedValueRollback>
61 const QList<QSize> iconSizes = opt.icon.availableSizes();
73#if defined(Q_OS_LINUX)
75 const qreal combinedFactor = logicalFactor * dpr;
77 if (scalingFactorIsSupported(combinedFactor))
79 opt.iconSize = opt.iconSize * combinedFactor;
80#elif defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
84 && scalingFactorIsSupported(logicalFactor))
86 opt.iconSize = opt.iconSize * logicalFactor;
88 Q_UNUSED(logicalFactor);
108 switch (ev->
type()) {
125class KDDockWidgets::QtWidgets::TitleBar::Private
142 :
View(controller, Core::ViewType::
TitleBar, View_qt::asQWidget(parent))
143 , Core::TitleBarViewInterface(controller)
151 , Core::TitleBarViewInterface(static_cast<Core::
TitleBar *>(controller()))
167 if (
auto kddwButton = qobject_cast<Button *>(button); !kddwButton->m_inEventHandler) {
174 button->setParent(
nullptr);
175 if (usesQTBUG83030Workaround()) {
181 button->deleteLater();
249 d->screenChangedConnection =
DockRegistry::self()->
dptr()->windowChangedScreen.connect([
this](Core::Window::Ptr w) {
254 d->focusChangedConnection =
m_titleBar->
dptr()->isFocusedChanged.connect([
this] {
302 :
tr(
"Disable auto-hide"));
327 return QRect(0, 0, 0, 0);
329 return QRect(3, 3, 30, 30);
335 int smallestX =
width();
339 if (button && button->isVisible() && button->x() < smallestX)
340 smallestX = button->x();
343 return width() - smallestX;
384#ifdef DOCKS_DEVELOPER_MODE
386bool TitleBar::isCloseButtonVisible()
const
391bool TitleBar::isCloseButtonEnabled()
const
396bool 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)
QEvent::Type type() const const
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)