From: Niki Roo Date: Tue, 26 Mar 2019 18:52:51 +0000 (+0100) Subject: gui: code cleanup X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=e20686b41867b6cc906240fa61b751e4711bf817;p=fanfix-jexer.git gui: code cleanup --- diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReaderBook.java b/src/be/nikiroo/fanfix/reader/ui/GuiReaderBook.java index 15d2ad4..f0e1371 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReaderBook.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReaderBook.java @@ -154,14 +154,14 @@ class GuiReaderBook extends JPanel { addMouseListener(new MouseListener() { @Override public void mouseReleased(MouseEvent e) { - if (e.isPopupTrigger()) { + if (isEnabled() && e.isPopupTrigger()) { popup(e); } } @Override public void mousePressed(MouseEvent e) { - if (e.isPopupTrigger()) { + if (isEnabled() && e.isPopupTrigger()) { popup(e); } } @@ -188,6 +188,7 @@ class GuiReaderBook extends JPanel { } lastClick = now; + e.consume(); } } @@ -206,6 +207,8 @@ class GuiReaderBook extends JPanel { listener.select((GuiReaderBook.this)); listener.popupRequested(GuiReaderBook.this, e); } + + e.consume(); } }); }