1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-24 17:33:50 +03:00

update primary config window to isReady

This commit is contained in:
Michail Vourlakos 2020-07-04 15:14:56 +03:00
parent ca87504535
commit 7906c8788a
4 changed files with 26 additions and 21 deletions

View File

@ -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();
}

View File

@ -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};

View File

@ -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'};

View File

@ -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;
}
}