aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/libLumina/ResizeMenu.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-11-27 09:55:06 +0000
committerWeblate <noreply@weblate.org>2017-11-27 09:55:06 +0000
commit152a57c8c2844d63f95803128b216c8ab722e6e2 (patch)
tree0ce13eccbf6ef36df43d4c558657c9699f757d20 /src-qt5/core/libLumina/ResizeMenu.cpp
parentTranslated using Weblate (Spanish) (diff)
parentremove file manager dev folder (diff)
downloadlumina-152a57c8c2844d63f95803128b216c8ab722e6e2.tar.gz
lumina-152a57c8c2844d63f95803128b216c8ab722e6e2.tar.bz2
lumina-152a57c8c2844d63f95803128b216c8ab722e6e2.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/libLumina/ResizeMenu.cpp')
-rw-r--r--src-qt5/core/libLumina/ResizeMenu.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src-qt5/core/libLumina/ResizeMenu.cpp b/src-qt5/core/libLumina/ResizeMenu.cpp
index 9f291134..cf5b124d 100644
--- a/src-qt5/core/libLumina/ResizeMenu.cpp
+++ b/src-qt5/core/libLumina/ResizeMenu.cpp
@@ -5,6 +5,7 @@
// See the LICENSE file for full details
//===========================================
#include "ResizeMenu.h"
+#include <QDebug>
// =======================
// RESIZEMENU CLASS
@@ -21,7 +22,7 @@ ResizeMenu::ResizeMenu(QWidget *parent) : QMenu(parent){
}
ResizeMenu::~ResizeMenu(){
-
+
}
void ResizeMenu::setContents(QWidget *con){
@@ -30,6 +31,15 @@ void ResizeMenu::setContents(QWidget *con){
this->addAction(cAct);
contents = con; //save for later
contents->setCursor(Qt::ArrowCursor);
+ resyncSize();
+}
+
+void ResizeMenu::resyncSize(){
+ if(contents==0){ return; }
+ qDebug() << "Resync Size:" << this->size() << contents->size();
+ this->resize(contents->size());
+ qDebug() << " - after menu resize:" << this->size() << contents->size();
+ emit MenuResized(this->size());
}
void ResizeMenu::mouseMoveEvent(QMouseEvent *ev){
@@ -46,21 +56,21 @@ void ResizeMenu::mouseMoveEvent(QMouseEvent *ev){
this->setGeometry(geom);
if(contents!=0){ contents->setFixedSize(QSize(geom.width()-2, geom.height()-2));}
handled = true;
- break;
+ break;
case BOTTOM:
if(gpos.y() <= geom.top()+1){ break; }
geom.setBottom( gpos.y());
this->setGeometry(geom);
if(contents!=0){ contents->setFixedSize(QSize(geom.width()-2, geom.height()-2));}
handled = true;
- break;
+ break;
case LEFT:
if(gpos.x() >= geom.right()-1){ break; }
geom.setLeft(gpos.x());
this->setGeometry(geom);
if(contents!=0){ contents->setFixedSize(QSize(geom.width()-2, geom.height()-2));}
handled = true;
- break;
+ break;
case RIGHT:
if(gpos.x() <= geom.left()+1){ break; }
geom.setRight(gpos.x());
bgstack15