Author: axeld Date: 2011-03-21 16:32:23 +0100 (Mon, 21 Mar 2011) New Revision: 41069 Changeset: https://dev.haiku-os.org/changeset/41069 Modified: haiku/trunk/src/apps/showimage/ShowImageView.cpp haiku/trunk/src/apps/showimage/ShowImageWindow.cpp haiku/trunk/src/apps/showimage/ShowImageWindow.h Log: * Double click now toggles full screen, as in the MediaPlayer. Modified: haiku/trunk/src/apps/showimage/ShowImageView.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageView.cpp 2011-03-21 12:26:05 UTC (rev 41068) +++ haiku/trunk/src/apps/showimage/ShowImageView.cpp 2011-03-21 15:32:23 UTC (rev 41069) @@ -1071,10 +1071,18 @@ 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 & (B_PRIMARY_MOUSE_BUTTON | B_SECONDARY_MOUSE_BUTTON)) != 0) { Modified: haiku/trunk/src/apps/showimage/ShowImageWindow.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2011-03-21 12:26:05 UTC (rev 41068) +++ haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2011-03-21 15:32:23 UTC (rev 41069) @@ -88,7 +88,6 @@ 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 @@ 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, Modified: haiku/trunk/src/apps/showimage/ShowImageWindow.h =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageWindow.h 2011-03-21 12:26:05 UTC (rev 41068) +++ haiku/trunk/src/apps/showimage/ShowImageWindow.h 2011-03-21 15:32:23 UTC (rev 41069) @@ -41,6 +41,7 @@ kMsgDeleteCurrentFile = 'mDcF', MSG_SLIDE_SHOW = 'mSSW', kMsgStopSlideShow = 'msss', + MSG_FULL_SCREEN = 'mFSC', MSG_EXIT_FULL_SCREEN = 'mEFS', MSG_WINDOW_HAS_QUIT = 'wndq' };