Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1633552
 поиск   регистрация   авторизация 
 
Группа :: Графические оболочки/KDE
Пакет: kdebase

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: kdebase-3.1.4-kickermenu.patch


--- kdebase-3.1.4/kicker/ui/k_mnu.cpp.iconmenu	2003-10-13 23:19:41.000000000 +0200
+++ kdebase-3.1.4/kicker/ui/k_mnu.cpp	2003-10-13 23:37:45.000000000 +0200
@@ -196,6 +196,7 @@
 
     KConfig *config = KGlobal::config();
     config->setGroup("menus");
+    menuIconSize_ = config->readNumEntry( "MenuIconSize", 22 );
 
     bool need_separator = false;
 
@@ -214,7 +215,7 @@
         int p;
         while ( ( p = bookmarkstring.find( '&' ) ) >= 0 )
             bookmarkstring.remove( p, 1 );
-        insertItem( SmallIconSet( "bookmark" ), bookmarkstring, bookmarkParent );
+        insertItem( SmallIconSet( "bookmark", menuIconSize_ ), bookmarkstring, bookmarkParent );
         subMenus.append(bookmarkParent);
         need_separator = true;
     }
@@ -223,7 +224,7 @@
     if(config->readBoolEntry("UseBrowser", true))
     {
         PanelQuickBrowser *browserMnu = new PanelQuickBrowser(this);
-        insertItem(SmallIconSet("kdisknav"), i18n("Quick Browser"), browserMnu);
+        insertItem(SmallIconSet("kdisknav", menuIconSize_), i18n("Quick Browser"), browserMnu);
         subMenus.append(browserMnu);
         need_separator = true;
     }
@@ -241,7 +242,7 @@
             KPanelMenu *menu = info.load();
             if (menu)
             {
-                insertItem(SmallIconSet(info.icon()), info.name(), menu);
+                insertItem(SmallIconSet(info.icon(), menuIconSize_), info.name(), menu);
                 subMenus.append(menu);
                 need_separator = true;
             }
@@ -270,7 +271,7 @@
     // run command
     if (kapp->authorize("run_command"))
     {
-        insertItem(SmallIconSet("run"), i18n("Run Command..."), this, SLOT( slotRunCommand() ) );
+        insertItem(SmallIconSet("run", menuIconSize_), i18n("Run Command..."), this, SLOT( slotRunCommand() ) );
         insertSeparator();
     }
 
@@ -286,7 +287,7 @@
         xdmFifoName = QString::null;
     else {
         xdmFifoName = dmopt.first();
-        insertItem(SmallIconSet("fork"), i18n("Start New Session"), this, SLOT(slotNewSession()));
+        insertItem(SmallIconSet("fork", menuIconSize_), i18n("Start New Session"), this, SLOT(slotNewSession()));
     }
 
     /*
@@ -295,17 +296,17 @@
     KConfig ksmserver("ksmserverrc", false, false);
     ksmserver.setGroup("General");
     if ( ksmserver.readEntry( "loginMode" ) == "restoreSavedSession"  )
-	insertItem(SmallIconSet("filesave"), i18n("Save Session"), this, SLOT(slotSaveSession()));
+	insertItem(SmallIconSet("filesave", menuIconSize_), i18n("Save Session"), this, SLOT(slotSaveSession()));
 
     if (kapp->authorize("lock_screen"))
-      insertItem(SmallIconSet("lock"), i18n("Lock Screen"), this, SLOT(slotLock()));
+      insertItem(SmallIconSet("lock", menuIconSize_), i18n("Lock Screen"), this, SLOT(slotLock()));
 
     char *user = getlogin();
     if (user == 0) user = getenv("LOGNAME");
     QString username(user);
 
     if (kapp->authorize("logout"))
-      insertItem(SmallIconSet("exit"), i18n("Logout \"%1\"...").arg(username), this, SLOT(slotLogout()));
+      insertItem(SmallIconSet("exit", menuIconSize_), i18n("Logout \"%1\"...").arg(username), this, SLOT(slotLogout()));
 
 #if 0
     // WABA: tear off handles don't work together with dynamically updated
--- kdebase-3.1.4/kicker/ui/service_mnu.cpp.iconmenu	2003-10-13 19:39:17.000000000 +0200
+++ kdebase-3.1.4/kicker/ui/service_mnu.cpp	2003-10-13 23:07:35.000000000 +0200
@@ -73,6 +73,7 @@
     merge_              = group.readBoolEntry( "MergeKDEDirs",              TRUE );
     detailed_           = group.readBoolEntry( "DetailedMenuEntries",       TRUE );
     detailedNamesFirst_ = group.readBoolEntry( "DetailedEntriesNamesFirst", TRUE );
+    menuIconSize_       = group.readNumEntry( "MenuIconSize" );
 }
 
 // create and fill "recent" section at first
@@ -256,9 +257,13 @@
             m->setCaption( groupCaption );
             
             QPixmap normal = KGlobal::instance()->iconLoader()->loadIcon(g->icon(), KIcon::Small,
-                                                                 0, KIcon::DefaultState, 0L, true);
+                                                                         menuIconSize_,
+                                                                         KIcon::DefaultState, 0L, true);
             QPixmap active = KGlobal::instance()->iconLoader()->loadIcon(g->icon(), KIcon::Small,
-                                                                 0, KIcon::ActiveState, 0L, true);
+                                                                         menuIconSize_,
+                                                                         KIcon::ActiveState, 0L, true);
+
+#ifdef KICKER_MENU_ICON_20_20
             // make sure they are not larger than 20x20
             if (normal.width() > 20 || normal.height() > 20) {
                 QImage tmp = normal.convertToImage();
@@ -270,6 +275,7 @@
                 tmp = tmp.smoothScale(20, 20);
                 active.convertFromImage(tmp);
             }
+#endif
 
             QIconSet iconset;
             iconset.setPixmap(normal, QIconSet::Small, QIconSet::Normal);
@@ -337,9 +343,13 @@
     serviceName.replace(QRegExp("&"), "&&");
 
     QPixmap normal = KGlobal::instance()->iconLoader()->loadIcon(s->icon(), KIcon::Small,
-                                                                 0, KIcon::DefaultState, 0L, true);
+                                                                 menuIconSize_,
+                                                                 KIcon::DefaultState, 0L, true);
     QPixmap active = KGlobal::instance()->iconLoader()->loadIcon(s->icon(), KIcon::Small,
-                                                                 0, KIcon::ActiveState, 0L, true);
+                                                                 menuIconSize_,
+                                                                 KIcon::ActiveState, 0L, true);
+
+#ifdef KICKER_MENU_ICON_20_20
     // make sure they are not larger than 20x20
     if (normal.width() > 20 || normal.height() > 20) {
         QImage tmp = normal.convertToImage();
@@ -351,6 +361,7 @@
         tmp = tmp.smoothScale(20, 20);
         active.convertFromImage(tmp);
     }
+#endif
 
     QIconSet iconset;
     iconset.setPixmap(normal, QIconSet::Small, QIconSet::Normal);
--- kdebase-3.1.4/kicker/ui/service_mnu.h.iconmenu	2003-10-13 22:39:54.000000000 +0200
+++ kdebase-3.1.4/kicker/ui/service_mnu.h	2003-10-13 22:40:21.000000000 +0200
@@ -89,6 +89,7 @@
     bool detailedNamesFirst_;
     bool loaded_;
     bool excludeNoDisplay_;
+    int menuIconSize_;
 
     QPopupMenu * opPopup_;
     bool clearOnClose_;
 
design & coding: Vladimir Lettiev aka crux © 2004-2005