clean up code #79

v0.6
audoban 8 years ago
parent 8b28fb72fa
commit 9450a884c3

@ -58,7 +58,6 @@ DockCorona::DockCorona(QObject *parent)
qmlRegisterTypes(); qmlRegisterTypes();
connect(this, &Corona::containmentAdded, this, &DockCorona::addDock); connect(this, &Corona::containmentAdded, this, &DockCorona::addDock);
connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load); connect(m_activityConsumer, &KActivities::Consumer::serviceStatusChanged, this, &DockCorona::load);
} }
@ -145,9 +144,9 @@ int DockCorona::docksCount(int screen) const
{ {
if (screen == -1) if (screen == -1)
return 0; return 0;
int docks{0}; int docks{0};
for (const auto &view : m_dockViews) { for (const auto &view : m_dockViews) {
if (view && view->containment() if (view && view->containment()
&& view->containment()->screen() == screen && view->containment()->screen() == screen
@ -155,9 +154,9 @@ int DockCorona::docksCount(int screen) const
++docks; ++docks;
} }
} }
qDebug() << docks << "docks on screen:" << screen; qDebug() << docks << "docks on screen:" << screen;
return docks; return docks;
} }
@ -171,11 +170,11 @@ QList<Plasma::Types::Location> DockCorona::freeEdges(int screen) const
using Plasma::Types; using Plasma::Types;
QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge, QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge,
Types::TopEdge, Types::RightEdge}; Types::TopEdge, Types::RightEdge};
//when screen=-1 is passed then the primaryScreenid is used //when screen=-1 is passed then the primaryScreenid is used
int fixedScreen = (screen == -1) ? primaryScreenId() : screen; int fixedScreen = (screen == -1) ? primaryScreenId() : screen;
for (const auto &view : m_dockViews) { for (auto *view : m_dockViews) {
if (view && view->containment() if (view && view->containment()
&& view->containment()->screen() == fixedScreen) { && view->containment()->screen() == fixedScreen) {
edges.removeOne(view->location()); edges.removeOne(view->location());
@ -203,18 +202,16 @@ void DockCorona::addDock(Plasma::Containment *containment)
return; return;
} }
auto metadata = containment->kPackage().metadata();
// the system tray is a containment that behaves as an applet // the system tray is a containment that behaves as an applet
// so a dockview shouldnt be created for it // so a dockview shouldnt be created for it
KPluginMetaData metadata = containment->kPackage().metadata(); if (metadata.pluginId() != "org.kde.latte.containment")
if (metadata.pluginId() == "org.kde.plasma.private.systemtray") {
return; return;
}
for (auto *dock : m_dockViews) {
foreach (DockView *dock, m_dockViews) { if (dock->containment() == containment)
if (dock->containment() == containment) {
return; return;
}
} }
qDebug() << "Adding dock for container..."; qDebug() << "Adding dock for container...";
@ -229,32 +226,35 @@ void DockCorona::addDock(Plasma::Containment *containment)
m_dockViews[containment] = dockView; m_dockViews[containment] = dockView;
emit containmentsNoChanged(); emit docksCountChanged();
} }
void DockCorona::destroyedChanged(bool destroyed) void DockCorona::destroyedChanged(bool destroyed)
{ {
Plasma::Containment *sender = qobject_cast<Plasma::Containment *>(QObject::sender()); Plasma::Containment *sender = qobject_cast<Plasma::Containment *>(QObject::sender());
if (!sender) { if (!sender) {
return; return;
} }
if (destroyed) { if (destroyed) {
m_waitingDockViews[sender] = m_dockViews.take(static_cast<Plasma::Containment *>(sender)); m_waitingDockViews[sender] = m_dockViews.take(static_cast<Plasma::Containment *>(sender));
} else { } else {
m_dockViews[sender] = m_waitingDockViews.take(static_cast<Plasma::Containment *>(sender)); m_dockViews[sender] = m_waitingDockViews.take(static_cast<Plasma::Containment *>(sender));
} }
emit containmentsNoChanged(); emit docksCountChanged();
} }
void DockCorona::dockContainmentDestroyed(QObject *cont) void DockCorona::dockContainmentDestroyed(QObject *cont)
{ {
auto view = m_waitingDockViews.take(static_cast<Plasma::Containment *>(cont)); auto view = m_waitingDockViews.take(static_cast<Plasma::Containment *>(cont));
delete view;
if (view)
view->destroy();
//view->deleteLater(); //view->deleteLater();
emit containmentsNoChanged(); emit docksCountChanged();
} }
void DockCorona::loadDefaultLayout() void DockCorona::loadDefaultLayout()
@ -300,13 +300,6 @@ void DockCorona::loadDefaultLayout()
inline void DockCorona::qmlRegisterTypes() const inline void DockCorona::qmlRegisterTypes() const
{ {
constexpr auto uri = "org.kde.latte.shell";
constexpr auto vMajor = 0;
constexpr auto vMinor = 2;
// qmlRegisterUncreatableType<Candil::Dock>(uri, vMajor, vMinor, "Dock", "class Dock uncreatable");
// qmlRegisterUncreatableType<Candil::VisibilityManager>(uri, vMajor, vMinor, "VisibilityManager", "class VisibilityManager uncreatable");
// qmlRegisterUncreatableType<NowDockView>(uri, vMajor, vMinor, "DockView", "class DockView uncreatable");
qmlRegisterType<QScreen>(); qmlRegisterType<QScreen>();
} }

