From c0777f792c3bb75e3f5fc048b531a06efe01f112 Mon Sep 17 00:00:00 2001 From: akir Date: Wed, 29 Sep 2004 09:58:11 +0000 Subject: fix to make separators are not clickable/selectable --- src/FbTk/Menu.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index b1e186d..b2c8fc7 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.85 2004/09/12 14:56:19 rathnor Exp $ +// $Id: Menu.cc,v 1.86 2004/09/29 09:58:11 akir Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -1083,7 +1083,7 @@ void Menu::buttonPressEvent(XButtonEvent &be) { int sbl = (be.x / menu.item_w), i = (be.y / theme().itemHeight()); int w = (sbl * menu.persub) + i; - if (validIndex(w)) { + if (validIndex(w) && isItemSelectable(static_cast(w))) { which_press = i; which_sbl = sbl; @@ -1138,7 +1138,7 @@ void Menu::buttonReleaseEvent(XButtonEvent &re) { w = (sbl * menu.persub) + i, p = (which_sbl * menu.persub) + which_press; - if (validIndex(w)) { + if (validIndex(w) && isItemSelectable(static_cast(w))) { if (p == w && isItemEnabled(w)) { if (re.x > ix && re.x < (signed) (ix + menu.item_w) && re.y > iy && re.y < (signed) (iy + theme().itemHeight())) { @@ -1146,11 +1146,11 @@ void Menu::buttonReleaseEvent(XButtonEvent &re) { itemSelected(re.button, w); } } - } - drawItem(p, - true, // clear - true); // transparent + drawItem(p, + true, // clear + true); // transparent + } } } -- cgit v0.11.2