From e20686b41867b6cc906240fa61b751e4711bf817 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Tue, 26 Mar 2019 19:52:51 +0100 Subject: [PATCH] gui: code cleanup --- src/be/nikiroo/fanfix/reader/ui/GuiReaderBook.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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(); } }); } -- 2.27.0