Code simplification
This commit is contained in:
parent
71b5b16865
commit
b7c11c7c90
|
@ -583,8 +583,7 @@ void FMenuBar::onMouseDown (FMouseEvent* ev)
|
|||
|
||||
if ( mouse_y == 1 )
|
||||
{
|
||||
if ( mouse_x >= x1
|
||||
&& mouse_x < x2 )
|
||||
if ( mouse_x >= x1 && mouse_x < x2 )
|
||||
{
|
||||
// Mouse pointer over item
|
||||
if ( (*iter)->isEnabled() && ! (*iter)->isSelected() )
|
||||
|
@ -662,10 +661,9 @@ void FMenuBar::onMouseUp (FMouseEvent* ev)
|
|||
|
||||
if ( mouse_y == 1 )
|
||||
{
|
||||
if ( mouse_x >= x1
|
||||
&& mouse_x < x2
|
||||
&& (*iter)->isEnabled()
|
||||
&& (*iter)->isSelected() )
|
||||
if ( (*iter)->isEnabled() && (*iter)->isSelected() )
|
||||
{
|
||||
if ( mouse_x >= x1 && mouse_x < x2 )
|
||||
{
|
||||
// Mouse pointer over item
|
||||
if ( (*iter)->hasMenu() )
|
||||
|
@ -698,13 +696,14 @@ void FMenuBar::onMouseUp (FMouseEvent* ev)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ( (*iter)->isEnabled() && (*iter)->isSelected() )
|
||||
else
|
||||
{
|
||||
(*iter)->unsetSelected();
|
||||
if ( getSelectedItem() == *iter )
|
||||
setSelectedItem(0);
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue