Change detail gui
authorHyukSoon Choi <hs619.choi@samsung.com>
Thu, 21 Mar 2013 10:36:35 +0000 (19:36 +0900)
committerHyukSoon Choi <hs619.choi@samsung.com>
Thu, 21 Mar 2013 10:36:35 +0000 (19:36 +0900)
Change-Id: Ia88139d0c7aa053252654a46130b0a50eccad4b2
Signed-off-by: HyukSoon Choi <hs619.choi@samsung.com>
src/IvImageViewerForm.cpp

index 9beb02c..a8c3901 100644 (file)
@@ -49,14 +49,11 @@ static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Val
 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
 
-static const Rectangle RECT_CONTORL_BUTTON_PLAY (280, 400, 160, 160);
-static const Rectangle RECT_LANDSCAP_CONTORL_BUTTON_PLAY (560, 216, 160, 160);
-
-static const Rectangle RECT_DETAILS_CONTORL_PANEL (0, 0, 720, 1008);
-static const Rectangle RECT_LANDSCAPE_DETAILS_CONTORL_PANEL (0, 0, 1280, 484);
 static const Rectangle RECT_DETAILS_CONTORL_LABEL (20, 0, 200, 48);
 
-static const int GAP_LABEL_END = 60;
+static const int W_PLAY_BUTTON = 160;
+static const int H_PLAY_BUTTON = 160;
+
 static const int GAP_W_POPUP_ITEM = 5;
 static const int W_DELETE_POPUP = 600;
 static const int H_DELETE_POPUP = 300;
@@ -80,19 +77,18 @@ static const int Y_RENAME_BUTTON = 100;
 static const int H_RENAME_BUTTON = 64;
 static const int W_RENAME_BUTTON = 64;
 
+static const int GAP_W_END_OF_LABEL = 60;
 static const int X_DETAIL_FILEINFO_LABEL = 20;
-static const int W_DETAIL_FILEINFO_LABEL = 420;
 static const int H_DETAIL_FILEINFO_LABEL = 50;
 static const int H_DETAIL_MAIN_TEXT = 48;
 static const int H_DETAIL_SUB_TEXT = 42;
-static const int GAP_H_DETAIL_TEXT = 8;
-static const int W_DETAIL_FILEINFO_VALUE_LABEL = 650;
+static const int GAP_H_DETAIL_TEXT = 26;
 static const int H_DETAIL_FILEINFO_VALUE_LABEL = 56;
 
 static const int X_MORE = 55;
 
-static const int DETAIL_SUB_FONT_SIZE = 42;
-static const int DETAIL_MAIN_FONT_SIZE = 48;
+static const int DETAIL_SUB_FONT_SIZE = 32;
+static const int DETAIL_MAIN_FONT_SIZE = 36;
 static const int DETAIL_COUNT_MAX = 9;
 
 ImageViewerForm::ImageViewerForm(void)
