Fixed Nabi Issues
authorVinay Sachdeva <v.sachdeva@samsung.com>
Thu, 16 May 2013 21:16:38 +0000 (02:46 +0530)
committerVinay Sachdeva <v.sachdeva@samsung.com>
Thu, 16 May 2013 21:16:38 +0000 (02:46 +0530)
Change-Id: I268a5a465d1c512a93c935a1ea1ca0767c12ae0d
Signed-off-by: Vinay Sachdeva <v.sachdeva@samsung.com>
src/IntAddressbar.cpp
src/IntBookmarkListForm.cpp
src/IntHistoryListForm.cpp
src/IntMainForm.cpp

index 3172c48..b201e55 100644 (file)
@@ -351,7 +351,7 @@ Addressbar::SetUrl(const String& url)
                }
 
                __pAddressbarUrlField->Invalidate(false);
-               __pAddressbarUrlField->SetCursorPosition(0);
+               __pAddressbarUrlField->SetCursorPosition(__pAddressbarUrlField->GetTextLength());
        }
 }
 
@@ -753,7 +753,7 @@ Addressbar::OnKeypadClosed(Tizen::Ui::Control& source)
                SetShowState(false);
                if(__pListener != null)
                {
-                       __pListener->OnAddressBarKeypadClosed(*this,false);
+                       __pListener->OnAddressBarKeypadClosed(*this,true);
                }
        }
        __isCancelledClicked = false;
index 815adf8..f8c7475 100644 (file)
@@ -662,9 +662,9 @@ BookmarkListForm::CreateItem(int index, int itemWidth)
                }
                pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null);
                pItem->AddElement(Rectangle(x_Margin_Title, 0, width_Title, itemHeight - height_Url), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
-               if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
-                       pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
-               else
+//             if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
+//                     pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
+//             else
                        pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
 
                if (pBitmap != null)
@@ -1088,10 +1088,10 @@ BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui:
        }
        if ( __pSearchBar != null && keypadAction == KEYPAD_ACTION_SEARCH)
        {
-               if (__pSearchBar->GetText().GetLength() == 0)
-               {
-                       return;
-               }
+//             if (__pSearchBar->GetText().GetLength() == 0)
+//             {
+//                     return;
+//             }
 
                if (__pSearchBar != null)
                {
index a3fdda1..64bbc58 100644 (file)
@@ -85,6 +85,11 @@ HistoryListForm::~HistoryListForm(void)
                __pBookmarkList->RemoveAll(false);
                delete __pBookmarkList;
        }
+       if (__pSearchListView)
+       {
+               delete __pSearchListView;
+               __pSearchListView = null;
+       }
 }
 
 bool
@@ -597,9 +602,9 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        r = pItem->AddElement(Rectangle(104, 10, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 60), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), 44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
        TryCatch(!IsFailed(r), "CreateItem failed with %s",GetErrorMessage(r));
 
-       if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
-               r = pItem->AddElement(Rectangle(104, 70, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 48), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
-       else
+//     if(__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
+//             r = pItem->AddElement(Rectangle(104, 70, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 48), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true);
+//     else
                r = pItem->AddElement(Rectangle(104, 70, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 48), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true);
        TryCatch(!IsFailed(r), "CreateItem failed with %s",GetErrorMessage(r));
        if ( pBookmarkBitmap != null)
index b0ae21e..858196f 100644 (file)
@@ -843,7 +843,8 @@ MainForm::InitImageLinkContextMenu(Tizen::Graphics::Point p)
                __pImageMenu = null;
        }
 
-       p.y = p.y + __pAddressbar->GetHeight();
+       if(__pAddressbar->GetShowState() == true)
+               p.y = p.y + __pAddressbar->GetHeight();
 //     if (p.y < 100)
 //     {
 //             direction = CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD;
@@ -2210,11 +2211,11 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        String idElement = __pHitElementResult->GetAttributeValue(L"id");
                        String nameElement = __pHitElementResult->GetAttributeValue(L"name");
                        AppLog("MainForm::IDA_PASTE_TEXT_CLICKED id is %ls",idElement.GetPointer());
-//                     String script = L"function insertAtCursor(myField, myValue) {   if (document.selection) {               myField.focus();                sel = document.selection.createRange();                 sel.text = myValue;     }               else if (myField.selectionStart || myField.selectionStart == '0'){              var startPos = myField.selectionStart;          var endPos = myField.selectionEnd;              myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length);          } else {                        myField.value += myValue;               }       } ";
-                       String script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   document.getElementById(myField).focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (document.getElementById(myField).selectionStart || document.getElementById(myField).selectionStart == '0'){   var startPos = document.getElementById(myField).selectionStart;   var endPos = document.getElementById(myField).selectionEnd;   document.getElementById(myField).value = document.getElementById(myField).value.substring(0, startPos)+ myValue + document.getElementById(myField).value.substring(endPos, document.getElementById(myField).value.length);   } else {    document.getElementById(myField).value += myValue;   }  } ";//by hyunn.lee
 
+                       String script;
                        if(idElement.GetLength() != 0)
                        {
+                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   document.getElementById(myField).focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (document.getElementById(myField).selectionStart || document.getElementById(myField).selectionStart == '0'){   var startPos = document.getElementById(myField).selectionStart;   var endPos = document.getElementById(myField).selectionEnd;   document.getElementById(myField).value = document.getElementById(myField).value.substring(0, startPos)+ myValue + document.getElementById(myField).value.substring(endPos, document.getElementById(myField).value.length);   } else {    document.getElementById(myField).value += myValue;   }  } ";
                                script.Append("insertAtCursor('");
                                script.Append(idElement);
                                script.Append("',");
@@ -2224,6 +2225,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        }
                        else if (nameElement.GetLength() != 0)
                        {
+                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   document.getElementByName(myField)[0].focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (myField.selectionStart || myField.selectionStart == '0'){   var startPos = myField.selectionStart;   var endPos = myField.selectionEnd;   myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length);   } else {    document.getElementByName(myField)[0].value += myValue;   }  } ";
                                script.Append("insertAtCursor(document.getElementsByName('");
                                script.Append(nameElement);
                                script.Append("')[0],");
@@ -3188,9 +3190,15 @@ MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState)
        if(__pAddressbar)
                __pAddressbar->SetShowState(false);
        if(__pFooterPanel)
+       {
                __pFooterPanel->SetShowState(true);
+
+               __pFooterPanel->Invalidate(false);
+       }
 //     if(__pWebViewer)
 //             __pWebViewer->SetFocus();
+//     if(__pMoreButton)
+//     __pMoreButton->SetFocus();
        if(__pFooterUrlField)
        {
                __pFooterUrlField->SetFocusable(true);
@@ -3430,7 +3438,11 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph
        if (__pWebViewer != null)
        {
                AppLog("MainForm::OnWebPageBlockSelected web not null");
-               __pHitElementResult = __pWebViewer->GetElementByPointN(endPoint);
+               __pHitElementResult = __pWebViewer->GetElementByPointN(startPoint);
+               if(GetLastResult() == E_INVALID_ARG)
+               {
+                       __pHitElementResult = __pWebViewer->GetElementByPointN(endPoint);
+               }
        }
 
        if (__pHitElementResult == null)