Skip to content

Commit 6edb3f0

Browse files
committed
Popup menu logic update
1 parent 8bbdce7 commit 6edb3f0

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/main/widgets/specific/AudioSample.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,24 +1407,22 @@ namespace lsp
14071407

14081408
if (Position::rinside(&sSize, e->nLeft, e->nTop, xr))
14091409
{
1410-
if (sActive.get())
1410+
if ((e->nCode == ws::MCB_LEFT) && (flags & XF_LBUTTON))
14111411
{
1412-
if ((e->nCode == ws::MCB_LEFT) && (flags & XF_LBUTTON))
1413-
{
1412+
if (sActive.get())
14141413
sSlots.execute(SLOT_SUBMIT, this, NULL);
1415-
}
1416-
else if ((e->nCode == ws::MCB_RIGHT) && (flags & XF_RBUTTON))
1414+
}
1415+
else if ((e->nCode == ws::MCB_RIGHT) && (flags & XF_RBUTTON))
1416+
{
1417+
Menu *popup = sPopup.get();
1418+
if (popup != NULL)
14171419
{
1418-
Menu *popup = sPopup.get();
1419-
if (popup != NULL)
1420-
{
1421-
ws::rectangle_t sr;
1422-
Window *wnd = widget_cast<Window>(this->toplevel());
1423-
wnd->get_screen_rectangle(&sr);
1424-
sr.nLeft += e->nLeft;
1425-
sr.nTop += e->nTop;
1426-
popup->show(this, sr.nLeft, sr.nTop);
1427-
}
1420+
ws::rectangle_t sr;
1421+
Window *wnd = widget_cast<Window>(this->toplevel());
1422+
wnd->get_screen_rectangle(&sr);
1423+
sr.nLeft += e->nLeft;
1424+
sr.nTop += e->nTop;
1425+
popup->show(this, sr.nLeft, sr.nTop);
14281426
}
14291427
}
14301428
}

0 commit comments

Comments
 (0)