@@ -120,16 +116,6 @@ ImageViewerForm::ImageViewerForm(void)
 , __pPresentationModel(null)
 {
        AppLogDebug("ENTER");
-
-       __pDetail_FileInfo_Value_Label[0] = null;
-       __pDetail_FileInfo_Value_Label[1] = null;
-       __pDetail_FileInfo_Value_Label[2] = null;
-       __pDetail_FileInfo_Value_Label[3] = null;
-       __pDetail_FileInfo_Value_Label[4] = null;
-       __pDetail_FileInfo_Value_Label[5] = null;
-       __pDetail_FileInfo_Value_Label[6] = null;
-       __pDetail_FileInfo_Value_Label[7] = null;
-       __pDetail_FileInfo_Value_Label[8] = null;
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -259,30 +245,14 @@ ImageViewerForm::OnOrientationChanged(const Control &source, OrientationStatus o
                ShowPanelDetail(false);
        }
 
-       if (orientationStatus == ORIENTATION_STATUS_PORTRAIT ||
-                       orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
-       {
-               Rectangle clientRect = GetClientAreaBounds();
-               Rectangle rect = GetBounds();
-
-               __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
-               __pPlayButton->SetBounds(Rectangle(RECT_CONTORL_BUTTON_PLAY.x, RECT_CONTORL_BUTTON_PLAY.y,
-                               RECT_CONTORL_BUTTON_PLAY.width, RECT_CONTORL_BUTTON_PLAY.height));
-
-               Invalidate(true);
-       }
-       else if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE ||
-                       orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
-       {
-               Rectangle clientRect = GetClientAreaBounds();
-               Rectangle rect = GetBounds();
+       Rectangle clientRect = GetClientAreaBounds();
+       Rectangle rect = GetBounds();
 
-               __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
-               __pPlayButton->SetBounds(Rectangle(RECT_LANDSCAP_CONTORL_BUTTON_PLAY.x, RECT_LANDSCAP_CONTORL_BUTTON_PLAY.y,
-                               RECT_LANDSCAP_CONTORL_BUTTON_PLAY.width, RECT_LANDSCAP_CONTORL_BUTTON_PLAY.height));
+       __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
+       __pPlayButton->SetBounds(Rectangle(clientRect.width / 2 - W_PLAY_BUTTON / 2,
+                       clientRect.height / 2 - W_PLAY_BUTTON / 2, W_PLAY_BUTTON, H_PLAY_BUTTON));
 
-               Invalidate(true);
-       }
+       Invalidate(true);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -310,7 +280,10 @@ ImageViewerForm::InitializeDisplay(AppControlMode status)
                __pPlayButton = new (std::nothrow) Button();
                if (__pPlayButton != null)
                {
-                       __pPlayButton->Construct(RECT_CONTORL_BUTTON_PLAY);
+                       Rectangle clientRect = GetClientAreaBounds();
+
+                       __pPlayButton->Construct(Rectangle(clientRect.width / 2 - W_PLAY_BUTTON / 2,
+                                       clientRect.height / 2 - W_PLAY_BUTTON / 2, W_PLAY_BUTTON, H_PLAY_BUTTON));
                        __pPlayButton->SetActionId(ACTION_ID_CONTORL_BUTTON_PLAY);
                        AddControl(*__pPlayButton);
 
@@ -413,7 +386,10 @@ ImageViewerForm::InitializeDisplay(AppControlMode status)
                __pPlayButton = new (std::nothrow) Button();
                if (__pPlayButton != null)
                {
-                       __pPlayButton->Construct(RECT_CONTORL_BUTTON_PLAY);
+                       Rectangle clientRect = GetClientAreaBounds();
+
+                       __pPlayButton->Construct(Rectangle(clientRect.width / 2 - W_PLAY_BUTTON / 2,
+                                       clientRect.height / 2 - W_PLAY_BUTTON / 2, W_PLAY_BUTTON, H_PLAY_BUTTON));
                        __pPlayButton->SetActionId(ACTION_ID_CONTORL_BUTTON_PLAY);
                        AddControl(*__pPlayButton);
 
@@ -613,7 +589,8 @@ ImageViewerForm::InitializePanelDetail()
                return E_INVALID_STATE;
        }
 
-       result r = __pScrollPanel->Construct(RECT_DETAILS_CONTORL_PANEL);
+       Rectangle clientRect = GetClientAreaBounds();
+       result r = __pScrollPanel->Construct(Rectangle(0, 0, clientRect.width, clientRect.height));
        if (r != E_SUCCESS)
        {
                AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
@@ -624,10 +601,10 @@ ImageViewerForm::InitializePanelDetail()
        __pDetail_Label = new (std::nothrow) Label();
        __pDetail_Label->Construct(RECT_DETAILS_CONTORL_LABEL, ResourceManager::GetString(L"IDS_COM_BODY_DETAILS"));
        __pScrollPanel->AddControl(*__pDetail_Label);
-       __pDetail_Label->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+       __pDetail_Label->SetTextVerticalAlignment(ALIGNMENT_TOP);
        __pDetail_Label->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
        __pDetail_Label->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
-       __pDetail_Label->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
+       __pDetail_Label->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
 
        for (int i = 0; i < DETAIL_COUNT_MAX; ++i)
        {
@@ -635,25 +612,37 @@ ImageViewerForm::InitializePanelDetail()
                __pDetail_FileInfo_Label[i]->Construct(
                                Rectangle(X_DETAIL_FILEINFO_LABEL,
                                                GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT + H_DETAIL_SUB_TEXT) * i,
-                                               W_DETAIL_FILEINFO_LABEL, H_DETAIL_FILEINFO_LABEL), ResourceManager::GetString(arrayId[i]));
+                                               clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_LABEL), ResourceManager::GetString(arrayId[i]));
                __pScrollPanel->AddControl(*__pDetail_FileInfo_Label[i]);
 
-               __pDetail_FileInfo_Label[i]->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+               __pDetail_FileInfo_Label[i]->SetTextVerticalAlignment(ALIGNMENT_TOP);
                __pDetail_FileInfo_Label[i]->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
                __pDetail_FileInfo_Label[i]->SetTextColor(Color::GetColor(COLOR_ID_GREY));
-               __pDetail_FileInfo_Label[i]->SetTextConfig(DETAIL_SUB_FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
+               __pDetail_FileInfo_Label[i]->SetTextConfig(DETAIL_SUB_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
 
                __pDetail_FileInfo_Value_Label[i] = new (std::nothrow) Label();
-               __pDetail_FileInfo_Value_Label[i]->Construct(
-                               Rectangle(X_DETAIL_FILEINFO_LABEL,
-                                               GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
-                                               W_DETAIL_FILEINFO_VALUE_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL), L"");
+
+               if (i == DETAIL_COUNT_MAX - 1)
+               {
+                       __pDetail_FileInfo_Value_Label[i]->Construct(
+                                                               Rectangle(X_DETAIL_FILEINFO_LABEL,
+                                                                               GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+                                                                               clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL * 3), L"");
+               }
+               else
+               {
+                       __pDetail_FileInfo_Value_Label[i]->Construct(
+                                                               Rectangle(X_DETAIL_FILEINFO_LABEL,
+                                                                               GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+                                                                               clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL), L"");
+               }
+
                __pScrollPanel->AddControl(*__pDetail_FileInfo_Value_Label[i]);
 
-               __pDetail_FileInfo_Value_Label[i]->SetTextVerticalAlignment(ALIGNMENT_BOTTOM);
+               __pDetail_FileInfo_Value_Label[i]->SetTextVerticalAlignment(ALIGNMENT_TOP);
                __pDetail_FileInfo_Value_Label[i]->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
                __pDetail_FileInfo_Value_Label[i]->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
-               __pDetail_FileInfo_Value_Label[i]->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
+               __pDetail_FileInfo_Value_Label[i]->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
        }
 
        __pScrollPanel->SetBackgroundColor(COLOR_HEADER_CONTORL_PANEL);
@@ -828,17 +817,7 @@ ImageViewerForm::SetDetailInfo(void)
        AppLogDebug("ENTER");
 
        Rectangle clientRect = GetClientAreaBounds();
-       AppLogDebug("PORTRAIT GetClientAreaBounds(%d %d %d %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
-       OrientationStatus currentOrientaton = GetOrientationStatus();
-
-       if (currentOrientaton == ORIENTATION_STATUS_LANDSCAPE || currentOrientaton == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
-       {
-               __pScrollPanel->SetBounds(Rectangle(0, 0, clientRect.width, RECT_LANDSCAPE_DETAILS_CONTORL_PANEL.height));
-       }
-       else
-       {
-               __pScrollPanel->SetBounds(0, 0, clientRect.width, RECT_DETAILS_CONTORL_PANEL.height);
-       }
+       __pScrollPanel->SetBounds(0, 0, clientRect.width, clientRect.height);
 
        int currentIndex = __pGallery->GetCurrentItemIndex();
        String strFilePath = __pPresentationModel->GetFilePathAt(currentIndex);
@@ -890,6 +869,8 @@ ImageViewerForm::SetDetailInfo(void)
        strResult[6] = ResourceManager::GetString(L"IDS_COM_BODY_UNKNOWN");
        strResult[7] = ResourceManager::GetString(L"IDS_COM_BODY_UNKNOWN");
        strResult[8] = strFilePath;
+       String fileName = File::GetFileName(strFilePath);
+       strResult[8].Remove(strResult[8].GetLength() - fileName.GetLength(), fileName.GetLength());
 
        if (__initializeDisplayModeCurrent == APPCONTROL_MODE_WEB_LINK)
        {
@@ -919,8 +900,6 @@ ImageViewerForm::SetDetailInfo(void)
                                        strResult[6].Format(FORMAT_BUFFER_SIZE, L"%f", pImgMeta->GetLatitude());
                                        strResult[7].Format(FORMAT_BUFFER_SIZE, L"%f", pImgMeta->GetLongitude());
                                }
-
-                               strResult[8] = imageContentInfo.GetContentPath();
                        }
                        delete pImgMeta;
                }
@@ -941,16 +920,12 @@ ImageViewerForm::SetDetailInfo(void)
                                {
                                        strResult[5].Format(FORMAT_BUFFER_SIZE, L"%ls", videoContentInfo.GetLocationTag().GetPointer());
                                }
-
-                               strResult[8] = videoContentInfo.GetContentPath();
                        }
                }
        }
 
        for (int i = 0; i < DETAIL_COUNT_MAX; ++i)
        {
-               __pDetail_FileInfo_Value_Label[i]->SetBounds(X_DETAIL_FILEINFO_LABEL, GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
-                               clientRect.width - GAP_LABEL_END, H_DETAIL_FILEINFO_VALUE_LABEL);
                __pDetail_FileInfo_Value_Label[i]->SetText(strResult[i]);
                __pDetail_FileInfo_Value_Label[i]->RequestRedraw();
        }
