Add method to explicitly handle menu item sensitivy for the pop-up button.

This commit is contained in:
Hombre
2015-12-08 18:00:14 +01:00
committed by Adam Reichold
parent 5f59156bb0
commit 8f73377601
2 changed files with 10 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
* Class created by Jean-Christophe FRISCH, aka 'Hombre'
*/
#include <gtkmm.h>
#include "multilangmgr.h"
#include "popupcommon.h"
#include "../rtengine/safegtk.h"
@@ -135,6 +136,14 @@ void PopUpCommon::entrySelected (int i)
}
}
void PopUpCommon::setItemSensitivity (int i, bool isSensitive) {
Gtk::Menu_Helpers::MenuList items = menu->items();
if (i < items.size()) {
items[i].set_sensitive(isSensitive);
}
}
/*
* Set the button image with the selected item
*/

View File

@@ -68,6 +68,7 @@ private:
void showMenu(GdkEventButton* event);
void entrySelected (int i);
void setItemSensitivity (int i, bool isSensitive);
};