[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kstyles/oxygen/config
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2010-05-31 21:30:21
Message-ID: 20100531213021.3EF82AC8C6 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1133004 by hpereiradacosta:

Fixed size handling of oxygen-settings dialog
Clean-up comments.


 M  +17 -13    oxygenstyleconfig.cpp  
 M  +5 -4      oxygenstyleconfig.h  


--- trunk/KDE/kdebase/workspace/kstyles/oxygen/config/oxygenstyleconfig.cpp \
#1133003:1133004 @@ -65,7 +65,6 @@
     {
         KGlobal::locale()->insertCatalog("kstyle_config");
 
-        /* Stop 1+2: Set up the UI */
         setupUi(this);
 
         // connections
@@ -79,8 +78,6 @@
         // load setup from configData
         load();
 
-        /* Stop 4: Emit a signal on changes */
-        connect( tabWidget, SIGNAL( currentChanged( int ) ), SLOT( \
                currentTabChanged( int ) ) );
         connect( _animationsEnabled, SIGNAL( toggled(bool) ), SLOT( updateChanged() \
                ) );
         connect( _toolBarDrawItemSeparator, SIGNAL( toggled(bool) ), SLOT( \
                updateChanged() ) );
         connect( _checkDrawX, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
@@ -105,7 +102,6 @@
     //__________________________________________________________________
     void StyleConfig::save( void )
     {
-        /* Stop 5: Save the configuration */
         OxygenStyleConfigData::setToolBarDrawItemSeparator( \
                _toolBarDrawItemSeparator->isChecked() );
         OxygenStyleConfigData::setCheckBoxStyle( ( _checkDrawX->isChecked() ? \
                OxygenStyleConfigData::CS_X : OxygenStyleConfigData::CS_CHECK ) );
         OxygenStyleConfigData::setViewDrawTriangularExpander( \
_viewDrawTriangularExpander->isChecked() ); @@ -197,6 +193,23 @@
     }
 
     //__________________________________________________________________
+    void StyleConfig::showEvent( QShowEvent* )
+    {
+
+        if( _expertMode && _animationConfigWidget )
+        {
+            if( const QWidget* widget = tabWidget->widget( tabWidget->currentIndex() \
) ) +            {
+                int delta = qMax( 0, _animationConfigWidget->sizeHint().height() - \
widget->size().height() ); +                if( delta > 0 ) window()->setMinimumSize( \
QSize( window()->minimumSizeHint().width(), window()->size().height() + delta ) ); +  \
} +        }
+
+        return;
+
+    }
+
+    //__________________________________________________________________
     void StyleConfig::updateLayout( void )
     {
 
@@ -256,18 +269,9 @@
     }
 
     //__________________________________________________________________
-    void StyleConfig::currentTabChanged( int index )
-    {
-        if( _animationConfigWidget && index == tabWidget->indexOf( \
                _animationConfigWidget ) )
-        { updateLayout(); }
-
-    }
-
-    //__________________________________________________________________
     void StyleConfig::load( void )
     {
 
-        /* Stop 3: Set up the configuration struct and your widget */
         _toolBarDrawItemSeparator->setChecked( \
                OxygenStyleConfigData::toolBarDrawItemSeparator() );
         _checkDrawX->setChecked( OxygenStyleConfigData::checkBoxStyle() == \
                OxygenStyleConfigData::CS_X );
         _viewDrawTriangularExpander->setChecked( \
                OxygenStyleConfigData::viewDrawTriangularExpander() );
--- trunk/KDE/kdebase/workspace/kstyles/oxygen/config/oxygenstyleconfig.h \
#1133003:1133004 @@ -68,17 +68,18 @@
         //! toggle expert mode
         virtual void toggleExpertMode( bool );
 
+        //! event
+        virtual void showEvent( QShowEvent* );
+
         protected Q_SLOTS:
 
-        //! update layout (when animation config is changed)
+        //! update layout
+        /*! needed in expert mode to accomodate with animations config widget size \
changes */  void updateLayout( void );
 
         //! update modified state when option is checked/unchecked
         void updateChanged( void );
 
-        //! tab changed
-        void currentTabChanged( int );
-
         //! update options enable state based on selected drag mode
         void windowDragModeChanged( int );
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic