dont restore zoom when applet context menu shown

pull/1/head
Michail Vourlakos 8 years ago
parent 0b344be641
commit 262b3bd238

@ -795,6 +795,11 @@ void DockView::statusChanged(Plasma::Types::ItemStatus status)
}
}
bool DockView::contextMenuIsShown() const
{
return m_contextMenu;
}
int DockView::currentThickness() const
{
if (formFactor() == Plasma::Types::Vertical) {
@ -1402,6 +1407,7 @@ void DockView::menuAboutToHide()
{
m_contextMenu = 0;
m_visibility->setBlockHiding(false);
emit contextMenuIsShownChanged();
}
@ -1430,6 +1436,7 @@ void DockView::mousePressEvent(QMouseEvent *event)
//qDebug() << "Step 0.5 ...";
m_contextMenu->close();
m_contextMenu = 0;
emit contextMenuIsShownChanged();
PlasmaQuick::ContainmentView::mousePressEvent(event);
return;
}
@ -1614,6 +1621,7 @@ void DockView::mousePressEvent(QMouseEvent *event)
m_visibility->setBlockHiding(true);
desktopMenu->popup(pos);
event->setAccepted(true);
emit contextMenuIsShownChanged();
return;
}
@ -1624,6 +1632,7 @@ void DockView::mousePressEvent(QMouseEvent *event)
}
//qDebug() << "10 ...";
emit contextMenuIsShownChanged();
PlasmaQuick::ContainmentView::mousePressEvent(event);
}

@ -53,6 +53,7 @@ namespace Latte {
class DockView : public PlasmaQuick::ContainmentView {
Q_OBJECT
Q_PROPERTY(bool behaveAsPlasmaPanel READ behaveAsPlasmaPanel WRITE setBehaveAsPlasmaPanel NOTIFY behaveAsPlasmaPanelChanged)
Q_PROPERTY(bool contextMenuIsShown READ contextMenuIsShown NOTIFY contextMenuIsShownChanged)
Q_PROPERTY(bool dockWinBehavior READ dockWinBehavior WRITE setDockWinBehavior NOTIFY dockWinBehaviorChanged)
Q_PROPERTY(bool drawShadows READ drawShadows WRITE setDrawShadows NOTIFY drawShadowsChanged)
Q_PROPERTY(bool drawEffects READ drawEffects WRITE setDrawEffects NOTIFY drawEffectsChanged)
@ -107,6 +108,8 @@ public:
bool behaveAsPlasmaPanel() const;
void setBehaveAsPlasmaPanel(bool behavior);
bool contextMenuIsShown() const;
bool dockWinBehavior() const;
void setDockWinBehavior(bool dock);
@ -198,6 +201,7 @@ signals:
void alignmentChanged();
void behaveAsPlasmaPanelChanged();
void contextMenuIsShownChanged();
void currentScreenChanged();
void dockLocationChanged();
void docksCountChanged();

@ -1124,6 +1124,12 @@ DragDrop.DropArea {
if (root.isVertical && proportionIconSize!==-1)
updateAutomaticIconSize();
}
onContextMenuIsShownChanged: {
if (!dock.contextMenuIsShown) {
checkRestoreZoom.start();
}
}
}
Connections{
@ -1278,7 +1284,10 @@ DragDrop.DropArea {
if (latteApplet && (latteApplet.previewContainsMouse() || latteApplet.contextMenu))
return;
if (!dock.visibility.containsMouse || (rootMouseArea.containsMouse && !root.editMode)
if (dock.contextMenuIsShown)
return;
if (!dock.visibility.containsMouse || (rootMouseArea.containsMouse && !root.editMode)
|| !mouseInCanBeHoveredApplet()){
if (enableDirectRenderTimer.running)
enableDirectRenderTimer.stop();

Loading…
Cancel
Save