6#include "decorationsettings.h"
7#include "private/decorationbridge.h"
8#include "private/decorationsettingsprivate.h"
10#include <QFontMetrics>
14DecorationSettings::DecorationSettings(DecorationBridge *bridge,
QObject *parent)
16 , d(bridge->settings(this))
18 auto updateUnits = [
this] {
21 if (gridUnit % 2 != 0) {
24 if (gridUnit != d->gridUnit()) {
25 d->setGridUnit(gridUnit);
26 Q_EMIT gridUnitChanged(gridUnit);
28 if (gridUnit != d->largeSpacing()) {
29 d->setSmallSpacing(qMax(2, (
int)(gridUnit / 4)));
30 d->setLargeSpacing(gridUnit);
31 Q_EMIT spacingChanged();
35 connect(
this, &DecorationSettings::fontChanged,
this, updateUnits);
38DecorationSettings::~DecorationSettings() =
default;
40bool DecorationSettings::isOnAllDesktopsAvailable()
const
42 return d->isOnAllDesktopsAvailable();
45bool DecorationSettings::isAlphaChannelSupported()
const
47 return d->isAlphaChannelSupported();
50bool DecorationSettings::isCloseOnDoubleClickOnMenu()
const
52 return d->isCloseOnDoubleClickOnMenu();
57 return d->decorationButtonsLeft();
62 return d->decorationButtonsRight();
65BorderSize DecorationSettings::borderSize()
const
67 return d->borderSize();
70QFont DecorationSettings::font()
const
77 return d->fontMetrics();
80int DecorationSettings::gridUnit()
const
85int DecorationSettings::smallSpacing()
const
87 return d->smallSpacing();
90int DecorationSettings::largeSpacing()
const
92 return d->largeSpacing();
96#include "moc_decorationsettings.cpp"
Framework for creating window decorations.
QRect boundingRect(QChar ch) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)