Repair various KMenu side pixmap problems

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1178045 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 7d27a8d80d
commit 78feb5c8dc

@ -233,6 +233,13 @@ void MenuTab::save()
if (kmenusetting != oldkmenusetting)
DCOPRef ("kicker", "default").call("restart()");
c->setGroup("KMenu");
bool sidepixmapsetting = kcfg_UseSidePixmap->isChecked();
bool oldsidepixmapsetting = c->readBoolEntry("UseSidePixmap", true);
if (sidepixmapsetting != oldsidepixmapsetting)
DCOPRef ("kicker", "default").call("restart()");
// Save KMenu settings
c->setGroup("KMenu");
c->writeEntry("CustomIcon", m_kmenu_icon);

@ -74,6 +74,7 @@ PanelKMenu::PanelKMenu()
: PanelServiceMenu(TQString::null, TQString::null, 0, "KMenu")
, bookmarkMenu(0)
, bookmarkOwner(0)
, displayRepaired(FALSE)
{
static const TQCString dcopObjId("KMenu");
DCOPObject::setObjId(dcopObjId);
@ -91,6 +92,8 @@ PanelKMenu::PanelKMenu()
dcopObjId,
"slotServiceStartedByStorageId(TQString,TQString)",
false);
displayRepairTimer = new TQTimer( this );
connect( displayRepairTimer, SIGNAL(timeout()), this, SLOT(repairDisplay()) );
}
PanelKMenu::~PanelKMenu()
@ -365,9 +368,26 @@ void PanelKMenu::initialize()
insertTearOffHandle();
#endif
if (displayRepaired == FALSE) {
displayRepairTimer->start(0, FALSE);
displayRepaired = TRUE;
}
setInitialized(true);
}
void PanelKMenu::repairDisplay(void) {
if (isShown() == true) {
displayRepairTimer->stop();
// Now do a nasty hack to prevent search bar merging into the side image
// This forces a layout/repaint of the qpopupmenu
repaint(); // This ensures that the side bar image was applied
styleChange(style()); // This forces a call to the private function updateSize(TRUE) inside the qpopupmenu.
update(); // This repaints the entire popup menu to apply the widget size/alignment changes made above
}
}
int PanelKMenu::insertClientMenu(KickerClientMenu *p)
{
int id = client_id;
@ -520,7 +540,6 @@ void PanelKMenu::showMenu()
else
{
show();
repaint(); // If the menu is not repainted on initial display the search bar merges into the side image
}
}

@ -27,6 +27,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <dcopobject.h>
#include <tqintdict.h>
#include <tqpixmap.h>
#include <tqtimer.h>
#include "service_mnu.h"
@ -84,6 +85,7 @@ protected slots:
void paletteChanged();
virtual void configChanged();
void updateRecent();
void repairDisplay();
protected:
TQRect sideImageRect();
@ -113,6 +115,8 @@ private:
PopupMenuList dynamicSubMenus;
KPIM::ClickLineEdit *searchEdit;
static const int searchLineID;
TQTimer *displayRepairTimer;
bool displayRepaired;
};
#endif

Loading…
Cancel
Save