Qt: Open Dialog button changes.
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 15 Oct 2009 19:02:10 +0000 (21:02 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 16 Oct 2009 09:21:16 +0000 (11:21 +0200)
Use a ToolButton+Menu since Qt4.6 on Windows seems to have fixed this issue.

modules/gui/qt4/dialogs/open.cpp
modules/gui/qt4/dialogs/open.hpp
modules/gui/qt4/ui/open.ui

index ceb356f..b2a782e 100644 (file)
@@ -123,8 +123,7 @@ OpenDialog::OpenDialog( QWidget *parent,
     openButtonMenu->addAction( qtr( "&Convert" ), this, SLOT( transcode() ) ,
                                     QKeySequence( "Alt+C" ) );
 
-    ui.menuButton->setMenu( openButtonMenu );
-    ui.menuButton->setIcon( QIcon( ":/down_arrow" ) );
+    playButton->setMenu( openButtonMenu );
 
     /* Add the three Buttons */
     ui.buttonsBox->addButton( selectButton, QDialogButtonBox::AcceptRole );
@@ -223,7 +222,6 @@ void OpenDialog::setMenuAction()
         }
         playButton->show();
         selectButton->hide();
-        playButton->setDefault( true );
     }
 }
 
index d7f60bd..694b465 100644 (file)
@@ -102,7 +102,7 @@ private:
     QStringList SeparateEntries( const QString& );
 
     QPushButton *cancelButton, *selectButton;
-    QPushButton *playButton;
+    QToolButton *playButton;
 
     void finish( bool );
 
index a374868..e78ddce 100644 (file)
    <string>Dialog</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" colspan="4">
+   <item row="0" column="0" colspan="3">
     <widget class="QTabWidget" name="Tab"/>
    </item>
-   <item row="1" column="0" colspan="4">
+   <item row="1" column="0" colspan="3">
     <widget class="QCheckBox" name="advancedCheckBox">
      <property name="toolTip">
       <string>Show extended options</string>
@@ -43,7 +43,7 @@
      </property>
     </widget>
    </item>
-   <item row="2" column="0" colspan="4">
+   <item row="2" column="0" colspan="3">
     <widget class="QGroupBox" name="advancedFrame">
      <layout class="QGridLayout" name="gridLayout_2">
       <item row="0" column="0">
      </property>
     </spacer>
    </item>
-   <item row="3" column="1">
-    <widget class="QToolButton" name="menuButton">
+   <item row="3" column="2">
+    <widget class="QDialogButtonBox" name="buttonsBox">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
+      <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
-     <property name="maximumSize">
-      <size>
-       <width>16</width>
-       <height>16777215</height>
-      </size>
-     </property>
-     <property name="focusPolicy">
-      <enum>Qt::ClickFocus</enum>
-     </property>
-     <property name="toolTip">
-      <string>Select play mode</string>
-     </property>
-     <property name="popupMode">
-      <enum>QToolButton::InstantPopup</enum>
-     </property>
-     <property name="arrowType">
-      <enum>Qt::NoArrow</enum>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::NoButton</set>
      </property>
     </widget>
    </item>
-   <item row="3" column="2">
-    <widget class="QPushButton" name="playButton">
+   <item row="3" column="1">
+    <widget class="QToolButton" name="playButton">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
        <horstretch>0</horstretch>
      <property name="text">
       <string>Play</string>
      </property>
-     <property name="default">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="3">
-    <widget class="QDialogButtonBox" name="buttonsBox">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::NoButton</set>
+     <property name="popupMode">
+      <enum>QToolButton::MenuButtonPopup</enum>
      </property>
     </widget>
    </item>
   <tabstop>slaveText</tabstop>
   <tabstop>slaveBrowseButton</tabstop>
   <tabstop>playButton</tabstop>
-  <tabstop>menuButton</tabstop>
   <tabstop>buttonsBox</tabstop>
  </tabstops>
  <resources/>