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

List:       kde-devel
Subject:    patch to increase the number of icon sizes.
From:       Luciano Montanaro <mikelima () cirulla ! net>
Date:       2004-05-25 9:19:27
Message-ID: 200405251119.27190.mikelima () cirulla ! net
[Download RAW message or body]

I'm posting this now, since the deadline for submitting enhancements is drawing 
near...

I'd like to have a larger number of sizes available for the icon views.
The attached patch can be used to try out the idea, even if it has a 
number of rough edges. It adds four more sizes above "huge": 96, 128, 192 
and 256. This is probably too many new sizes...
However, I think having larger sizes would be really a really useful way to 
browse directories (er, folders) with thumbnails enabled.

Additionally, since png icons are provided in the 128x128 size, it makes sense
to add that too.

The patch does not address the "Icon Size" menu item.
It could contain, for example, the sizes "Tiny", "Small", Medium", "Large", 
"Very Large", "Huge", "Oversized". This, however, leaves out two steps 
from the list above. Maybe the "96" and "192" sizes could be spared, or maybe
we could do without the "192" and "256" sizes.

Finally, currently the "medium" size is set to 32x32; I think with current display
a medium size could be better set at 48x48.

Or we could have the user choose the "medium" or "default" size, and have Tiny be 
two steps below, Large one step above, and so on.

What do you think?

Luciano    

["Attachment: 0" (text/x-diff)]

? large-icons.patch
? libkonq.patch
Index: konq_dirpart.cc
===================================================================
RCS file: /home/kde/kdebase/libkonq/konq_dirpart.cc,v
retrieving revision 1.73
diff -p -u -r1.73 konq_dirpart.cc
--- konq_dirpart.cc	19 May 2004 12:25:43 -0000	1.73
+++ konq_dirpart.cc	23 May 2004 20:22:29 -0000
@@ -61,8 +61,16 @@ KonqDirPart::KonqDirPart( QObject *paren
 
     actionCollection()->setHighlightingEnabled( true );
 
-    m_paIncIconSize = new KAction( i18n( "Increase Icon Size" ), "viewmag+", 0, \
                this, SLOT( slotIncIconSize() ), actionCollection(), "incIconSize" );
-    m_paDecIconSize = new KAction( i18n( "Decrease Icon Size" ), "viewmag-", 0, \
this, SLOT( slotDecIconSize() ), actionCollection(), "decIconSize" ); +    \
m_paIncIconSize = new KAction( i18n( "Increase Icon Size" ), "viewmag+",  +		         \
0, this, SLOT( slotIncIconSize() ),  +				   actionCollection(), "incIconSize" );
+    m_paIncIconSize->setWhatsThis( i18n( "Increase Icon Size<p>"
+			                 "Make the icons size for this window larger.<p>" ) );
+    m_paDecIconSize = new KAction( i18n( "Decrease Icon Size" ), "viewmag-", 
+		                   0, this, SLOT( slotDecIconSize() ), 
+				   actionCollection(), "decIconSize" );
+    m_paDecIconSize->setWhatsThis( i18n( "Decrease Icon Size<p>"
+			                 "Make the icon size for this window smaller.<p>" ) );
 
     m_paDefaultIcons = new KRadioAction( i18n( "&Default Size" ), 0, \
                actionCollection(), "modedefault" );
     m_paHugeIcons = new KRadioAction( i18n( "&Huge" ), 0, actionCollection(), \
"modehuge" ); @@ -89,6 +97,10 @@ KonqDirPart::KonqDirPart( QObject *paren
     m_iIconSize[2] = KIcon::SizeMedium; // 32
     m_iIconSize[3] = KIcon::SizeLarge; // 48
     m_iIconSize[4] = KIcon::SizeHuge; // 64
+    m_iIconSize[5] = 96;
+    m_iIconSize[6] = 128;
+    m_iIconSize[7] = 192;
+    m_iIconSize[8] = 256;
     KIconTheme *root = KGlobal::instance()->iconLoader()->theme();
     if (root)
     {
@@ -414,10 +426,10 @@ void KonqDirPart::slotIncIconSize()
     int s = m_pProps->iconSize();
     s = s ? s : KGlobal::iconLoader()->currentSize( KIcon::Desktop );
     int sizeIndex = 0;
-    for ( int idx=1; idx < 5 ; ++idx )
+    for ( int idx=1; idx < 9 ; ++idx )
         if (s == m_iIconSize[idx])
             sizeIndex = idx;
-    if ( sizeIndex > 0 && sizeIndex < 4 )
+    if ( sizeIndex > 0 && sizeIndex < 8 )
     {
         setIconSize( m_iIconSize[sizeIndex + 1] );
     }
@@ -428,7 +440,7 @@ void KonqDirPart::slotDecIconSize()
     int s = m_pProps->iconSize();
     s = s ? s : KGlobal::iconLoader()->currentSize( KIcon::Desktop );
     int sizeIndex = 0;
-    for ( int idx=1; idx < 5 ; ++idx )
+    for ( int idx=1; idx < 9 ; ++idx )
         if (s == m_iIconSize[idx])
             sizeIndex = idx;
     if ( sizeIndex > 1 )
@@ -442,7 +454,7 @@ void KonqDirPart::newIconSize( int size 
 {
     int realSize = (size==0) ? KGlobal::iconLoader()->currentSize( KIcon::Desktop ) \
: size;  m_paDecIconSize->setEnabled(realSize > m_iIconSize[1]);
-    m_paIncIconSize->setEnabled(realSize < m_iIconSize[4]);
+    m_paIncIconSize->setEnabled(realSize < m_iIconSize[9]);
 
     m_paDefaultIcons->setChecked( size == 0 );
     m_paHugeIcons->setChecked( size == m_iIconSize[4] );
Index: konq_dirpart.h
===================================================================
RCS file: /home/kde/kdebase/libkonq/konq_dirpart.h,v
retrieving revision 1.36
diff -p -u -r1.36 konq_dirpart.h
--- konq_dirpart.h	5 May 2004 03:44:50 -0000	1.36
+++ konq_dirpart.h	23 May 2004 20:22:31 -0000
@@ -291,7 +291,7 @@ protected:
     KParts::ReadOnlyPart * m_findPart;
     KonqDirPartBrowserExtension * m_extension;
 
-    int m_iIconSize[5];
+    int m_iIconSize[9];
 
     long long m_lDirSize;
     uint m_lFileCount;



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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