drop per dock/panel inConfigureAppletsMode

--we now support a global value that can be used
in order to provide inConfigureAppletsMode for
all docks and panels at the same time.
pull/24/head
Michail Vourlakos 3 years ago
parent 9c1728cd25
commit abe7c19547

@ -46,6 +46,7 @@ UniversalSettings::UniversalSettings(KSharedConfig::Ptr config, QObject *parent)
connect(this, &UniversalSettings::badges3DStyleChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::canDisableBordersChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::inAdvancedModeForEditSettingsChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::inConfigureAppletsModeChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::isAvailableGeometryBroadcastedToPlasmaChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::launchersChanged, this, &UniversalSettings::saveConfig);
connect(this, &UniversalSettings::layoutsMemoryUsageChanged, this, &UniversalSettings::saveConfig);
@ -133,6 +134,21 @@ void UniversalSettings::setInAdvancedModeForEditSettings(const bool &inAdvanced)
emit inAdvancedModeForEditSettingsChanged();
}
bool UniversalSettings::inConfigureAppletsMode() const
{
return m_inConfigureAppletsMode;
}
void UniversalSettings::setInConfigureAppletsMode(const bool enabled)
{
if (m_inConfigureAppletsMode == enabled) {
return;
}
m_inConfigureAppletsMode = enabled;
emit inConfigureAppletsModeChanged();
}
bool UniversalSettings::isAvailableGeometryBroadcastedToPlasma() const
{
return m_isAvailableGeometryBroadcastedToPlasma;
@ -555,6 +571,7 @@ void UniversalSettings::loadConfig()
m_canDisableBorders = m_universalGroup.readEntry("canDisableBorders", false);
m_contextMenuActionsAlwaysShown = m_universalGroup.readEntry("contextMenuActionsAlwaysShown", Latte::Data::ContextMenu::ACTIONSALWAYSVISIBLE);
m_inAdvancedModeForEditSettings = m_universalGroup.readEntry("inAdvancedModeForEditSettings", false);
m_inConfigureAppletsMode = m_universalGroup.readEntry("inConfigureAppletsMode", false);
m_isAvailableGeometryBroadcastedToPlasma = m_universalGroup.readEntry("isAvailableGeometryBroadcastedToPlasma", true);
m_launchers = m_universalGroup.readEntry("launchers", QStringList());
m_metaPressAndHoldEnabled = m_universalGroup.readEntry("metaPressAndHoldEnabled", true);
@ -580,6 +597,7 @@ void UniversalSettings::saveConfig()
m_universalGroup.writeEntry("canDisableBorders", m_canDisableBorders);
m_universalGroup.writeEntry("contextMenuActionsAlwaysShown", m_contextMenuActionsAlwaysShown);
m_universalGroup.writeEntry("inAdvancedModeForEditSettings", m_inAdvancedModeForEditSettings);
m_universalGroup.writeEntry("inConfigureAppletsMode", m_inConfigureAppletsMode);
m_universalGroup.writeEntry("isAvailableGeometryBroadcastedToPlasma", m_isAvailableGeometryBroadcastedToPlasma);
m_universalGroup.writeEntry("launchers", m_launchers);
m_universalGroup.writeEntry("metaPressAndHoldEnabled", m_metaPressAndHoldEnabled);

@ -45,6 +45,7 @@ class UniversalSettings : public QObject
Q_PROPERTY(bool autostart READ autostart WRITE setAutostart NOTIFY autostartChanged)
Q_PROPERTY(bool badges3DStyle READ badges3DStyle WRITE setBadges3DStyle NOTIFY badges3DStyleChanged)
Q_PROPERTY(bool inAdvancedModeForEditSettings READ inAdvancedModeForEditSettings WRITE setInAdvancedModeForEditSettings NOTIFY inAdvancedModeForEditSettingsChanged)
Q_PROPERTY(bool inConfigureAppletsMode READ inConfigureAppletsMode WRITE setInConfigureAppletsMode NOTIFY inConfigureAppletsModeChanged)
Q_PROPERTY(bool colorsScriptIsPresent READ colorsScriptIsPresent NOTIFY colorsScriptIsPresentChanged)
Q_PROPERTY(bool showInfoWindow READ showInfoWindow WRITE setShowInfoWindow NOTIFY showInfoWindowChanged)
@ -80,6 +81,9 @@ public:
bool inAdvancedModeForEditSettings() const;
void setInAdvancedModeForEditSettings(const bool &inAdvanced);
bool inConfigureAppletsMode() const;
void setInConfigureAppletsMode(const bool enabled);
bool isAvailableGeometryBroadcastedToPlasma() const;
void setIsAvailableGeometryBroadcastedToPlasma(const bool &isBroadcasted);
@ -142,6 +146,7 @@ signals:
void colorsScriptIsPresentChanged();
void downloadWindowSizeChanged();
void inAdvancedModeForEditSettingsChanged();
void inConfigureAppletsModeChanged();
void layoutsColumnWidthsChanged();
void layoutsWindowSizeChanged();
void launchersChanged();
@ -182,6 +187,7 @@ private:
bool m_canDisableBorders{false};
bool m_colorsScriptIsPresent{false};
bool m_inAdvancedModeForEditSettings{false};
bool m_inConfigureAppletsMode{false};
bool m_isAvailableGeometryBroadcastedToPlasma{true};
bool m_metaPressAndHoldEnabled{true};
bool m_showInfoWindow{true};

@ -87,9 +87,6 @@
<default>false</default>
<label>vertical view is sticked at bottom screen edge at all cases; useful for sidepanels</label>
</entry>
<entry name="inConfigureAppletsMode" type="Bool">
<default>false</default>
</entry>
<entry name="useThemePanel" type="Bool">
<default>true</default>
</entry>

@ -174,7 +174,7 @@ Item {
readonly property bool hasUserSpecifiedBackground: (latteView && latteView.layout && latteView.layout.background.startsWith("/")) ?
true : false
readonly property bool inConfigureAppletsMode: root.editMode && plasmoid.configuration.inConfigureAppletsMode
readonly property bool inConfigureAppletsMode: root.editMode && universalSettings && universalSettings.inConfigureAppletsMode
property bool closeActiveWindowEnabled: plasmoid.configuration.closeActiveWindowEnabled
property bool dragActiveWindowEnabled: plasmoid.configuration.dragActiveWindowEnabled

@ -27,7 +27,7 @@ Loader {
property int panelAlignment: plasmoid.configuration.alignment
readonly property real appliedOpacity: imageTiler.opacity
readonly property real maxOpacity: plasmoid.configuration.inConfigureAppletsMode || !LatteCore.WindowSystem.compositingActive ?
readonly property real maxOpacity: universalSettings.inConfigureAppletsMode || !LatteCore.WindowSystem.compositingActive ?
1 : plasmoid.configuration.editBackgroundOpacity
property real offset: {
@ -92,7 +92,7 @@ Loader {
MouseArea {
id: editBackMouseArea
anchors.fill: imageTiler
visible: !plasmoid.configuration.inConfigureAppletsMode
visible: !universalSettings.inConfigureAppletsMode
hoverEnabled: true
property bool wheelIsBlocked: false;

@ -36,7 +36,7 @@ Loader {
readonly property bool basicLevel: !advancedLevel
readonly property bool advancedLevel: universalSettings.inAdvancedModeForEditSettings
readonly property bool inConfigureAppletsMode: plasmoid.configuration.inConfigureAppletsMode || !LatteCore.WindowSystem.compositingActive
readonly property bool inConfigureAppletsMode: universalSettings.inConfigureAppletsMode || !LatteCore.WindowSystem.compositingActive
readonly property bool kirigamiLibraryIsFound: LatteCore.Environment.frameworksVersion >= LatteCore.Environment.makeVersion(5,69,0)

@ -107,14 +107,14 @@ Item {
text: i18n("Rearrange and configure your widgets")
tooltip: i18n("Feel free to move around your widgets and configure them from their tooltips")
checked: plasmoid.configuration.inConfigureAppletsMode
checked: universalSettings.inConfigureAppletsMode
iconPositionReversed: plasmoid.location === PlasmaCore.Types.RightEdge
icon: SettingsControls.RearrangeIcon{}
onPressedChanged: {
if (pressed) {
plasmoid.configuration.inConfigureAppletsMode = !plasmoid.configuration.inConfigureAppletsMode;
universalSettings.inConfigureAppletsMode = !universalSettings.inConfigureAppletsMode;
}
}
}

@ -38,7 +38,7 @@ Item{
readonly property bool textColorIsDark: textColorBrightness < 127.5
readonly property color bestContrastedTextColor: {
if (imageTiler.opacity <= 0.4 && !plasmoid.configuration.inConfigureAppletsMode && themeExtended) {
if (imageTiler.opacity <= 0.4 && !universalSettings.inConfigureAppletsMode && themeExtended) {
return latteView.colorizer.currentBackgroundBrightness > 127.5 ?
themeExtended.lightTheme.textColor :
themeExtended.darkTheme.textColor;

Loading…
Cancel
Save