From cf9f46bc60be5aa95a1e2a42b839d80746d0fbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 21 Mar 2011 15:32:23 +0000 Subject: [PATCH] * Double click now toggles full screen, as in the MediaPlayer. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41069 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/ShowImageView.cpp | 10 +++++++++- src/apps/showimage/ShowImageWindow.cpp | 3 +-- src/apps/showimage/ShowImageWindow.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index a95656171d..27f01dc2ed 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -1071,9 +1071,17 @@ ShowImageView::MouseDown(BPoint position) MakeFocus(true); BPoint point = ViewToImage(position); + int32 clickCount = 0; uint32 buttons = 0; - if (Window() != NULL && Window()->CurrentMessage() != NULL) + if (Window() != NULL && Window()->CurrentMessage() != NULL) { + clickCount = Window()->CurrentMessage()->FindInt32("clicks"); buttons = Window()->CurrentMessage()->FindInt32("buttons"); + } + + if (buttons == B_PRIMARY_MOUSE_BUTTON && clickCount == 2) { + Window()->PostMessage(MSG_FULL_SCREEN); + return; + } if (fHasSelection && fSelectionBox.Bounds().Contains(point) && (buttons diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp index cf10c4f1cc..8f4519aff5 100644 --- a/src/apps/showimage/ShowImageWindow.cpp +++ b/src/apps/showimage/ShowImageWindow.cpp @@ -88,7 +88,6 @@ enum { MSG_FLIP_LEFT_TO_RIGHT = 'mFLR', MSG_FLIP_TOP_TO_BOTTOM = 'mFTB', MSG_SLIDE_SHOW_DELAY = 'mSSD', - MSG_FULL_SCREEN = 'mFSC', MSG_SHOW_CAPTION = 'mSCP', MSG_PAGE_SETUP = 'mPSU', MSG_PREPARE_PRINT = 'mPPT', @@ -160,7 +159,7 @@ ShowImageWindow::ShowImageWindow(BRect frame, const entry_ref& ref, fToolBarView = new ToolBarView(viewFrame); // Add the tool icons. - + // fToolBarView->AddAction(MSG_FILE_OPEN, be_app, // tool_bar_icon(kIconDocumentOpen), B_TRANSLATE("Open"B_UTF8_ELLIPSIS)); fToolBarView->AddAction(MSG_FILE_PREV, this, diff --git a/src/apps/showimage/ShowImageWindow.h b/src/apps/showimage/ShowImageWindow.h index 0c36452cc3..847b6acfc8 100644 --- a/src/apps/showimage/ShowImageWindow.h +++ b/src/apps/showimage/ShowImageWindow.h @@ -41,6 +41,7 @@ enum { kMsgDeleteCurrentFile = 'mDcF', MSG_SLIDE_SHOW = 'mSSW', kMsgStopSlideShow = 'msss', + MSG_FULL_SCREEN = 'mFSC', MSG_EXIT_FULL_SCREEN = 'mEFS', MSG_WINDOW_HAS_QUIT = 'wndq' };