introduce new editAppletsMode

--in this mode all aplets can be adjusted and
repositioned properly
pull/5/head
Michail Vourlakos 6 years ago
parent 3fac7c2388
commit 71bb4ca921

@ -152,7 +152,7 @@ void PrimaryConfigView::init()
inline Qt::WindowFlags PrimaryConfigView::wFlags() const inline Qt::WindowFlags PrimaryConfigView::wFlags() const
{ {
return (flags() | Qt::FramelessWindowHint) & ~Qt::WindowDoesNotAcceptFocus; return (flags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) & ~Qt::WindowDoesNotAcceptFocus;
} }
QWindow *PrimaryConfigView::secondaryWindow() QWindow *PrimaryConfigView::secondaryWindow()
@ -246,6 +246,7 @@ void PrimaryConfigView::syncGeometry()
} }
updateShowInlineProperties(); updateShowInlineProperties();
m_latteView->raise();
} }
void PrimaryConfigView::syncSlideEffect() void PrimaryConfigView::syncSlideEffect()

@ -133,7 +133,7 @@ void SecondaryConfigView::init()
inline Qt::WindowFlags SecondaryConfigView::wFlags() const inline Qt::WindowFlags SecondaryConfigView::wFlags() const
{ {
return (flags() | Qt::FramelessWindowHint) & ~Qt::WindowDoesNotAcceptFocus; return (flags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) & ~Qt::WindowDoesNotAcceptFocus;
} }
QRect SecondaryConfigView::geometryWhenVisible() const QRect SecondaryConfigView::geometryWhenVisible() const
@ -210,6 +210,8 @@ void SecondaryConfigView::syncGeometry()
if (m_parent) { if (m_parent) {
m_parent->requestActivate(); m_parent->requestActivate();
} }
m_latteView->raise();
} }
void SecondaryConfigView::syncSlideEffect() void SecondaryConfigView::syncSlideEffect()

@ -57,6 +57,9 @@
<default>-1</default> <default>-1</default>
<label>this is a percentage value, -1 means disabled</label> <label>this is a percentage value, -1 means disabled</label>
</entry> </entry>
<entry name="inConfigureAppletsMode" type="Bool">
<default>false</default>
</entry>
<entry name="useThemePanel" type="Bool"> <entry name="useThemePanel" type="Bool">
<default>true</default> <default>true</default>
</entry> </entry>

@ -21,6 +21,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
@ -32,8 +33,10 @@ MouseArea {
anchors.fill: parent anchors.fill: parent
//enabled: false //enabled: false
visible: true//false visible: plasmoid.configuration.inConfigureAppletsMode
// hoverEnabled: true hoverEnabled: plasmoid.configuration.inConfigureAppletsMode
focus: true
cursorShape: { cursorShape: {
if (currentApplet && tooltip.visible && currentApplet.applet if (currentApplet && tooltip.visible && currentApplet.applet
@ -59,6 +62,7 @@ MouseArea {
onHeightChanged: tooltip.visible = false; onHeightChanged: tooltip.visible = false;
onWidthChanged: tooltip.visible = false; onWidthChanged: tooltip.visible = false;
onPositionChanged: { onPositionChanged: {
if (pressed) { if (pressed) {
var padding = units.gridUnit * 3; var padding = units.gridUnit * 3;
@ -142,9 +146,9 @@ MouseArea {
var relevantLayout = mapFromItem(layoutsContainer.mainLayout, 0, 0); var relevantLayout = mapFromItem(layoutsContainer.mainLayout, 0, 0);
handle.x = relevantLayout.x + currentApplet.x; handle.x = relevantLayout.x + currentApplet.x;
handle.y = relevantLayout.y + currentApplet.y + currentApplet.height / 2; handle.y = relevantLayout.y + currentApplet.y;
handle.width = currentApplet.width; handle.width = currentApplet.width;
handle.height = currentApplet.height / 2; handle.height = currentApplet.height;
lockButton.checked = currentApplet.lockZoom; lockButton.checked = currentApplet.lockZoom;
colorizingButton.checked = !currentApplet.userBlocksColorizing; colorizingButton.checked = !currentApplet.userBlocksColorizing;
@ -290,9 +294,9 @@ MouseArea {
var transformChoords = root.mapFromItem(currentApplet, 0, 0) var transformChoords = root.mapFromItem(currentApplet, 0, 0)
handle.x = transformChoords.x; handle.x = transformChoords.x;
handle.y = transformChoords.y + currentApplet.height / 2; handle.y = transformChoords.y;
handle.width = currentApplet.width; handle.width = currentApplet.width;
handle.height = currentApplet.height / 2; handle.height = currentApplet.height;
repositionHandler.restart(); repositionHandler.restart();
} }

@ -53,7 +53,8 @@ Item{
property string layoutColor: latteView && latteView.managedLayout ? latteView.managedLayout.color : "blue" property string layoutColor: latteView && latteView.managedLayout ? latteView.managedLayout.color : "blue"
readonly property real maxOpacity: Latte.WindowSystem.compositingActive ? plasmoid.configuration.editBackgroundOpacity : 1 readonly property real maxOpacity: Latte.WindowSystem.compositingActive && !plasmoid.configuration.inConfigureAppletsMode ?
plasmoid.configuration.editBackgroundOpacity : 1
Item{ Item{
id: shadow id: shadow

@ -178,6 +178,10 @@ FocusScope {
if (event.key === Qt.Key_Escape) { if (event.key === Qt.Key_Escape) {
viewConfig.hideConfigWindow(); viewConfig.hideConfigWindow();
} }
if (event.key === Qt.Key_Control) {
plasmoid.configuration.inConfigureAppletsMode = !plasmoid.configuration.inConfigureAppletsMode;
}
} }
Component.onCompleted: forceActiveFocus(); Component.onCompleted: forceActiveFocus();

Loading…
Cancel
Save