Revision: 6169
Author: nogu.dev
Date: Fri Feb 26 13:58:34 2010
Log: * Merge r6160 from trunk.
http://code.google.com/p/uim/source/detail?r=6169

Modified:
 /branches/1.5/qt4/toolbar/common-uimstateindicator.cpp
 /branches/1.5/qt4/toolbar/standalone-qt4.cpp
 /branches/1.5/qt4/toolbar/standalone-qt4.h

=======================================
--- /branches/1.5/qt4/toolbar/common-uimstateindicator.cpp Mon Dec 21 17:44:42 2009 +++ /branches/1.5/qt4/toolbar/common-uimstateindicator.cpp Fri Feb 26 13:58:34 2010
@@ -129,7 +129,9 @@
         return;

     QHelperPopupMenu *popupMenu = 0;
+#ifdef PLASMA_APPLET_UIM
     int prevCount = m_layout->count();
+#endif
     foreach ( QHelperToolbarButton *button, buttons )
     {
         if ( m_layout->indexOf( button ) >= 0 )
@@ -206,10 +208,10 @@
         }
     }

+#ifdef PLASMA_APPLET_UIM
     if ( m_layout->count() != prevCount )
+#endif
         emit indicatorResized();
-
-    parentWidget()->show();
 }

 void UimStateIndicator::helper_disconnect_cb()
=======================================
--- /branches/1.5/qt4/toolbar/standalone-qt4.cpp        Sat Nov 21 04:55:15 2009
+++ /branches/1.5/qt4/toolbar/standalone-qt4.cpp        Fri Feb 26 13:58:34 2010
@@ -62,11 +62,11 @@
     setLayout( layout );

     adjustSize();
-    UimToolbarDraggingHandler *h = new UimToolbarDraggingHandler( this );
-    layout->addWidget( h );
-    h->adjustSize();
-    h->show();
-    connect( h, SIGNAL( handleDoubleClicked() ),
+    handler = new UimToolbarDraggingHandler( this );
+    layout->addWidget( handler );
+    handler->adjustSize();
+    handler->show();
+    connect( handler, SIGNAL( handleDoubleClicked() ),
                       this, SLOT( slotToolbarDoubleClicked() ) );


@@ -81,11 +81,12 @@
     int panelHeight = 64; // FIXME!
     int screenwidth = QApplication::desktop()->screenGeometry().width();
     int screenheight = QApplication::desktop()->screenGeometry().height();
- QPoint p( screenwidth - panelHeight - toolbar->width() - h->width(), screenheight - height() - panelHeight ); + QPoint p( screenwidth - panelHeight - toolbar->width() - handler->width(),
+            screenheight - height() - panelHeight );
     move( p );

     // Enable Dragging Feature
-    connect( h, SIGNAL( moveTo( const QPoint & ) ),
+    connect( handler, SIGNAL( moveTo( const QPoint & ) ),
                       this, SLOT( moveTo( const QPoint & ) ) );

     // Quit
@@ -102,16 +103,22 @@
 void
 UimStandaloneToolbar::slotToolbarResized()
 {
+    toolbar->show();
     adjustSize();
 }

 void
 UimStandaloneToolbar::slotToolbarDoubleClicked()
 {
-    if (toolbar->isVisible())
-      toolbar->hide();
-    else
-      toolbar->show();
+    if (toolbar->isVisible()) {
+        toolbar->hide();
+        // shrink this toolbar
+        int width = maximumWidth();
+        setFixedWidth(handler->width());
+        setMaximumWidth(width);
+    } else {
+        toolbar->show();
+    }
     adjustSize();
 }

=======================================
--- /branches/1.5/qt4/toolbar/standalone-qt4.h  Sat Nov 21 04:55:15 2009
+++ /branches/1.5/qt4/toolbar/standalone-qt4.h  Fri Feb 26 13:58:34 2010
@@ -37,6 +37,7 @@
 #include <QtGui/QMouseEvent>

 class QUimHelperToolbar;
+class UimToolbarDraggingHandler;

 class QPoint;
 class QMouseEvent;
@@ -57,6 +58,7 @@
     void moveTo(const QPoint &point);

 private:
+    UimToolbarDraggingHandler *handler;
     QUimHelperToolbar *toolbar;
 };

Reply via email to