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

List:       kfm-devel
Subject:    [PATCH] GUI for hover close button option
From:       Thomas McGuire <thomasmg () web ! de>
Date:       2004-05-12 17:57:19
Message-ID: 200405122000.19710.thomasmg () web ! de
[Download RAW message or body]

Hello,

As I could not find an option anywhere to enable hover close 
buttons, I created the option myself.
You can now decide between favicons in tab either with hover close 
button or without by checking a checkbox in Settings/Web  
Behaviour/Advanced Options.
Permanent close butttons are no longer possible, but I think nobody 
used them anyway.
Hover close buttons are now enabled by default, as I do not see a 
reason why they should not.

The modified strings should be checked since my English is not very 
good.

And please note that the "Apply" button does not work with this 
option, but that is the same behaviour like before with the old 
"Permanent close button" option. I really do not where I could 
correct this.

This is my first patch for KDE, I hope I haven't done something 
totally stupid ;-)
I hope somebody will commit it.

Thanks very much, 
Thomas









["patch1.diff" (text/x-diff)]

--- src/kde/kdebase_BACKUP/konqueror/konq_tabs.cc	2004-05-09 11:58:58.000000000 +0200
+++ src/kde/kdebase/konqueror/konq_tabs.cc	2004-05-12 18:25:46.000000000 +0200
@@ -118,13 +118,15 @@ KonqFrameTabs::KonqFrameTabs(QWidget* pa
 
   KConfig *config = KGlobal::config();
   KConfigGroupSaver cs( config, QString::fromLatin1("FMSettings") );
-  m_permanentCloseButtons = config->readBoolEntry( "PermanentCloseButton", false );
-  if (m_permanentCloseButtons) {
+  
+  //Read the config and check if we want to have a close button when
+  //the mouse hovers over the website icon. If so, tell KTabWidget.
+  if (config->readBoolEntry( "HoverCloseButton",true ))
+  {
     setHoverCloseButton( true );
-    setHoverCloseButtonDelayed( false );
+    setHoverCloseButtonDelayed( false );        
   }
-  else
-    setHoverCloseButton( config->readBoolEntry( "HoverCloseButton", false ) );
+  
   if (config->readEntry("TabPosition")=="Bottom")
     setTabPosition(QTabWidget::Bottom);
   connect( this, SIGNAL( closeRequest( QWidget * )), SLOT(slotCloseRequest( QWidget * )));
@@ -339,11 +341,8 @@ void KonqFrameTabs::setTitle( const QStr
 void KonqFrameTabs::setTabIcon( const QString &url, QWidget* sender )
 {
   //kdDebug(1202) << "KonqFrameTabs::setTabIcon( " << url << " , " << sender << " )" << endl;
-  QIconSet iconSet;
-  if (m_permanentCloseButtons)
-    iconSet =  SmallIcon( "fileclose" );
-  else
-    iconSet =  QIconSet( KonqPixmapProvider::self()->pixmapFor( url ) );
+  QIconSet iconSet = QIconSet( KonqPixmapProvider::self()->pixmapFor( url ) );
+  
   if (tabIconSet( sender ).pixmap().serialNumber() != iconSet.pixmap().serialNumber())
     setTabIconSet( sender, iconSet );
 }

["patch3.diff" (text/x-diff)]

--- src/kde/kdebase_BACKUP/kcontrol/konqhtml/advancedTabDialog.cpp	2004-04-05 \
                11:35:16.000000000 +0200
+++ src/kde/kdebase/kcontrol/konqhtml/advancedTabDialog.cpp	2004-05-12 \
17:57:46.000000000 +0200 @@ -57,11 +57,11 @@ advancedTabDialog::advancedTabDialog(QWi
     connect(m_advancedWidget->m_pNewTabsInBackground, SIGNAL(clicked()), this, \
                SLOT(changed()));
     connect(m_advancedWidget->m_pOpenAfterCurrentPage, SIGNAL(clicked()), this, \
                SLOT(changed()));
     connect(m_advancedWidget->m_pTabConfirm, SIGNAL(clicked()), this, \
                SLOT(changed()));
-    connect(m_advancedWidget->m_pPermanentCloseButton, SIGNAL(clicked()), this, \
SLOT(changed())); +    connect(m_advancedWidget->m_pHoverCloseButton, \
                SIGNAL(clicked()), this, SLOT(changed()));
     connect(m_advancedWidget->m_pKonquerorTabforExternalURL, SIGNAL(clicked()), \
                this, SLOT(changed()));
     connect(m_advancedWidget->m_pPopupsWithinTabs, SIGNAL(clicked()), this, \
SLOT(changed()));  
@@ -77,7 +77,7 @@ void advancedTabDialog::load()
     m_pConfig->setGroup("FMSettings");
     m_advancedWidget->m_pNewTabsInBackground->setChecked( ! \
                (m_pConfig->readBoolEntry( "NewTabsInFront", false )) );
     m_advancedWidget->m_pOpenAfterCurrentPage->setChecked( m_pConfig->readBoolEntry( \
                "OpenAfterCurrentPage", false ) );
-    m_advancedWidget->m_pPermanentCloseButton->setChecked( m_pConfig->readBoolEntry( \
"PermanentCloseButton", false ) ); +    \
m_advancedWidget->m_pHoverCloseButton->setChecked( m_pConfig->readBoolEntry( \
                "HoverCloseButton", true ) );
     m_advancedWidget->m_pKonquerorTabforExternalURL->setChecked( \
                m_pConfig->readBoolEntry( "KonquerorTabforExternalURL", false ) );
     m_advancedWidget->m_pPopupsWithinTabs->setChecked( m_pConfig->readBoolEntry( \
"PopupsWithinTabs", false ) );  
@@ -92,7 +92,7 @@ void advancedTabDialog::save()
     m_pConfig->setGroup("FMSettings");
     m_pConfig->writeEntry( "NewTabsInFront", \
                !(m_advancedWidget->m_pNewTabsInBackground->isChecked()) );
     m_pConfig->writeEntry( "OpenAfterCurrentPage", \
                m_advancedWidget->m_pOpenAfterCurrentPage->isChecked() );
-    m_pConfig->writeEntry( "PermanentCloseButton", \
m_advancedWidget->m_pPermanentCloseButton->isChecked() ); +    m_pConfig->writeEntry( \
                "HoverCloseButton", \
                m_advancedWidget->m_pHoverCloseButton->isChecked() );
     m_pConfig->writeEntry( "KonquerorTabforExternalURL", \
                m_advancedWidget->m_pKonquerorTabforExternalURL->isChecked() );
     m_pConfig->writeEntry( "PopupsWithinTabs", \
m_advancedWidget->m_pPopupsWithinTabs->isChecked() );  m_pConfig->sync();


["patchUI.diff" (text/x-diff)]

--- src/kde/kdebase_BACKUP/kcontrol/konqhtml/advancedTabOptions.ui	2004-04-05 \
                11:35:16.000000000 +0200
+++ src/kde/kdebase/kcontrol/konqhtml/advancedTabOptions.ui	2004-05-12 \
17:48:52.000000000 +0200 @@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
 <class>advancedTabOptions</class>
 <widget class="QWidget">
     <property name="name">
@@ -9,9 +9,12 @@
             <x>0</x>
             <y>0</y>
             <width>644</width>
-            <height>208</height>
+            <height>210</height>
         </rect>
     </property>
+    <property name="caption">
+        <string>advancedTabOptions</string>
+    </property>
     <vbox>
         <property name="name">
             <cstring>unnamed</cstring>
@@ -56,6 +59,9 @@
                     <property name="text">
                         <string>O&amp;pen new tabs in the background</string>
                     </property>
+                    <property name="accel">
+                        <string>Alt+P</string>
+                    </property>
                     <property name="whatsThis" stdset="0">
                         <string>This will open a new tab in the background, instead \
of in the foreground.</string>  </property>
@@ -67,6 +73,9 @@
                     <property name="text">
                         <string>Open &amp;new tab after current tab</string>
                     </property>
+                    <property name="accel">
+                        <string>Alt+N</string>
+                    </property>
                     <property name="whatsThis" stdset="0">
                         <string>This will open a new tab after the current tab, \
instead of after the last tab.</string>  </property>
@@ -78,31 +87,41 @@
                     <property name="text">
                         <string>Confirm &amp;when closing windows with multiple \
tabs</string>  </property>
+                    <property name="accel">
+                        <string>Alt+W</string>
+                    </property>
                     <property name="whatsThis" stdset="0">
                         <string>This will ask you whether you are sure you want to \
close a window when it has multiple tabs opened in it.</string>  </property>
                 </widget>
                 <widget class="QCheckBox">
                     <property name="name">
-                        <cstring>m_pPermanentCloseButton</cstring>
+                        <cstring>m_pHoverCloseButton</cstring>
                     </property>
                     <property name="text">
-                        <string>&amp;Show close button instead of website \
icon</string> +                        <string>&amp;Show close button when mouse \
points over icon</string> +                    </property>
+                    <property name="accel">
+                        <string>Alt+S</string>
                     </property>
                     <property name="whatsThis" stdset="0">
-                        <string>This will display close buttons inside each tab \
instead of websites' icons.</string> +                        <string>This will \
display a close button instead of the websites' icon when the mouse +is pointed over \
it.</string>  </property>
                 </widget>
                 <widget class="QCheckBox">
                     <property name="name">
-                       <cstring>m_pPopupsWithinTabs</cstring>
+                        <cstring>m_pPopupsWithinTabs</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Open pop&amp;ups in new tab instead of in new \
window</string> +                    </property>
+                    <property name="accel">
+                        <string>Alt+U</string>
+                    </property>
+                    <property name="whatsThis" stdset="0">
+                        <string>Whether or not JavaScript popups if allowed shall \
open in a new tab or in a new window.</string>  </property>
-                   <property name="text">
-                       <string>Open pop&amp;ups in new tab instead of in new \
                window</string>
-                   </property>
-                   <property name="whatsThis" stdset="0">
-                       <string>Whether or not JavaScript popups if allowed shall \
                open in a new tab or in a new window.</string>
-                   </property>
                 </widget>
                 <widget class="QCheckBox">
                     <property name="name">


["patch2.diff" (text/x-diff)]

--- src/kde/kdebase_BACKUP/konqueror/konq_tabs.h	2003-09-29 01:53:57.000000000 +0200
+++ src/kde/kdebase/konqueror/konq_tabs.h	2004-05-12 18:28:08.000000000 +0200
@@ -98,7 +98,7 @@ protected:
   void resizeEvent( QResizeEvent * );
 
   uint tabBarWidthForMaxChars( uint );
-    void refreshSubPopupMenuTab();
+  void refreshSubPopupMenuTab();
 
   QPtrList<KonqFrameBase>* m_pChildFrameList;
 
@@ -113,14 +113,13 @@ private slots:
   void slotReceivedDropEvent( QDropEvent* );
   void slotInitiateDrag( QWidget * );
   void slotReceivedDropEvent( QWidget *, QDropEvent * );
-    void slotSubPopupMenuTabActivated( int);
+  void slotSubPopupMenuTabActivated( int);  
 private:
   KonqViewManager* m_pViewManager;
   QPopupMenu* m_pPopupMenu;
-    QPopupMenu * m_pSubPopupMenuTab;
+  QPopupMenu* m_pSubPopupMenuTab;
   uint m_CurrentMaxLength;
   QToolButton* m_rightWidget;
-  bool m_permanentCloseButtons;
 };
 
 #endif


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

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