@ -53,7 +53,7 @@ public:
int docksCount(int screen) const; int docksCount(int screen) const;
int screenForContainment(const Plasma::Containment *containment) const override; int screenForContainment(const Plasma::Containment *containment) const override;
void addDock(Plasma::Containment *containment); void addDock(Plasma::Containment *containment);
void closeApplication(); void closeApplication();
@ -64,7 +64,7 @@ public slots:
signals: signals:
void configurationShown(PlasmaQuick::ConfigView *configView); void configurationShown(PlasmaQuick::ConfigView *configView);
void containmentsNoChanged(); void docksCountChanged();
private slots: private slots:
void destroyedChanged(bool destroyed); void destroyedChanged(bool destroyed);

@ -46,7 +46,6 @@ namespace Latte {
DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen) DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen)
: PlasmaQuick::ContainmentView(corona), : PlasmaQuick::ContainmentView(corona),
m_docksCount(0),
m_contextMenu(nullptr) m_contextMenu(nullptr)
{ {
setVisible(false); setVisible(false);
@ -60,12 +59,12 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen)
adaptToScreen(targetScreen); adaptToScreen(targetScreen);
else else
adaptToScreen(qGuiApp->primaryScreen()); adaptToScreen(qGuiApp->primaryScreen());
connect(this, &DockView::containmentChanged connect(this, &DockView::containmentChanged
, this, [&]() { , this, [&]() {
if (!containment()) if (!containment())
return; return;
if (!m_visibility) { if (!m_visibility) {
m_visibility = new VisibilityManager(this); m_visibility = new VisibilityManager(this);
} }
@ -83,15 +82,15 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen)
QAction *addWidgetsAction = containment()->actions()->action("add widgets"); QAction *addWidgetsAction = containment()->actions()->action("add widgets");
addWidgetsAction->setVisible(false); addWidgetsAction->setVisible(false);
//containment()->actions()->removeAction(addWidgetsAction); //containment()->actions()->removeAction(addWidgetsAction);
connect(containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus))); connect(containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus)));
}, Qt::DirectConnection); }, Qt::DirectConnection);
DockCorona *dcorona = qobject_cast<DockCorona *>(this->corona()); auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
if (dcorona) { if (dockCorona) {
connections << connect(dcorona, &DockCorona::containmentsNoChanged, this, &DockView::updateDocksCount); connect(dockCorona, &DockCorona::docksCountChanged, this, &DockView::docksCountChanged);
} }
} }
@ -130,7 +129,6 @@ void DockView::init()
setVisible(true); setVisible(true);
updateDocksCount();
syncGeometry(); syncGeometry();
qDebug() << "SOURCE:" << source(); qDebug() << "SOURCE:" << source();
} }
@ -143,27 +141,27 @@ void DockView::adaptToScreen(QScreen *screen)
m_maxLength = screen->size().height(); m_maxLength = screen->size().height();
else else
m_maxLength = screen->size().width(); m_maxLength = screen->size().width();
if (containment()) if (containment())
containment()->reactToScreenChange(); containment()->reactToScreenChange();
syncGeometry(); syncGeometry();
} }
void DockView::addNewDock() void DockView::addNewDock()
{ {
DockCorona *corona = qobject_cast<DockCorona *>(this->corona()); auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
if (corona) { if (dockCorona) {
corona->loadDefaultLayout(); dockCorona->loadDefaultLayout();
} }
} }
void DockView::removeDock() void DockView::removeDock()
{ {
if (m_docksCount > 1) { if (docksCount() > 1) {
QAction *removeAct = containment()->actions()->action(QStringLiteral("remove")); QAction *removeAct = containment()->actions()->action(QStringLiteral("remove"));
if (removeAct) { if (removeAct) {
removeAct->trigger(); removeAct->trigger();
} }
@ -191,7 +189,7 @@ void DockView::showConfigurationInterface(Plasma::Applet *applet)
{ {
if (!applet || !applet->containment()) if (!applet || !applet->containment())
return; return;
Plasma::Containment *c = qobject_cast<Plasma::Containment *>(applet); Plasma::Containment *c = qobject_cast<Plasma::Containment *>(applet);
if (m_configView && c && c->isContainment() && c == containment()) { if (m_configView && c && c->isContainment() && c == containment()) {
@ -199,7 +197,6 @@ void DockView::showConfigurationInterface(Plasma::Applet *applet)
m_configView->hide(); m_configView->hide();
} else { } else {
m_configView->show(); m_configView->show();
//m_configView->requestActivate();
} }
return; return;
@ -267,7 +264,7 @@ void DockView::updateAbsDockGeometry()
{ {
if (!m_visibility) if (!m_visibility)
return; return;
QRect absoluteGeometry {x() + m_localDockGeometry.x(), y() + m_localDockGeometry.y(), m_localDockGeometry.width(), m_localDockGeometry.height()}; QRect absoluteGeometry {x() + m_localDockGeometry.x(), y() + m_localDockGeometry.y(), m_localDockGeometry.width(), m_localDockGeometry.height()};
m_visibility->updateDockGeometry(absoluteGeometry); m_visibility->updateDockGeometry(absoluteGeometry);
} }
@ -276,34 +273,33 @@ void DockView::updatePosition()
{ {
if (!containment()) if (!containment())
return; return;
const QRect screenGeometry = screen()->geometry(); const QRect screenGeometry = screen()->geometry();
QPoint position; QPoint position;
position = {0, 0}; position = {0, 0};
m_maxLength = screenGeometry.width();
switch (location()) { switch (location()) {
case Plasma::Types::TopEdge: case Plasma::Types::TopEdge:
position = {screenGeometry.x(), screenGeometry.y()}; position = {screenGeometry.x(), screenGeometry.y()};
m_maxLength = screenGeometry.width(); m_maxLength = screenGeometry.width();
break; break;
case Plasma::Types::BottomEdge: case Plasma::Types::BottomEdge:
position = {screenGeometry.x(), screenGeometry.y() + screenGeometry.height() - height()}; position = {screenGeometry.x(), screenGeometry.y() + screenGeometry.height() - height()};
m_maxLength = screenGeometry.width(); m_maxLength = screenGeometry.width();
break; break;
case Plasma::Types::RightEdge: case Plasma::Types::RightEdge:
position = {screenGeometry.x() + screenGeometry.width() - width(), screenGeometry.y()}; position = {screenGeometry.x() + screenGeometry.width() - width(), screenGeometry.y()};
m_maxLength = screenGeometry.height(); m_maxLength = screenGeometry.height();
break; break;
case Plasma::Types::LeftEdge: case Plasma::Types::LeftEdge:
position = {screenGeometry.x(), screenGeometry.y()}; position = {screenGeometry.x(), screenGeometry.y()};
m_maxLength = screenGeometry.height(); m_maxLength = screenGeometry.height();
break; break;
default: default:
qWarning() << "wrong location, couldn't update the panel position" qWarning() << "wrong location, couldn't update the panel position"
<< location(); << location();
@ -330,13 +326,8 @@ void DockView::statusChanged(Plasma::Types::ItemStatus status)
} else { } else {
m_visibility->setBlockHiding(false); m_visibility->setBlockHiding(false);
} }
/*} else if (status == Plasma::Types::AcceptingInputStatus) {
KWindowSystem::forceActiveWindow(winId());*/
} }
int DockView::currentThickness() const int DockView::currentThickness() const
{ {
if (formFactor() == Plasma::Types::Vertical) { if (formFactor() == Plasma::Types::Vertical) {
@ -349,48 +340,29 @@ int DockView::currentThickness() const
int DockView::docksCount() const int DockView::docksCount() const
{ {
auto dockCorona = qobject_cast<DockCorona *>(corona()); auto dockCorona = qobject_cast<DockCorona *>(corona());
if (!dockCorona || !containment()) if (!dockCorona || !containment())
return 0; return 0;
return dockCorona->docksCount(containment()->screen()); return dockCorona->docksCount(containment()->screen());
} }
void DockView::updateDocksCount()
{
auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
if (!dockCorona || !containment()) {
return ;
}
int count = dockCorona->docksCount(containment()->screen());
if (count == m_docksCount) {
return;
}
m_docksCount = count;
emit docksCountChanged();
}
void DockView::updateFormFactor() void DockView::updateFormFactor()
{ {
if (!containment()) if (!containment())
return; return;
switch (location()) { switch (location()) {
case Plasma::Types::TopEdge: case Plasma::Types::TopEdge:
case Plasma::Types::BottomEdge: case Plasma::Types::BottomEdge:
containment()->setFormFactor(Plasma::Types::Horizontal); containment()->setFormFactor(Plasma::Types::Horizontal);
break; break;
case Plasma::Types::LeftEdge: case Plasma::Types::LeftEdge:
case Plasma::Types::RightEdge: case Plasma::Types::RightEdge:
containment()->setFormFactor(Plasma::Types::Vertical); containment()->setFormFactor(Plasma::Types::Vertical);
break; break;
default: default:
qWarning() << "wrong location, couldn't update the panel position" << location(); qWarning() << "wrong location, couldn't update the panel position" << location();
} }
@ -405,31 +377,12 @@ void DockView::setMaxThickness(int thickness)
{ {
if (m_maxThickness == thickness) if (m_maxThickness == thickness)
return; return;
m_maxThickness = thickness; m_maxThickness = thickness;
syncGeometry(); syncGeometry();
emit maxThicknessChanged(); emit maxThicknessChanged();
} }
int DockView::length() const
{
return m_length;
}
void DockView::setLength(int length)
{
if (m_length == length)
return;
if (length > m_maxLength)
m_length = m_maxLength;
else
m_length = length;
syncGeometry();
emit lengthChanged();
}
int DockView::maxLength() const int DockView::maxLength() const
{ {
return m_maxLength; return m_maxLength;
@ -439,12 +392,11 @@ void DockView::setMaxLength(int maxLength)
{ {
if (m_maxLength == maxLength) if (m_maxLength == maxLength)
return; return;
m_maxLength = maxLength; m_maxLength = maxLength;
emit maxLengthChanged(); emit maxLengthChanged();
} }
QRect DockView::maskArea() const QRect DockView::maskArea() const
{ {
return m_maskArea; return m_maskArea;
@ -454,9 +406,8 @@ void DockView::setMaskArea(QRect area)
{ {
if (m_maskArea == area) if (m_maskArea == area)
return; return;
m_maskArea = area; m_maskArea = area;
setMask(m_maskArea); setMask(m_maskArea);
//qDebug() << "dock mask set:" << m_maskArea; //qDebug() << "dock mask set:" << m_maskArea;
@ -470,12 +421,10 @@ int DockView::shadow() const
void DockView::setShadow(int shadow) void DockView::setShadow(int shadow)
{ {
if (m_shadow == shadow) { if (m_shadow == shadow)
return; return;
}
m_shadow = shadow; m_shadow = shadow;
emit shadowChanged(); emit shadowChanged();
} }
@ -484,9 +433,8 @@ bool DockView::tasksPresent()
foreach (Plasma::Applet *applet, containment()->applets()) { foreach (Plasma::Applet *applet, containment()->applets()) {
KPluginMetaData meta = applet->kPackage().metadata(); KPluginMetaData meta = applet->kPackage().metadata();
if (meta.pluginId() == "org.kde.latte.plasmoid") { if (meta.pluginId() == "org.kde.latte.plasmoid")
return true; return true;
}
} }
return false; return false;
@ -506,7 +454,7 @@ bool DockView::event(QEvent *e)
QList<int> DockView::freeEdges() const QList<int> DockView::freeEdges() const
{ {
QList<Plasma::Types::Location> edges = corona()->freeEdges(containment()->screen()); const auto edges = corona()->freeEdges(containment()->screen());
QList<int> edgesInt; QList<int> edgesInt;
@ -519,14 +467,14 @@ QList<int> DockView::freeEdges() const
void DockView::closeApplication() void DockView::closeApplication()
{ {
DockCorona *corona = qobject_cast<DockCorona *>(this->corona()); DockCorona *dockCorona = qobject_cast<DockCorona *>(this->corona());
if (corona) { if (dockCorona) {
//m_configView->hide(); //m_configView->hide();
if (m_configView) if (m_configView)
m_configView->deleteLater(); m_configView->deleteLater();
corona->closeApplication(); dockCorona->closeApplication();
} }
} }

@ -44,118 +44,107 @@ namespace Latte {
class DockView : public PlasmaQuick::ContainmentView { class DockView : public PlasmaQuick::ContainmentView {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int docksCount READ docksCount NOTIFY docksCountChanged) Q_PROPERTY(int docksCount READ docksCount NOTIFY docksCountChanged)
Q_PROPERTY(int width READ width NOTIFY widthChanged) Q_PROPERTY(int width READ width NOTIFY widthChanged)
Q_PROPERTY(int height READ height NOTIFY heightChanged) Q_PROPERTY(int height READ height NOTIFY heightChanged)
Q_PROPERTY(int length READ length WRITE setLength NOTIFY lengthChanged)
Q_PROPERTY(int maxLength READ maxLength WRITE setMaxLength NOTIFY maxLengthChanged) Q_PROPERTY(int maxLength READ maxLength WRITE setMaxLength NOTIFY maxLengthChanged)
Q_PROPERTY(int maxThickness READ maxThickness WRITE setMaxThickness NOTIFY maxThicknessChanged) Q_PROPERTY(int maxThickness READ maxThickness WRITE setMaxThickness NOTIFY maxThicknessChanged)
Q_PROPERTY(int shadow READ shadow WRITE setShadow NOTIFY shadowChanged) Q_PROPERTY(int shadow READ shadow WRITE setShadow NOTIFY shadowChanged)
Q_PROPERTY(QRect maskArea READ maskArea WRITE setMaskArea NOTIFY maskAreaChanged) Q_PROPERTY(QRect maskArea READ maskArea WRITE setMaskArea NOTIFY maskAreaChanged)
Q_PROPERTY(VisibilityManager *visibility READ visibility NOTIFY visibilityChanged) Q_PROPERTY(VisibilityManager *visibility READ visibility NOTIFY visibilityChanged)
Q_PROPERTY(QQmlListProperty<QScreen> screens READ screens) Q_PROPERTY(QQmlListProperty<QScreen> screens READ screens)
public: public:
DockView(Plasma::Corona *corona, QScreen *targetScreen = nullptr); DockView(Plasma::Corona *corona, QScreen *targetScreen = nullptr);
virtual ~DockView(); virtual ~DockView();
void init(); void init();
void adaptToScreen(QScreen *screen); void adaptToScreen(QScreen *screen);
void resizeWindow(); void resizeWindow();
void syncGeometry(); void syncGeometry();
int currentThickness() const; int currentThickness() const;
void updateAbsDockGeometry(); void updateAbsDockGeometry();
int docksCount() const; int docksCount() const;
int length() const;
void setLength(int length);
int maxLength() const; int maxLength() const;
void setMaxLength(int maxLength); void setMaxLength(int maxLength);
int maxThickness() const; int maxThickness() const;
void setMaxThickness(int thickness); void setMaxThickness(int thickness);
int shadow() const; int shadow() const;
void setShadow(int shadow); void setShadow(int shadow);
QRect maskArea() const; QRect maskArea() const;
void setMaskArea(QRect area); void setMaskArea(QRect area);
VisibilityManager *visibility(); VisibilityManager *visibility();
QQmlListProperty<QScreen> screens(); QQmlListProperty<QScreen> screens();
static int countScreens(QQmlListProperty<QScreen> *property); static int countScreens(QQmlListProperty<QScreen> *property);
static QScreen *atScreens(QQmlListProperty<QScreen> *property, int index); static QScreen *atScreens(QQmlListProperty<QScreen> *property, int index);
public slots: public slots:
Q_INVOKABLE void addAppletItem(QObject *item); Q_INVOKABLE void addAppletItem(QObject *item);
Q_INVOKABLE void removeAppletItem(QObject *item); Q_INVOKABLE void removeAppletItem(QObject *item);
Q_INVOKABLE void addNewDock(); Q_INVOKABLE void addNewDock();
Q_INVOKABLE void removeDock(); Q_INVOKABLE void removeDock();
Q_INVOKABLE QList<int> freeEdges() const; Q_INVOKABLE QList<int> freeEdges() const;
Q_INVOKABLE QVariantList containmentActions(); Q_INVOKABLE QVariantList containmentActions();
Q_INVOKABLE void setLocalDockGeometry(const QRect &geometry); Q_INVOKABLE void setLocalDockGeometry(const QRect &geometry);
Q_INVOKABLE bool tasksPresent(); Q_INVOKABLE bool tasksPresent();
Q_INVOKABLE void closeApplication(); Q_INVOKABLE void closeApplication();
protected slots: protected slots:
void showConfigurationInterface(Plasma::Applet *applet) override; void showConfigurationInterface(Plasma::Applet *applet) override;
protected: protected:
bool event(QEvent *ev) override; bool event(QEvent *ev) override;
void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override;
signals: signals:
void addInternalViewSplitter(); void addInternalViewSplitter();
void removeInternalViewSplitter(); void removeInternalViewSplitter();
void eventTriggered(QEvent *ev); void eventTriggered(QEvent *ev);
void docksCountChanged(); void docksCountChanged();
void widthChanged(); void widthChanged();
void heightChanged(); void heightChanged();
void lengthChanged();
void maxLengthChanged(); void maxLengthChanged();
void maxThicknessChanged(); void maxThicknessChanged();
void visibilityChanged(); void visibilityChanged();
void maskAreaChanged(); void maskAreaChanged();
void shadowChanged(); void shadowChanged();
void localDockGeometryChanged(); void localDockGeometryChanged();
private slots: private slots:
void menuAboutToHide(); void menuAboutToHide();
void statusChanged(Plasma::Types::ItemStatus); void statusChanged(Plasma::Types::ItemStatus);
private: private:
void initWindow(); void initWindow();
void addAppletActions(QMenu *desktopMenu, Plasma::Applet *applet, QEvent *event); void addAppletActions(QMenu *desktopMenu, Plasma::Applet *applet, QEvent *event);
void addContainmentActions(QMenu *desktopMenu, QEvent *event); void addContainmentActions(QMenu *desktopMenu, QEvent *event);
void updatePosition(); void updatePosition();
void updateDocksCount();
void updateFormFactor(); void updateFormFactor();
private: private:
bool m_secondInitPass;
int m_docksCount;
int m_length{0};
int m_maxLength{INT_MAX}; int m_maxLength{INT_MAX};
int m_maxThickness{24}; int m_maxThickness{24};
int m_shadow{0}; int m_shadow{0};
QRect m_localDockGeometry; QRect m_localDockGeometry;
QRect m_maskArea; QRect m_maskArea;
QMenu *m_contextMenu; QMenu *m_contextMenu;

@ -90,15 +90,15 @@ inline void VisibilityManagerPrivate::setMode(Dock::Visibility mode)
case Dock::AlwaysVisible: { case Dock::AlwaysVisible: {
if (view->containment() && !view->containment()->isUserConfiguring()) if (view->containment() && !view->containment()->isUserConfiguring())
wm->setDockStruts(dockRect, view->location()); wm->setDockStruts(dockRect, view->location());
connections[0] = connect(view->containment(), &Plasma::Containment::locationChanged connections[0] = connect(view->containment(), &Plasma::Containment::locationChanged
, this, [&]() { , this, [&]() {
if (view->containment()->isUserConfiguring()) if (view->containment()->isUserConfiguring())
wm->removeDockStruts(); wm->removeDockStruts();
}); });
connections[1] = connect(view->containment(), &Plasma::Containment::userConfiguringChanged connections[1] = connect(view->containment(), &Plasma::Containment::userConfiguringChanged
, this, [&](bool configuring) { , this, [&](bool configuring) {
if (!configuring) if (!configuring)
wm->setDockStruts(dockRect, view->containment()->location()); wm->setDockStruts(dockRect, view->containment()->location());
}); });

@ -90,25 +90,8 @@ PlasmaCore.FrameSvgItem {
} }
} }
Binding {
target: dock
property: "length"
when: containment
value: {
if (!containment) {
return;
}
if (verticalPanel) {
return containment.Layout.preferredHeight
} else {
return containment.Layout.preferredWidth
}
}
}
Item { Item {
id: containmentParent id: containmentParent
anchors.fill: parent anchors.fill: parent
} }
} }

Loading…
Cancel
Save