changeset 183:2e81141893db

resolve problem with hide and show action of the PropertyBox
author lbajardsilogic
date Fri, 23 Nov 2007 11:18:39 +0000
parents 7386cd014f52
children 6a574a1abfc8
files widgets/ItemAudioFilterList.cpp widgets/ItemLayerList.cpp widgets/PropertyBox.cpp widgets/PropertyBox.h
diffstat 4 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/ItemAudioFilterList.cpp	Thu Nov 22 15:54:30 2007 +0000
+++ b/widgets/ItemAudioFilterList.cpp	Fri Nov 23 11:18:39 2007 +0000
@@ -97,10 +97,7 @@
 
 void ItemAudioFilterList::configAction(){
 	if(m_propertyBox!=0){
-		//m_propertyBox->close();
-		m_propertyBox->setWindowFlags(m_propertyBox->windowFlags() | Qt::WindowStaysOnTopHint);
-		m_propertyBox->show();
-		m_propertyBox->activateWindow();
+		m_propertyBox->showNormal();
 	}
 }
 
--- a/widgets/ItemLayerList.cpp	Thu Nov 22 15:54:30 2007 +0000
+++ b/widgets/ItemLayerList.cpp	Fri Nov 23 11:18:39 2007 +0000
@@ -120,10 +120,7 @@
 
 void ItemLayerList::configAction(){
 	if(m_propertyBox!=0){
-		//m_propertyBox->close();
-		m_propertyBox->setWindowFlags(m_propertyBox->windowFlags() | Qt::WindowStaysOnTopHint);
-		m_propertyBox->show();
-		m_propertyBox->activateWindow();
+		m_propertyBox->showNormal();
 	}
 }
 
--- a/widgets/PropertyBox.cpp	Thu Nov 22 15:54:30 2007 +0000
+++ b/widgets/PropertyBox.cpp	Fri Nov 23 11:18:39 2007 +0000
@@ -95,8 +95,7 @@
     connect(UnitDatabase::getInstance(), SIGNAL(unitDatabaseChanged()),
             this, SLOT(unitDatabaseChanged()));
 
-	move(MainWindow::instance()->pos().x() + 3*MainWindow::instance()->width()/4,
-		 MainWindow::instance()->pos().y() + 3*MainWindow::instance()->height()/5);
+	setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
 
 #ifdef DEBUG_PROPERTY_BOX
     std::cerr << "PropertyBox[" << this << "]::PropertyBox returning" << std::endl;
@@ -768,6 +767,16 @@
     }
 }
 
+void PropertyBox::showNormal()
+{
+	if (!isVisible())
+	{
+		move(MainWindow::instance()->pos().x() + 3*MainWindow::instance()->width()/4,
+			 MainWindow::instance()->pos().y() + 3*MainWindow::instance()->height()/5);
+	}
+	QWidget::showNormal();
+	activateWindow();
+}
 
 LEDButton* PropertyBox::showButton(){
 	return m_showButton;
@@ -779,3 +788,4 @@
 PropertyContainer* PropertyBox::container(){
 	return m_container;
 }
+
--- a/widgets/PropertyBox.h	Thu Nov 22 15:54:30 2007 +0000
+++ b/widgets/PropertyBox.h	Fri Nov 23 11:18:39 2007 +0000
@@ -38,6 +38,8 @@
 
     PropertyContainer *getContainer() { return m_container; }
 
+	void showNormal();
+	
 signals:
     void changePlayGain(float);
     void changePlayGainDial(int);