From 16afa90172c9b1facaa8888780ed8bb8bd93598c Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 08 Oct 2004 21:34:32 +0000 Subject: Use KeyPressed instead of KeyReleased for the Accelerator Key in the Image Display component. This fixes the double 'next' problem when going from the browser to the viewer/display --- (limited to 'noncore/graphics/opie-eye/gui') diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index b4f3110..5522131 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp @@ -25,9 +25,7 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name ImageView::~ImageView() { odebug << "Delete Imageview" << oendl; - if (m_viewManager) { - delete m_viewManager; - } + delete m_viewManager; } Opie::Core::OKeyConfigManager* ImageView::manager() @@ -55,6 +53,14 @@ void ImageView::initKeys() m_viewManager = new Opie::Core::OKeyConfigManager(m_cfg, "image_view_keys", lst, false,this, "image_view_keys" ); + /** + * Handle KeyEvents when they're pressed. This avoids problems + * with 'double next' on Return. + * The Return press would switch to this view and the return + * release would emit the dispNext Signal. + */ + m_viewManager->setEventMask( Opie::Core::OKeyConfigManager::MaskPressed ); + m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", Resource::loadPixmap("1to1"), ViewInfo, Opie::Core::OKeyPair(Qt::Key_I,0), @@ -146,7 +152,7 @@ void ImageView::focusInEvent(QFocusEvent *) if (fullScreen()) enableFullscreen(); } -void ImageView::hide() +void ImageView::hide() { if (fullScreen()) { m_ignore_next_in = true; -- cgit v0.9.0.2