[Kst] [Bug 120882] "Raise to Top" and "Lower to Bottom" have no effect

Andrew Walker arwalker at sumusltd.com
Fri Jan 27 22:50:39 CET 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=120882         




------- Additional Comments From arwalker sumusltd com  2006-01-27 22:50 -------
Proposed patch for this problem:

Index: kstviewobject.cpp
===================================================================
--- kstviewobject.cpp   (revision 503013)
+++ kstviewobject.cpp   (working copy)
 @ -1080,7 +1080,8  @

   bool rc = false;
   int id;
-
+  int index;
+
   _moveToMap.clear();

   if (!tagName().isEmpty()) {
 @ -1098,23 +1099,35  @
   }

   if (_layoutActions & Raise) {
-    menu->insertItem(i18n("&Raise"), this, SLOT(raise()));
+    index = menu->insertItem(i18n("&Raise"), this, SLOT(raise()));
     rc = true;
+    if (_parent && _parent->_children.count() == 1) {
+      menu->setItemEnabled(index, false);
+    }
   }

   if (_layoutActions & Lower) {
-    menu->insertItem(i18n("&Lower"), this, SLOT(lower()));
+    index = menu->insertItem(i18n("&Lower"), this, SLOT(lower()));
     rc = true;
+    if (_parent && _parent->_children.count() == 1) {
+      menu->setItemEnabled(index, false);
+    }
   }

   if (_layoutActions & RaiseToTop) {
-    menu->insertItem(i18n("Raise to &Top"), this, SLOT(raiseToTop()));
+    index = menu->insertItem(i18n("Raise to &Top"), this, SLOT(raiseToTop()));
     rc = true;
+    if (_parent && _parent->_children.count() == 1) {
+      menu->setItemEnabled(index, false);
+    }
   }

   if (_layoutActions & LowerToBottom) {
-    menu->insertItem(i18n("Lower to &Bottom"), this, SLOT(lowerToBottom()));
+    index = menu->insertItem(i18n("Lower to &Bottom"), this, SLOT(lowerToBottom()));
     rc = true;
+    if (_parent && _parent->_children.count() == 1) {
+      menu->setItemEnabled(index, false);
+    }
   }

   if (_layoutActions & Rename) {


More information about the Kst mailing list