Permalink
Browse files

Fix Issue #564 for the mainmenu plugin

    #564 "new panel: cfg "Line size" can be set to 10px but the value is not accepted"
  • Loading branch information...
1 parent 21bfb9a commit da51285e3a1cd3fbcc8e31dfef82e92c7e9cbfb7 @SokoloffA SokoloffA committed Mar 24, 2013
View
10 razorqt-panel/panel/razorpanel.cpp
@@ -692,6 +692,16 @@ bool RazorPanel::event(QEvent *event)
/************************************************
************************************************/
+void RazorPanel::showEvent(QShowEvent *event)
+{
+ realign();
+ emit realigned();
+}
+
+
+/************************************************
+
+ ************************************************/
void RazorPanel::showPopupMenu(Plugin *plugin)
{
QList<QMenu*> pluginsMenus;
View
1 razorqt-panel/panel/razorpanel.h
@@ -103,6 +103,7 @@ public slots:
protected:
bool event(QEvent *event);
+ void showEvent(QShowEvent *event);
private slots:
void screensChangeds();
View
19 razorqt-panel/plugin-mainmenu/razormainmenu.cpp
@@ -214,23 +214,24 @@ QDialog *RazorMainMenu::configureDialog()
************************************************/
void RazorMainMenu::realign()
{
- QSize minSize;
- QSize maxSize;
- minSize.setHeight(panel()->lineCount() * panel()->lineSize());
- minSize.setWidth(minSize.height());
+ QSize minSize = QSize(0, 0);
+ QSize maxSize = QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
- maxSize.setHeight(minSize.height());
-
- if (mButton.toolButtonStyle() == Qt::ToolButtonIconOnly)
+ if (panel()->isHorizontal())
{
- maxSize.setWidth(maxSize.width());
+ minSize.setHeight(panel()->lineCount() * panel()->lineSize());
+ maxSize.setHeight(minSize.height());
+
+ minSize.setWidth(minSize.height());
}
else
{
- maxSize.setWidth(QWIDGETSIZE_MAX);
+ minSize.setWidth(panel()->lineCount() * panel()->lineSize());
+ minSize.setHeight(panel()->lineSize());
}
mButton.setMinimumSize(minSize);
mButton.setMaximumSize(maxSize);
+ mButton.updateGeometry();
}

0 comments on commit da51285

Please sign in to comment.