mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-10 20:58:18 +03:00
containment:enable startUp flag from layout manager
This commit is contained in:
parent
031aca3aca
commit
518445027d
containment
@ -81,7 +81,7 @@ Item{
|
||||
target: latteView
|
||||
property:"maxThickness"
|
||||
//! prevents updating window geometry during closing window in wayland and such fixes a crash
|
||||
when: latteView && !inRelocationHiding && !inClientSideScreenEdgeSliding && !inStartup
|
||||
when: latteView && !inRelocationHiding && !inClientSideScreenEdgeSliding //&& !inStartup
|
||||
value: root.behaveAsPlasmaPanel ? thicknessAsPanel : metrics.mask.thickness.maxZoomed
|
||||
}
|
||||
|
||||
@ -256,7 +256,7 @@ Item{
|
||||
Binding{
|
||||
target: latteView && latteView.effects ? latteView.effects : null
|
||||
property: "drawEffects"
|
||||
when: latteView && latteView.effects
|
||||
when: latteView && latteView.effects && !root.inStartup
|
||||
value: LatteCore.WindowSystem.compositingActive
|
||||
&& (((root.blurEnabled && root.useThemePanel)
|
||||
|| (root.blurEnabled && root.forceSolidPanel && LatteCore.WindowSystem.compositingActive))
|
||||
@ -570,11 +570,6 @@ Item{
|
||||
return;
|
||||
}
|
||||
|
||||
//! prevent sliding-in on startup if the dodge modes have sent a hide signal
|
||||
if (inStartupTimer.running && root.inStartup) {
|
||||
root.inStartup = false;
|
||||
}
|
||||
|
||||
//! Normal Dodge/AutoHide case
|
||||
if (!slidingAnimationAutoHiddenOut.running
|
||||
&& !latteView.visibility.blockHiding
|
||||
@ -853,7 +848,8 @@ Item{
|
||||
|
||||
ScriptAction{
|
||||
script: {
|
||||
root.inStartup = false;
|
||||
// deprecated
|
||||
// root.inStartup = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,8 @@ Item {
|
||||
property bool dragActiveWindowEnabled: plasmoid.configuration.dragActiveWindowEnabled
|
||||
property bool immutable: plasmoid.immutable
|
||||
property bool inFullJustify: (plasmoid.configuration.alignment === LatteCore.Types.Justify) && (maxLengthPerCentage===100)
|
||||
property bool inStartup: true
|
||||
property bool inStartup: !fastLayoutManager.hasRestoredApplets
|
||||
|
||||
property bool isHorizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal
|
||||
property bool isVertical: !isHorizontal
|
||||
|
||||
@ -543,8 +544,6 @@ Item {
|
||||
fastLayoutManager.restore();
|
||||
plasmoid.action("configure").visible = !plasmoid.immutable;
|
||||
plasmoid.action("configure").enabled = !plasmoid.immutable;
|
||||
|
||||
inStartupTimer.start();
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
@ -1064,14 +1063,9 @@ Item {
|
||||
///////////////BEGIN TIMER elements
|
||||
|
||||
//! It is used in order to slide-in the latteView on startup
|
||||
Timer{
|
||||
id: inStartupTimer
|
||||
interval: 1500
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
if (inStartup) {
|
||||
visibilityManager.slotMustBeShown();
|
||||
}
|
||||
onInStartupChanged: {
|
||||
if (!inStartup) {
|
||||
visibilityManager.slotMustBeShown();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,18 @@ LayoutManager::LayoutManager(QObject *parent)
|
||||
m_option["userBlocksColorizing"] = "userBlocksColorizingApplets";
|
||||
|
||||
connect(this, &LayoutManager::rootItemChanged, this, &LayoutManager::onRootItemChanged);
|
||||
|
||||
m_hasRestoredAppletsTimer.setInterval(2000);
|
||||
m_hasRestoredAppletsTimer.setSingleShot(true);
|
||||
connect(&m_hasRestoredAppletsTimer, &QTimer::timeout, this, [&]() {
|
||||
m_hasRestoredApplets = true;
|
||||
emit hasRestoredAppletsChanged();
|
||||
});
|
||||
}
|
||||
|
||||
bool LayoutManager::hasRestoredApplets() const
|
||||
{
|
||||
return m_hasRestoredApplets;
|
||||
}
|
||||
|
||||
int LayoutManager::splitterPosition() const
|
||||
@ -397,6 +409,8 @@ void LayoutManager::restore()
|
||||
|
||||
restoreOptions();
|
||||
save();
|
||||
|
||||
m_hasRestoredAppletsTimer.start();
|
||||
}
|
||||
|
||||
void LayoutManager::restoreOptions()
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <QObject>
|
||||
#include <QQmlPropertyMap>
|
||||
#include <QQuickItem>
|
||||
#include <QTimer>
|
||||
|
||||
namespace KDeclarative {
|
||||
class ConfigPropertyMap;
|
||||
@ -48,6 +49,8 @@ class LayoutManager : public QObject
|
||||
Q_PROPERTY(QQuickItem *dndSpacerItem READ dndSpacer WRITE setDndSpacer NOTIFY dndSpacerChanged)
|
||||
Q_PROPERTY(QQuickItem *metrics READ metrics WRITE setMetrics NOTIFY metricsChanged)
|
||||
|
||||
Q_PROPERTY(bool hasRestoredApplets READ hasRestoredApplets NOTIFY hasRestoredAppletsChanged)
|
||||
|
||||
//! this is the only way I have found to write their values properly in the configuration file in Multiple mode
|
||||
//! if they are not used from qml side in the form of plasmoid.configuration..... then
|
||||
//! appletsOrder is not stored when needed and applets additions/removals are not valid on next startup
|
||||
@ -60,6 +63,8 @@ class LayoutManager : public QObject
|
||||
public:
|
||||
LayoutManager(QObject *parent = nullptr);
|
||||
|
||||
bool hasRestoredApplets() const;
|
||||
|
||||
int splitterPosition() const;
|
||||
int splitterPosition2() const;
|
||||
QString appletOrder() const;
|
||||
@ -104,6 +109,7 @@ public slots:
|
||||
|
||||
signals:
|
||||
void appletOrderChanged();
|
||||
void hasRestoredAppletsChanged();
|
||||
void plasmoidChanged();
|
||||
void rootItemChanged();
|
||||
void dndSpacerChanged();
|
||||
@ -166,6 +172,9 @@ private:
|
||||
QMetaMethod m_createAppletItemMethod;
|
||||
QMetaMethod m_createJustifySplitterMethod;
|
||||
|
||||
bool m_hasRestoredApplets{false};
|
||||
QTimer m_hasRestoredAppletsTimer;
|
||||
|
||||
//! first QString is the option in AppletItem
|
||||
//! second QString is how the option is stored in
|
||||
QHash<QString, QString> m_option;
|
||||
|
Loading…
x
Reference in New Issue
Block a user