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
{
return (flags() | Qt::FramelessWindowHint) & ~Qt::WindowDoesNotAcceptFocus;
return (flags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) & ~Qt::WindowDoesNotAcceptFocus;
}
QWindow *PrimaryConfigView::secondaryWindow()
@ -246,6 +246,7 @@ void PrimaryConfigView::syncGeometry()
}
updateShowInlineProperties();
m_latteView->raise();
}
void PrimaryConfigView::syncSlideEffect()

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

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

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

@ -53,7 +53,8 @@ Item{
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{
id: shadow

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

Loading…
Cancel
Save