diff --git a/app/view/settings/primaryconfigview.cpp b/app/view/settings/primaryconfigview.cpp index 224b259d2..bf1f69340 100644 --- a/app/view/settings/primaryconfigview.cpp +++ b/app/view/settings/primaryconfigview.cpp @@ -255,7 +255,7 @@ void PrimaryConfigView::setView(Latte::View *view) void PrimaryConfigView::initView(Latte::View *view) { - setInParentViewChange(true); + setIsReady(false); for (const auto &var : viewconnections) { QObject::disconnect(var); @@ -290,7 +290,7 @@ void PrimaryConfigView::initView(Latte::View *view) show(); - setInParentViewChange(false); + setIsReady(true); if (m_secConfigView) { m_secConfigView->setView(view); @@ -648,19 +648,19 @@ void PrimaryConfigView::immutabilityChanged(Plasma::Types::ImmutabilityType type } } -bool PrimaryConfigView::inParentViewChange() const +bool PrimaryConfigView::isReady() const { - return m_inParentViewChange; + return m_isReady; } -void PrimaryConfigView::setInParentViewChange(bool inChange) +void PrimaryConfigView::setIsReady(bool ready) { - if (m_inParentViewChange == inChange) { + if (m_isReady == ready) { return; } - m_inParentViewChange = inChange; - emit inParentViewChangeChanged(); + m_isReady = ready; + emit isReadyChanged(); } diff --git a/app/view/settings/primaryconfigview.h b/app/view/settings/primaryconfigview.h index 10753477e..527a146de 100644 --- a/app/view/settings/primaryconfigview.h +++ b/app/view/settings/primaryconfigview.h @@ -69,7 +69,7 @@ class PrimaryConfigView : public QQuickView //! used when the secondary config window can not be shown Q_PROPERTY(bool showInlineProperties READ showInlineProperties NOTIFY showInlinePropertiesChanged) Q_PROPERTY(bool inAdvancedMode READ inAdvancedMode WRITE setInAdvancedMode NOTIFY inAdvancedModeChanged) - Q_PROPERTY(bool inParentViewChange READ inParentViewChange NOTIFY inParentViewChangeChanged) + Q_PROPERTY(bool isReady READ isReady NOTIFY isReadyChanged) Q_PROPERTY(QRect availableScreenGeometry READ availableScreenGeometry NOTIFY availableScreenGeometryChanged) @@ -93,7 +93,7 @@ public: bool inAdvancedMode() const; void setInAdvancedMode(bool advanced); - bool inParentViewChange() const; + bool isReady() const; bool showInlineProperties() const; bool sticker() const; @@ -120,7 +120,7 @@ signals: void availableScreenGeometryChanged(); void enabledBordersChanged(); void inAdvancedModeChanged(); - void inParentViewChangeChanged(); + void isReadyChanged(); void raiseDocksTemporaryChanged(); void showInlinePropertiesChanged(); void showSignal(); @@ -153,7 +153,7 @@ private slots: private: void setupWaylandIntegration(); - void setInParentViewChange(bool inChange); + void setIsReady(bool ready); void initView(Latte::View *view); private: @@ -161,8 +161,8 @@ private: bool m_blockFocusLostOnStartup{true}; bool m_originalByPassWM{false}; bool m_inAdvancedMode{false}; - bool m_inParentViewChange{false}; bool m_inReverse{false}; //! it is used by the borders + bool m_isReady{false}; bool m_showInlineProperties{false}; Latte::Types::Visibility m_originalMode{Latte::Types::DodgeActive}; diff --git a/shell/package/contents/configuration/LatteDockConfiguration.qml b/shell/package/contents/configuration/LatteDockConfiguration.qml index a1902523d..03e43981d 100644 --- a/shell/package/contents/configuration/LatteDockConfiguration.qml +++ b/shell/package/contents/configuration/LatteDockConfiguration.qml @@ -548,9 +548,7 @@ FocusScope { Connections{ target: actionsComboBtn.comboBox - Component.onCompleted:{ - actionsComboBtn.addModel(); - } + Component.onCompleted:actionsComboBtn.updateModel(); onActivated: { if (index==0) { @@ -566,7 +564,7 @@ FocusScope { onEnabledChanged: { if (enabled) { - actionsComboBtn.addModel(); + actionsComboBtn.updateModel(); } else { actionsComboBtn.emptyModel(); } @@ -584,7 +582,16 @@ FocusScope { onTypeChanged: actionsComboBtn.updateCopyText() } - function addModel() { + Connections{ + target: viewConfig + onIsReadyChanged: { + if (viewConfig.isReady) { + actionsComboBtn.updateModel(); + } + } + } + + function updateModel() { actionsModel.clear(); var copy = {actionId: 'copy:', enabled: true, name: '', icon: 'edit-copy'}; diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml index 0b4754a7c..8b2561c44 100644 --- a/shell/package/contents/configuration/pages/BehaviorConfig.qml +++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml @@ -197,13 +197,11 @@ PlasmaComponents.Page { ExclusiveGroup { id: locationGroup - property bool inStartup: true onCurrentChanged: { - if (current.checked && !inStartup && !viewConfig.inParentViewChange) { + if (current.checked && viewConfig.isReady) { latteView.positioner.hideDockDuringLocationChange(current.edge); } - inStartup = false; } }