[vlc-commits] About: make the label look like links

Jean-Baptiste Kempf git at videolan.org
Tue Apr 16 16:08:42 CEST 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Apr 16 16:08:26 2013 +0200| [3f32a78ab6ced6dc766ebe17d9ece26e018a2bce] | committer: Jean-Baptiste Kempf

About: make the label look like links

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3f32a78ab6ced6dc766ebe17d9ece26e018a2bce
---

 modules/gui/qt4/dialogs/help.cpp |   17 ++++++++++++-----
 modules/gui/qt4/ui/about.ui      |   33 +++++++++++++++++++++------------
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
index 19c404d..8db3dbe 100644
--- a/modules/gui/qt4/dialogs/help.cpp
+++ b/modules/gui/qt4/dialogs/help.cpp
@@ -110,9 +110,9 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
     /* People who wrote the software */
     ui.authorsPage->setText( qfu( psz_authors ) );
 
-    BUTTONACT(ui.licenseButton, showLicense() );
-    BUTTONACT(ui.authorsButton, showAuthors() );
-    BUTTONACT(ui.creditsButton,  showCredit() );
+    ui.licenseButton->installEventFilter( this );
+    ui.authorsButton->installEventFilter( this );
+    ui.creditsButton->installEventFilter( this );
 
     ui.version->installEventFilter( this );
 }
@@ -134,9 +134,9 @@ void AboutDialog::showCredit()
 
 bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
 {
-    if( obj == ui.version )
+    if (event->type() == QEvent::MouseButtonPress )
     {
-        if (event->type() == QEvent::MouseButtonPress )
+        if( obj == ui.version )
         {
             if( !b_advanced )
             {
@@ -151,6 +151,13 @@ bool AboutDialog::eventFilter(QObject *obj, QEvent *event)
             }
             return true;
         }
+        else if( obj == ui.licenseButton )
+            showLicense();
+        else if( obj == ui.authorsButton )
+            showAuthors();
+        else if( obj == ui.creditsButton )
+            showCredit();
+
         return false;
     }
 
diff --git a/modules/gui/qt4/ui/about.ui b/modules/gui/qt4/ui/about.ui
index 9a92ece..2ebeedf 100644
--- a/modules/gui/qt4/ui/about.ui
+++ b/modules/gui/qt4/ui/about.ui
@@ -279,41 +279,50 @@ background-color: rgb(230, 230, 230);</string>
        <number>0</number>
       </property>
       <item>
-       <widget class="QToolButton" name="authorsButton">
+       <widget class="QLabel" name="authorsButton">
+        <property name="cursor">
+         <cursorShape>PointingHandCursor</cursorShape>
+        </property>
         <property name="styleSheet">
          <string notr="true">padding: 10px</string>
         </property>
         <property name="text">
-         <string>Authors</string>
+         <string><html><head/><body><p><span style=" text-decoration: underline; color:#0057ae;">Authors</span></p></body></html></string>
         </property>
-        <property name="autoRaise">
-         <bool>true</bool>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
         </property>
        </widget>
       </item>
       <item>
-       <widget class="QToolButton" name="licenseButton">
+       <widget class="QLabel" name="licenseButton">
+        <property name="cursor">
+         <cursorShape>PointingHandCursor</cursorShape>
+        </property>
         <property name="styleSheet">
          <string notr="true">padding: 10px</string>
         </property>
         <property name="text">
-         <string>License</string>
+         <string><html><head/><body><p><span style=" text-decoration: underline; color:#0057ae;">License</span></p></body></html></string>
         </property>
-        <property name="autoRaise">
-         <bool>true</bool>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
         </property>
        </widget>
       </item>
       <item>
-       <widget class="QToolButton" name="creditsButton">
+       <widget class="QLabel" name="creditsButton">
+        <property name="cursor">
+         <cursorShape>PointingHandCursor</cursorShape>
+        </property>
         <property name="styleSheet">
          <string notr="true">padding: 10px;</string>
         </property>
         <property name="text">
-         <string>Credits</string>
+         <string><html><head/><body><p><span style=" text-decoration: underline; color:#0057ae;">Credits</span></p></body></html></string>
         </property>
-        <property name="autoRaise">
-         <bool>true</bool>
+        <property name="alignment">
+         <set>Qt::AlignCenter</set>
         </property>
        </widget>
       </item>



More information about the vlc-commits mailing list