@@ -1502,27 +1477,13 @@ ImageViewerForm::OnSceneActivatedN(const SceneId& previousSceneId,
                const SceneId& currentSceneId, IList* pArgs)
 {
        AppLogDebug("ENTER");
-       OrientationStatus status = GetOrientationStatus();
-       if (status == ORIENTATION_STATUS_PORTRAIT ||
-                       status == ORIENTATION_STATUS_PORTRAIT_REVERSE)
-       {
-               AppLogDebug("ORIENTATION_STATUS : PORTRAIT");
-               Rectangle clientRect = GetClientAreaBounds();
-               Rectangle rect = GetBounds();
-               __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
-               __pPlayButton->SetBounds(RECT_CONTORL_BUTTON_PLAY);
-               __pScrollPanel->SetBounds(RECT_DETAILS_CONTORL_PANEL);
-       }
-       else if (status == ORIENTATION_STATUS_LANDSCAPE ||
-                       status == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
-       {
-               AppLogDebug("ORIENTATION_STATUS : LANDSCAPE");
-               Rectangle clientRect = GetClientAreaBounds();
-               Rectangle rect = GetBounds();
-               __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
-               __pPlayButton->SetBounds(RECT_LANDSCAP_CONTORL_BUTTON_PLAY);
-               __pScrollPanel->SetBounds(RECT_LANDSCAPE_DETAILS_CONTORL_PANEL);
-       }
+
+       Rectangle clientRect = GetClientAreaBounds();
+       Rectangle rect = GetBounds();
+
+       __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
+       __pScrollPanel->SetBounds(Rectangle(0, 0, clientRect.width, clientRect.height));
+       __pPlayButton->SetBounds(Rectangle(clientRect.width / 2 - 80, clientRect.height / 2 - 80, 160, 160));
 
        if (previousSceneId == IDSCN_IMAGE_NAME_EDITOR && currentSceneId == IDSCN_IMAGE_VIEWER)
        {