From 60c23976e664661b9d93952ae91d7f83d455a14b Mon Sep 17 00:00:00 2001 From: Janus Date: Tue, 10 Mar 2015 20:40:57 +0000 Subject: [PATCH] Fix 11898. [ShowImage] Move toolbar buttons near the screen border in fullscreen mode Signed-off-by: John Scipione --- src/apps/showimage/ShowImageWindow.cpp | 12 ++++++++++++ src/apps/showimage/ShowImageWindow.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp index ae7a9faa31..306782878e 100644 --- a/src/apps/showimage/ShowImageWindow.cpp +++ b/src/apps/showimage/ShowImageWindow.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1286,6 +1287,7 @@ ShowImageWindow::_ToggleFullScreen() fToolBar->SetActionVisible(MSG_FULL_SCREEN, fFullScreen); _SetToolBarVisible(!fFullScreen && fShowToolBar); + _SetToolBarBorder(!fFullScreen); MoveTo(frame.left, frame.top); ResizeTo(frame.Width(), frame.Height()); @@ -1548,6 +1550,16 @@ ShowImageWindow::_SetToolBarVisible(bool visible, bool animate) } +void +ShowImageWindow::_SetToolBarBorder(bool visible) +{ + float inset = visible + ? ceilf(be_control_look->DefaultItemSpacing() / 2) : 0; + + fToolBar->GroupLayout()->SetInsets(inset, 0, inset, 0); +} + + bool ShowImageWindow::QuitRequested() { diff --git a/src/apps/showimage/ShowImageWindow.h b/src/apps/showimage/ShowImageWindow.h index ea593a35d2..83c0113f0f 100644 --- a/src/apps/showimage/ShowImageWindow.h +++ b/src/apps/showimage/ShowImageWindow.h @@ -105,6 +105,7 @@ private: void _SetToolBarVisible(bool visible, bool animate = false); + void _SetToolBarBorder(bool visible); private: ImageFileNavigator fNavigator;