LUserButtonPlugin::LUserButtonPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ button = new QToolButton(this); button->setAutoRaise(true); button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); button->setPopupMode(QToolButton::DelayedPopup); //make sure it runs the update routine first connect(button, SIGNAL(clicked()), this, SLOT(openMenu())); this->layout()->setContentsMargins(0,0,0,0); this->layout()->addWidget(button); menu = new QMenu(this); menu->setContentsMargins(1,1,1,1); connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); usermenu = new UserWidget(this); connect(usermenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) ); mact = new QWidgetAction(this); mact->setDefaultWidget(usermenu); menu->addAction(mact); button->setMenu(menu); connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) ); //Setup the global shortcut handling for opening the start menu connect(QApplication::instance(), SIGNAL(StartButtonActivated()), this, SLOT(shortcutActivated()) ); LSession::handle()->registerStartButton(this->type()); QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes }
void ToolButton::setMenu(QMenu* menu) { Q_ASSERT(menu); if (m_menu) disconnect(m_menu, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); m_menu = menu; connect(m_menu, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); }
void ToolButton::setMenu(QMenu* m) { if (m) { connect(m, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); } else if (menu()) { disconnect(menu(), SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); } QToolButton::setMenu(m); }
// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // DesktopMenu::DesktopMenu(DesktopList* pController) :QMenu(NULL) { controller = pController; connect(this, SIGNAL(aboutToShow()), this, SLOT(_onshow())); connect(this, SIGNAL(aboutToHide()), this, SLOT(_onhide())); }
void FolderView::onFileClicked(int type, FmFileInfo* fileInfo) { if(type == ActivatedClick) { if(fileLauncher_) { GList* files = g_list_append(NULL, fileInfo); fileLauncher_->launchFiles(NULL, files); g_list_free(files); } } else if(type == ContextMenuClick) { FmPath* folderPath = path(); QMenu* menu = NULL; if(fileInfo) { // show context menu if (FmFileInfoList* files = selectedFiles()) { Fm::FileMenu* fileMenu = new Fm::FileMenu(files, fileInfo, folderPath); fileMenu->setFileLauncher(fileLauncher_); prepareFileMenu(fileMenu); fm_file_info_list_unref(files); menu = fileMenu; } } else { FmFolder* _folder = folder(); FmFileInfo* info = fm_folder_get_info(_folder); Fm::FolderMenu* folderMenu = new Fm::FolderMenu(this); prepareFolderMenu(folderMenu); menu = folderMenu; } if (menu) { menu->popup(QCursor::pos()); connect(menu, SIGNAL(aboutToHide()), menu, SLOT(deleteLater())); } } }
void VisWidget::contextMenu( const QPoint &point ) { QMenu *menu = new QMenu( this ); connect( menu, SIGNAL( aboutToHide() ), menu, SLOT( deleteLater() ) ); connect( menu->addAction( tr( "Ustawienia" ) ), SIGNAL( triggered() ), this, SLOT( showSettings() ) ); menu->popup( mapToGlobal( point ) ); }
Menu::Menu(QWidget *AParent) : QMenu(AParent) { menuAboutToShow = false; FIconStorage = NULL; FMenuAction = new Action(this); FMenuAction->setMenu(this); border = NULL;//CustomBorderStorage::staticStorage(RSR_STORAGE_CUSTOMBORDER)->addBorder(this, CBS_MENU); if (border) { setWindowFlags(Qt::Widget); border->setShowInTaskBar(false); border->setResizable(false); border->setMovable(false); border->setMinimizeButtonVisible(false); border->setMaximizeButtonVisible(false); border->setCloseButtonVisible(false); border->setCloseOnDeactivate(true); border->setStaysOnTop(true); if (AParent) connect(AParent,SIGNAL(destroyed()),SLOT(deleteLater())); connect(this, SIGNAL(aboutToShow()), SLOT(onAboutToShow())); connect(this, SIGNAL(aboutToHide()), SLOT(onAboutToHide())); connect(this, SIGNAL(triggered(QAction*)), SLOT(hide())); } setSeparatorsCollapsible(true); }
void StatusButton::setUserMenu(QMenu *menu) { setMenu(menu); connect(menu, SIGNAL(aboutToShow()), this, SLOT(onMenuAboutToShow())); connect(menu, SIGNAL(aboutToHide()), this, SLOT(onMenuAboutToHide())); }
// ========================= // ===== INSTALLED TAB ===== // ========================= void MainUI::initializeInstalledTab(){ //Setup the action menu for installed applications actionMenu = new QMenu(); QMenu *dmenu = actionMenu->addMenu( QIcon(":icons/xdg_desktop.png"), tr("Desktop Icons")); dmenu->addAction( QIcon(":icons/add.png"),tr("Add"),this,SLOT(slotActionAddDesktop()) ); dmenu->addAction( QIcon(":icons/remove.png"),tr("Remove"),this,SLOT(slotActionRemoveDesktop()) ); QMenu *lmenu = actionMenu->addMenu( QIcon(":icons/lock.png"), tr("Version Lock") ); lmenu->addAction( QIcon(":icons/lock.png"), tr("Lock Current Version"), this, SLOT(slotActionLock()) ); lmenu->addAction( QIcon(":icons/unlock.png"), tr("Unlock Application"), this, SLOT(slotActionUnlock()) ); actionMenu->addSeparator(); actionMenu->addAction( QIcon(":icons/remove.png"), tr("Uninstall"), this, SLOT(slotActionRemove()) ); actionMenu->addSeparator(); actionMenu->addAction( QIcon(":icons/dialog-cancel.png"), tr("Cancel Actions"), this, SLOT(slotActionCancel()) ); //Setup the shortcuts menu for installed applications sDeskMenu = new QMenu(this); sDeskMenu->addAction( QIcon(":icons/add.png"),tr("Add Desktop Shortcuts"),this,SLOT(slotActionAddDesktop()) ); sDeskMenu->addAction( QIcon(":icons/remove.png"),tr("Remove Desktop Shortcuts"),this,SLOT(slotActionRemoveDesktop()) ); ui->tool_install_shortcuts->setMenu(sDeskMenu); //Setup the binary menu for installed applications appBinMenu = new QMenu(); ui->tool_install_startApp->setMenu(appBinMenu); connect(appBinMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotStartApp(QAction*)) ); //Initialize the context menu contextActionMenu = new QMenu(this); connect(contextActionMenu, SIGNAL(aboutToHide()), this, SLOT(contextMenuFinished()) ); //Now setup the action button ui->tool_install_performaction->setMenu(actionMenu); ui->tool_install_performaction->setPopupMode(QToolButton::InstantPopup); //Now setup any defaults for the installed tab ui->tree_install_apps->setIconSize(QSize(22,22)); ui->tree_install_apps->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->tree_install_apps, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(slotCheckSelectedItems()) ); connect(ui->tree_install_apps, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT( slotInstalledAppRightClicked(const QPoint &)) ); slotRefreshInstallTab(); }
JoyButtonContextMenu::JoyButtonContextMenu(JoyButton *button, QWidget *parent) : QMenu(parent) { this->button = button; connect(this, SIGNAL(aboutToHide()), this, SLOT(deleteLater())); }
void SystemTrayMenu::init() { mVKListMenu = new QMenu(gettext("Virtual Keyboard"), this); mSkinMenu = new QMenu(gettext("Skin"), this); mMozcHiraganaMenu = new QMenu(gettext("Mozc Edit mode"), this); mMozcToolMenu = new QMenu(gettext("Mozc Tool"), this); QObject::connect(this, SIGNAL(aboutToHide()), this, SLOT(clearMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateVKListMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(truggerUpdateMozcHiraganaMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(truggerUpdateMozcToolMenu())); QObject::connect(this, SIGNAL(aboutToShow()), this, SLOT(triggerUpdateIMListMenu())); QObject::connect(this, SIGNAL(triggered(QAction*)), this, SLOT(menuItemOnClick(QAction *))); QObject::connect(mAgent, SIGNAL(execMenu(const QList<KimpanelProperty>)), this, SLOT(execMenu(const QList<KimpanelProperty>))); QObject::connect(mAgent, SIGNAL(registerProperties(const QList<KimpanelProperty>)), this, SLOT(registerProperties(const QList<KimpanelProperty>))); QObject::connect(mAgent, SIGNAL(updateProperty(KimpanelProperty)), this, SLOT(updateProperty(KimpanelProperty))); updateMainMenu(); }
DPadContextMenu::DPadContextMenu(JoyDPad *dpad, QWidget *parent) : QMenu(parent) { this->dpad = dpad; connect(this, SIGNAL(aboutToHide()), this, SLOT(deleteLater())); }
JoyControlStickContextMenu::JoyControlStickContextMenu(JoyControlStick *stick, QWidget *parent) : QMenu(parent) { this->stick = stick; connect(this, SIGNAL(aboutToHide()), this, SLOT(deleteLater())); }
//! [6] void MainWindow::createMenus() { //! [6] fileMenu = menuBar()->addMenu(tr("&File")); fileMenu->addAction(exitAction); //! [7] editMenu = menuBar()->addMenu(tr("&Edit")); editMenu->addAction(undoAction); editMenu->addAction(redoAction); editMenu->addSeparator(); editMenu->addAction(deleteAction); connect(editMenu, SIGNAL(aboutToShow()), this, SLOT(itemMenuAboutToShow())); connect(editMenu, SIGNAL(aboutToHide()), this, SLOT(itemMenuAboutToHide())); //! [7] itemMenu = menuBar()->addMenu(tr("&Item")); itemMenu->addAction(addBoxAction); itemMenu->addAction(addTriangleAction); helpMenu = menuBar()->addMenu(tr("&About")); helpMenu->addAction(aboutAction); //! [8] }
WindowMenu::WindowMenu(QWidget *parent) : QMenu(QString::fromUtf8("&Window"), parent) { pMinimize_ = addAction(QString::fromUtf8("Minimize")); pMinimize_->setShortcut(QKeySequence(QString::fromAscii("Meta+M"))); connect(pMinimize_, SIGNAL(triggered()), this, SLOT(onMinimize())); pZoom_ = addAction(QString::fromUtf8("Zoom")); connect(pZoom_, SIGNAL(triggered()), this, SLOT(onZoom())); addSeparator(); pWindowPlaceholder_ = addAction(QString::fromAscii("__PLACEHOLDER__")); pWindowPlaceholder_->setVisible(false); addSeparator(); pBringAllToFront_ = addAction(QString::fromUtf8("Bring All to Front")); connect(pBringAllToFront_, SIGNAL(triggered()), this, SLOT(onBringAllToFront())); connect(this, SIGNAL(aboutToShow()), this, SLOT(onAboutToShow())); connect(this, SIGNAL(aboutToHide()), this, SLOT(onAboutToHide())); }
void ItemWidget::createWidget(){ //Initialize the widgets gooditem = true; menuopen = false; menureset = new QTimer(this); menureset->setSingleShot(true); menureset->setInterval(1000); //1 second this->setContentsMargins(0,0,0,0); contextMenu = new QMenu(); connect(contextMenu, SIGNAL(aboutToShow()), this, SLOT(actionMenuOpen()) ); connect(contextMenu, SIGNAL(aboutToHide()), this, SLOT(actionMenuClosed()) ); actButton = new QToolButton(this); actButton->setPopupMode(QToolButton::InstantPopup); actButton->setArrowType(Qt::DownArrow); icon = new QLabel(this); name = new QLabel(this); name->setWordWrap(true); name->setTextFormat(Qt::RichText); name->setTextInteractionFlags(Qt::NoTextInteraction); //Add them to the layout this->setLayout(new QHBoxLayout()); this->layout()->setContentsMargins(1,1,1,1); this->layout()->addWidget(icon); this->layout()->addWidget(actButton); this->layout()->addWidget(name); //Set a custom object name so this can be tied into the Lumina Theme stylesheets this->setObjectName("LuminaItemWidget"); }
void ColorGridView::initContextMenu() { menu.addAction(tr("Pick"), this,SLOT(colorPicked())); menu.addAction(tr("Drop From Wheel"),this,SLOT(colorDroped())); menu.addAction(tr("Clear"),this,SLOT(colorCleared())); menu.addAction(tr("Cancel")); connect(&menu,SIGNAL(aboutToHide()),this,SLOT(repaint())); }
// ======================= // PRIVATE FUNCTIONS // ======================= void LDeskBarPlugin::initializeDesktop(){ //Applications on the desktop appB = new QToolButton(this); appB->setToolButtonStyle(Qt::ToolButtonIconOnly); appB->setAutoRaise(true); appB->setPopupMode(QToolButton::InstantPopup); appM = new QMenu(this); appB->setMenu(appM); this->layout()->addWidget(appB); connect(appM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) ); connect(appM, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); //Directories on the desktop dirB = new QToolButton(this); dirB->setToolButtonStyle(Qt::ToolButtonIconOnly); dirB->setAutoRaise(true); dirB->setPopupMode(QToolButton::InstantPopup); dirM = new QMenu(this); dirB->setMenu(dirM); this->layout()->addWidget(dirB); connect(dirM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) ); connect(dirM, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); //Audio Files on the desktop audioM = new QMenu(this); connect(audioM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) ); //Video Files on the desktop videoM = new QMenu(this); connect(videoM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) ); //Picture Files on the desktop pictureM = new QMenu(this); connect(pictureM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) ); //Other Files on the desktop otherM = new QMenu(this); connect(otherM,SIGNAL(triggered(QAction*)),this,SLOT(ActionTriggered(QAction*)) ); docM = new QMenu(this); connect(docM,SIGNAL(triggered(QAction*)), this,SLOT(ActionTriggered(QAction*)) ); //All Files Button fileB = new QToolButton(this); fileB->setToolButtonStyle(Qt::ToolButtonIconOnly); fileB->setAutoRaise(true); fileB->setPopupMode(QToolButton::InstantPopup); fileM = new QMenu(this); fileB->setMenu(fileM); this->layout()->addWidget(fileB); updateIcons(); //set all the text/icons }
void PanelPopupButton::setPopup(QPopupMenu *popup) { if (m_popup) { m_popup->removeEventFilter(this); disconnect(m_popup, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); } m_popup = popup; setDrawArrow(m_popup != 0); if (m_popup) { m_popup->installEventFilter(this); connect(m_popup, SIGNAL(aboutToHide()), this, SLOT(menuAboutToHide())); } }
MenuActionBinder::MenuActionBinder(QMenu* pMenu, QAction* pAction) : QObject(pAction) { connect(pMenu, SIGNAL(aboutToShow()), this, SLOT(onShowMenu())); connect(pMenu, SIGNAL(aboutToHide()), this, SLOT(onHideMenu())); pAction_ = pAction; keySequence_ = pAction->shortcut(); pAction->setShortcut(QKeySequence()); }
bool MessageWidgets::initConnections(IPluginManager *APluginManager, int &AInitOrder) { Q_UNUSED(AInitOrder); FPluginManager = APluginManager; IPlugin *plugin = APluginManager->pluginInterface("IOptionsManager").value(0,NULL); if (plugin) { FOptionsManager = qobject_cast<IOptionsManager *>(plugin->instance()); } plugin = APluginManager->pluginInterface("IXmppStreams").value(0,NULL); if (plugin) { FXmppStreams = qobject_cast<IXmppStreams *>(plugin->instance()); if (FXmppStreams) { connect(FXmppStreams->instance(),SIGNAL(jidAboutToBeChanged(IXmppStream *, const Jid &)), SLOT(onStreamJidAboutToBeChanged(IXmppStream *, const Jid &))); connect(FXmppStreams->instance(),SIGNAL(removed(IXmppStream *)),SLOT(onStreamRemoved(IXmppStream *))); } } plugin = APluginManager->pluginInterface("ITrayManager").value(0,NULL); if (plugin) { FTrayManager = qobject_cast<ITrayManager *>(plugin->instance()); if (FTrayManager) { connect(FTrayManager->instance(),SIGNAL(notifyActivated(int, QSystemTrayIcon::ActivationReason)), SLOT(onTrayNotifyActivated(int,QSystemTrayIcon::ActivationReason))); connect(FTrayManager->contextMenu(),SIGNAL(aboutToShow()),SLOT(onTrayContextMenuAboutToShow())); connect(FTrayManager->contextMenu(),SIGNAL(aboutToHide()),SLOT(onTrayContextMenuAboutToHide())); } } plugin = APluginManager->pluginInterface("IMainWindowPlugin").value(0,NULL); if (plugin) { FMainWindowPlugin = qobject_cast<IMainWindowPlugin*>(plugin->instance()); } plugin = APluginManager->pluginInterface("IAccountManager").value(0,NULL); if (plugin) { FAccountManager = qobject_cast<IAccountManager*>(plugin->instance()); } plugin = APluginManager->pluginInterface("IVCardPlugin").value(0,NULL); if (plugin) { FVCardPlugin = qobject_cast<IVCardPlugin*>(plugin->instance()); } connect(Options::instance(),SIGNAL(optionsOpened()),SLOT(onOptionsOpened())); connect(Options::instance(),SIGNAL(optionsClosed()),SLOT(onOptionsClosed())); return true; }
JoyControlStickContextMenu::JoyControlStickContextMenu(JoyControlStick *stick, QWidget *parent) : QMenu(parent), helper(stick) { this->stick = stick; helper.moveToThread(stick->thread()); connect(this, SIGNAL(aboutToHide()), this, SLOT(deleteLater())); }
JoyAxisContextMenu::JoyAxisContextMenu(JoyAxis *axis, QWidget *parent) : QMenu(parent), helper(axis) { this->axis = axis; helper.moveToThread(axis->thread()); connect(this, SIGNAL(aboutToHide()), this, SLOT(deleteLater())); }
KMMainView::KMMainView(QWidget *parent, const char *name, KActionCollection *coll) : QWidget(parent, name) { m_current = 0; m_first = true; // create widgets m_printerview = new KMPrinterView(this, "PrinterView"); m_printerpages = new KMPages(this, "PrinterPages"); m_pop = new QPopupMenu(this); m_toolbar = new KToolBar(this, "ToolBar"); m_toolbar->setMovingEnabled(false); m_plugin = new PluginComboBox(this, "Plugin"); /* m_menubar = new KMenuBar( this ); static_cast<KMenuBar*>( m_menubar )->setTopLevelMenu( false ); */ m_menubar = new KToolBar(this, "MenuBar", false, false); m_menubar->setIconText(KToolBar::IconTextRight); m_menubar->setMovingEnabled(false); // layout QVBoxLayout *m_layout = new QVBoxLayout(this, 0, 0); m_layout->addWidget(m_toolbar); m_layout->addWidget(m_menubar); m_boxlayout = new QBoxLayout(QBoxLayout::TopToBottom, 0, 0); m_layout->addLayout(m_boxlayout); m_boxlayout->addWidget(m_printerview); m_boxlayout->addWidget(m_printerpages); m_layout->addSpacing(5); m_layout->addWidget(m_plugin, 0); // connections connect(KMTimer::self(), SIGNAL(timeout()), SLOT(slotTimer())); connect(m_printerview, SIGNAL(printerSelected(const QString &)), SLOT(slotPrinterSelected(const QString &))); connect(m_printerview, SIGNAL(rightButtonClicked(const QString &, const QPoint &)), SLOT(slotRightButtonClicked(const QString &, const QPoint &))); connect(m_pop, SIGNAL(aboutToShow()), KMTimer::self(), SLOT(hold())); connect(m_pop, SIGNAL(aboutToHide()), KMTimer::self(), SLOT(release())); connect(m_manager, SIGNAL(updatePossible(bool)), SLOT(slotUpdatePossible(bool))); // actions if(coll) m_actions = coll; else m_actions = new KActionCollection(this); initActions(); // first update restoreSettings(); loadParameters(); // delay first update until KMManager is ready reset(i18n("Initializing manager..."), true, true); }
TopMenuBar::TopMenuBar() : MenuBar(), m_prevCursorPos(-1, -1), m_mouseTracker(new QTimer(this)), m_hideGlowTimer(new QTimer(this)), m_glowBar(new GlowBar()) { connect(this, SIGNAL(aboutToHide()), this, SLOT(slotAboutToHide())); connect(m_mouseTracker, SIGNAL(timeout()), this, SLOT(slotMouseTracker())); connect(m_hideGlowTimer, SIGNAL(timeout()), this, SLOT(slotHideGlowBar())); }
void syMenu::connectFakeSlots() { void sigaboutToHide (); void sigaboutToShow (); void sighovered ( QAction * action ); void sigtriggered ( QAction * action ); connect(this,SIGNAL(aboutToHide()),this, SLOT(sigaboutToHide()), Qt::DirectConnection); connect(this,SIGNAL(aboutToShow()),this, SLOT(sigaboutToShow()), Qt::DirectConnection); connect(this,SIGNAL(hovered(QAction*)),this, SLOT(sighovered(QAction*)), Qt::DirectConnection); connect(this,SIGNAL(triggered(QAction*)),this, SLOT(sigtriggered(QAction*)), Qt::DirectConnection); }
CMenu::CMenu(CommandsDef *def) : KPopupMenu(NULL) { m_def = def; m_param = NULL; m_bInit = false; setCheckable(true); connect(this, SIGNAL(aboutToShow()), this, SLOT(showMenu())); connect(this, SIGNAL(aboutToHide()), this, SLOT(hideMenu())); connect(this, SIGNAL(activated(int)), this, SLOT(menuActivated(int))); }
UserContextMenu::UserContextMenu(IMultiUserChatWindow *AMUCWindow, IChatWindow *AChatWindow) : Menu(AChatWindow->menuBarWidget()->menuBarChanger()->menuBar()) { FChatWindow = AChatWindow; FMUCWindow = AMUCWindow; setTitle(FChatWindow->contactJid().resource()); connect(this,SIGNAL(aboutToShow()),SLOT(onAboutToShow())); connect(this,SIGNAL(aboutToHide()),SLOT(onAboutToHide())); connect(FMUCWindow->multiUserChat()->instance(),SIGNAL(userPresence(IMultiUser *, int, const QString &)), SLOT(onMultiUserPresence(IMultiUser *, int, const QString &))); connect(FChatWindow->instance(),SIGNAL(contactJidChanged(const Jid &)),SLOT(onChatWindowContactJidChanged(const Jid &))); }
bool CustomMenu::popup(const QPoint & position) { if (menu_ == nullptr) { deleteLater(); return false; } connect(menu_.get(), SIGNAL(aboutToHide()), SLOT(deleteLater())); connect(menu_.get(), SIGNAL(triggered(QAction *)), SLOT(onActionTriggered(QAction *))); menu_->popup(position); return true; }
void TaskBarContainer::configure() { setFont(TaskBarSettings::taskbarFont()); showWindowListButton = TaskBarSettings::showWindowListBtn(); if (!showWindowListButton) { delete windowListButton; windowListButton = 0; delete windowListMenu; windowListMenu = 0; } else if (windowListButton == 0) { // window list button windowListButton = new SimpleButton(this); windowListMenu= new KWindowListMenu; connect(windowListButton, SIGNAL(pressed()), SLOT(showWindowListMenu())); connect(windowListMenu, SIGNAL(aboutToHide()), SLOT(windowListMenuAboutToHide())); // geometry QString icon; switch (direction) { case KPanelApplet::Up: icon = "1uparrow"; windowListButton->setMaximumHeight(BUTTON_MAX_WIDTH); break; case KPanelApplet::Down: icon = "1downarrow"; windowListButton->setMaximumHeight(BUTTON_MAX_WIDTH); break; case KPanelApplet::Left: icon = "1leftarrow"; windowListButton->setMaximumWidth(BUTTON_MAX_WIDTH); break; case KPanelApplet::Right: icon = "1rightarrow"; windowListButton->setMaximumWidth(BUTTON_MAX_WIDTH); break; } windowListButton->setPixmap(kapp->iconLoader()->loadIcon(icon, KIcon::Panel, 16)); windowListButton->setMinimumSize(windowListButton->sizeHint()); layout->insertWidget(0, windowListButton); windowListButton->show(); } }