From 13d42e6e54e7365adfd2b018458f7a8734a60601 Mon Sep 17 00:00:00 2001 From: Vinay Sachdeva Date: Sat, 8 Jun 2013 04:45:47 +0530 Subject: [PATCH] Fixed Nabi Issues Change-Id: I5962edd6f2b464ddc2f6f61101f18a3d00234821 Signed-off-by: Vinay Sachdeva --- inc/IntAddBookmarkForm.h | 1 + inc/IntAddressbar.h | 2 + inc/IntBookmarkListForm.h | 1 + inc/IntCommonLib.h | 8 ++ inc/IntEditBookmarkListForm.h | 1 + inc/IntEditHistoryListForm.h | 1 + inc/IntFormFactory.h | 8 ++ inc/IntHistoryListForm.h | 13 +-- inc/IntMainForm.h | 3 +- inc/IntMultipleWindowForm.h | 2 +- inc/IntMultipleWindowPresentationModel.h | 2 +- inc/IntSettingForm.h | 1 + inc/IntSharePopup.h | 6 +- res/screen-size-normal/IDL_ADD_BOOKMARK.xml | 33 +++---- res/screen-size-normal/IDL_EDIT_BOOKMARK_LIST.xml | 31 +++---- res/screen-size-normal/IDL_EDIT_HISTORY_LIST.xml | 29 +++--- src/IntAddBookmarkForm.cpp | 33 ++++--- src/IntAddressbar.cpp | 6 ++ src/IntBookmarkListForm.cpp | 17 ++-- src/IntCommonLib.cpp | 43 +++++++++ src/IntEditBookmarkListForm.cpp | 20 +++-- src/IntEditHistoryListForm.cpp | 11 ++- src/IntFormFactory.cpp | 102 +++++++++++++++++++++- src/IntHistoryListForm.cpp | 12 +-- src/IntInternetApp.cpp | 4 +- src/IntMainForm.cpp | 72 +++++++++------ src/IntMultipleWindowForm.cpp | 16 ++-- src/IntMultipleWindowPresentationModel.cpp | 2 +- src/IntSettingForm.cpp | 3 + src/IntSettingPresentationModel.cpp | 12 ++- src/IntSharePopup.cpp | 15 +++- 31 files changed, 382 insertions(+), 128 deletions(-) diff --git a/inc/IntAddBookmarkForm.h b/inc/IntAddBookmarkForm.h index 38614fc..a7d7bfc 100644 --- a/inc/IntAddBookmarkForm.h +++ b/inc/IntAddBookmarkForm.h @@ -112,6 +112,7 @@ class AddBookmarkForm static const int IDA_LIST_LEFT_SIDE_MARGIN; static const int IDA_LIST_LEFT_SIDE_MARGIN_DROPDOWN; private: + int __fontSize; int __folderCount; // Number of bookmark folders Tizen::Base::String __folderName; // Selected folder name int __listHeight; diff --git a/inc/IntAddressbar.h b/inc/IntAddressbar.h index 57579bd..18623e5 100644 --- a/inc/IntAddressbar.h +++ b/inc/IntAddressbar.h @@ -170,6 +170,8 @@ class Addressbar void SetAddressbarURLFocus(); Tizen::Base::String GetAddressbarURL(); + + bool HasCurrentFocus(void); private: /** * @brief Updates the progressbar Value. diff --git a/inc/IntBookmarkListForm.h b/inc/IntBookmarkListForm.h index be2b9fa..9529740 100644 --- a/inc/IntBookmarkListForm.h +++ b/inc/IntBookmarkListForm.h @@ -143,6 +143,7 @@ class BookmarkListForm Tizen::Base::String __searchText; int __selectedindex; Tizen::Base::String __selectedTitle; + int __fontSize; }; #endif //_INT_BOOKMARK_LIST_FORM_H_ diff --git a/inc/IntCommonLib.h b/inc/IntCommonLib.h index 3727855..995d0da 100644 --- a/inc/IntCommonLib.h +++ b/inc/IntCommonLib.h @@ -98,6 +98,14 @@ public: */ static Tizen::Base::String GetString(const Tizen::Base::String& resourceId); + /** + * Gets the font size from the settings + * + * @return Int + * @param[in] void + * @remarks Gets the font size + */ + static int GetFontSize(void); private: static CommonBitmapTable __commonBitmapTable[]; diff --git a/inc/IntEditBookmarkListForm.h b/inc/IntEditBookmarkListForm.h index 3ac820f..5f365d3 100644 --- a/inc/IntEditBookmarkListForm.h +++ b/inc/IntEditBookmarkListForm.h @@ -112,6 +112,7 @@ private: Tizen::Ui::Controls::ListView* __pListview; Tizen::Base::Collection::ArrayList* __pSelectedList; int __selectedItemCount; + int __fontSize; }; #endif /* _INT_EDIT_BOOKMARK_LIST_FORM_H_ */ diff --git a/inc/IntEditHistoryListForm.h b/inc/IntEditHistoryListForm.h index 23f2850..899668a 100644 --- a/inc/IntEditHistoryListForm.h +++ b/inc/IntEditHistoryListForm.h @@ -128,6 +128,7 @@ class EditHistoryListForm Tizen::Ui::Controls::CheckButton* __pSelectAllCheck; Tizen::Ui::Controls::Label* __pSelectedLabel; int __selectedCount; + int __fontSize; class GroupItemClass :public Tizen::Base::Object diff --git a/inc/IntFormFactory.h b/inc/IntFormFactory.h index eccfabf..389575d 100644 --- a/inc/IntFormFactory.h +++ b/inc/IntFormFactory.h @@ -52,6 +52,7 @@ extern const wchar_t* IDL_FORM_BRIGHTNESS_SCENE; */ class FormFactory : public Tizen::Ui::Scenes::IFormFactory + , public Tizen::Ui::Scenes::ISceneEventListener { public: /** @@ -72,6 +73,13 @@ public: * @remarks To work properly, the existing formId and sceneId has to be passed. */ virtual Tizen::Ui::Controls::Form* CreateFormN(const Tizen::Base::String& formId, const Tizen::Ui::Scenes::SceneId& sceneId); + void SetFontSize(Tizen::Ui::Container& container, int font); + + virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, + const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs); + + virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, + const Tizen::Ui::Scenes::SceneId& nextSceneId){} }; #endif // _INT_SCENE_FACTORY_H_ diff --git a/inc/IntHistoryListForm.h b/inc/IntHistoryListForm.h index 987954d..0a7444d 100644 --- a/inc/IntHistoryListForm.h +++ b/inc/IntHistoryListForm.h @@ -134,6 +134,7 @@ private: bool __searchHistory; Tizen::Base::String __searchText; Tizen::Ui::Scenes::SceneId __previousSceneId; + int __fontSize; }; /** @@ -143,11 +144,7 @@ private: class GroupItemClass :public Tizen::Base::Object { -private: - Tizen::Base::DateTime __startTime; - Tizen::Base::DateTime __endTime; - Tizen::Base::String __titleText; - Tizen::Base::Collection::ArrayList* __pData; + public: GroupItemClass(void); @@ -218,5 +215,11 @@ public: */ void SetHistoryData(Tizen::Base::Collection::ArrayList* pData); +private: + Tizen::Base::DateTime __startTime; + Tizen::Base::DateTime __endTime; + Tizen::Base::String __titleText; + Tizen::Base::Collection::ArrayList* __pData; + }; #endif /* _INT_HISTORY_LIST_FORM_H_ */ diff --git a/inc/IntMainForm.h b/inc/IntMainForm.h index 6c983e9..10b9711 100644 --- a/inc/IntMainForm.h +++ b/inc/IntMainForm.h @@ -223,6 +223,7 @@ public: virtual void OnWebKeypadClosed(Tizen::Web::Controls::Web& source); virtual void OnWebKeypadOpened(Tizen::Web::Controls::Web& source); virtual void OnWebKeypadWillOpen(Tizen::Web::Controls::Web& source); + virtual void OnWebKeypadBoundsChanged(Tizen::Web::Controls::Web& source); //ITouchEventListener virtual void OnTouchDoublePressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo); @@ -385,7 +386,7 @@ private: Tizen::Ui::Controls::Button* __pClearBtn; Tizen::Ui::Controls::Button* __pReaderBtn; Tizen::Graphics::Point __longPressPoint; - + int __fontSize; }; #endif //_INT_MAIN_FORM_H_ diff --git a/inc/IntMultipleWindowForm.h b/inc/IntMultipleWindowForm.h index 220c482..dba45cd 100644 --- a/inc/IntMultipleWindowForm.h +++ b/inc/IntMultipleWindowForm.h @@ -156,7 +156,7 @@ private: Tizen::Graphics::Bitmap* __pListDeleteImage; ConfirmationPopup* __pConfirmationPopup; Tizen::Graphics::Point __startPosition; - + int __fontSize; }; #endif /* _INT_MULTIPLE_WINDOW_FORM_H_ */ diff --git a/inc/IntMultipleWindowPresentationModel.h b/inc/IntMultipleWindowPresentationModel.h index 2bccb4f..903dbfb 100644 --- a/inc/IntMultipleWindowPresentationModel.h +++ b/inc/IntMultipleWindowPresentationModel.h @@ -91,7 +91,7 @@ public: *@param[in] no input parameter *@retval no return value */ - WindowInfo* CreateNewMainViewScene(const Tizen::Base::String& Url = L"", bool isAppControlTriggered = false); + WindowInfo* CreateNewMainViewSceneN(const Tizen::Base::String& Url = L"", bool isAppControlTriggered = false); /** * To get active Window URL and title diff --git a/inc/IntSettingForm.h b/inc/IntSettingForm.h index 5292679..a10396b 100644 --- a/inc/IntSettingForm.h +++ b/inc/IntSettingForm.h @@ -203,6 +203,7 @@ private: Tizen::Ui::Controls::Popup* __pResetPopup; WindowInfo* __pWindowInfo; // Contains window information of current scene bool __isCurrentPageDisable; + int __fontSize; }; diff --git a/inc/IntSharePopup.h b/inc/IntSharePopup.h index 810fa47..0905fa0 100644 --- a/inc/IntSharePopup.h +++ b/inc/IntSharePopup.h @@ -85,6 +85,7 @@ private: class SharePopup : public Tizen::App::IAppControlEventListener + , public Tizen::Base::Runtime::ITimerEventListener , public Tizen::Ui::Controls::IListViewItemEventListener , public Tizen::Ui::Controls::IListViewItemProvider , public Tizen::Ui::Controls::Popup @@ -123,6 +124,9 @@ class SharePopup void RemoveAllShareInfo(); + //ITimerEventListener + virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer); + //IActionEventListener virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); @@ -169,7 +173,7 @@ class SharePopup Tizen::Ui::Controls::ListView* __pList; Tizen::Base::Collection::ArrayList* __pShareList; bool __appControlOngoing; - + Tizen::Base::Runtime::Timer* __pTimer; }; #endif /* INTSHAREPOPUP_H_ */ diff --git a/res/screen-size-normal/IDL_ADD_BOOKMARK.xml b/res/screen-size-normal/IDL_ADD_BOOKMARK.xml index 2a48b8a..21ce068 100644 --- a/res/screen-size-normal/IDL_ADD_BOOKMARK.xml +++ b/res/screen-size-normal/IDL_ADD_BOOKMARK.xml @@ -3,6 +3,7 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> + 720
@@ -27,32 +28,37 @@ + - + - - + + @@ -62,11 +68,6 @@ - diff --git a/res/screen-size-normal/IDL_EDIT_BOOKMARK_LIST.xml b/res/screen-size-normal/IDL_EDIT_BOOKMARK_LIST.xml index aeab3a8..36186a2 100644 --- a/res/screen-size-normal/IDL_EDIT_BOOKMARK_LIST.xml +++ b/res/screen-size-normal/IDL_EDIT_BOOKMARK_LIST.xml @@ -3,41 +3,42 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + + 720 - +
- +
- +
- - + + - - - + + + - - - + + +
diff --git a/res/screen-size-normal/IDL_EDIT_HISTORY_LIST.xml b/res/screen-size-normal/IDL_EDIT_HISTORY_LIST.xml index 8de0833..7aed7ee 100644 --- a/res/screen-size-normal/IDL_EDIT_HISTORY_LIST.xml +++ b/res/screen-size-normal/IDL_EDIT_HISTORY_LIST.xml @@ -3,37 +3,38 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + + 720
- +
- - + +
- +
- - - + + + - - - + + +
diff --git a/src/IntAddBookmarkForm.cpp b/src/IntAddBookmarkForm.cpp index 728cdf5..5998543 100644 --- a/src/IntAddBookmarkForm.cpp +++ b/src/IntAddBookmarkForm.cpp @@ -54,7 +54,8 @@ const int AddBookmarkForm::IDA_LIST_LEFT_SIDE_MARGIN = 104; const int AddBookmarkForm::IDA_LIST_LEFT_SIDE_MARGIN_DROPDOWN = 105; AddBookmarkForm::AddBookmarkForm(void) -:__folderCount(0) +:__fontSize(36) +,__folderCount(0) ,__folderName(CommonUtil::GetString(L"IDS_BR_TAB_BOOKMARKS")) ,__listHeight(H_TITLE_ITEM_HEIGHT) , __oldFolderCount(0) @@ -158,6 +159,7 @@ AddBookmarkForm::OnInitializing(void) r = __pScrollPanel->SetClientAreaHeight(__pList->GetY() + __listHeight); ScrollPanelScrollDirection direction = __pScrollPanel->GetScrollDirection(); AppLogDebug("ScrollDirection = %d SetClientAreaHeight ret = %s value = %d autoresize = %d",direction,GetErrorMessage(r),__pScrollPanel->GetClientAreaBounds().height,__pScrollPanel->IsScrollAreaAutoResizingEnabled()); + __fontSize = CommonUtil::GetFontSize(); r = E_SUCCESS; return r; @@ -576,6 +578,8 @@ AddBookmarkForm::CreateItem(int index, int itemWidth) DropDownCustomItem* pItem = null; Bitmap* pBitmap = null; pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_LIST_LEFT_SIDE); + const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND; + const Color ITEM_BACKGROUND_COLOR_HIGHLIGHTED = CUSTOM_BACKGROUND_COLOR_LISTVIEW_PRESSED_HIGHLIGHTED; if(itemWidth == 0) { itemWidth = __pList->GetWidth(); @@ -602,6 +606,7 @@ AddBookmarkForm::CreateItem(int index, int itemWidth) pItem->SetCurState(DROP_DOWN__ITEM_STATE_CLOSED); } + pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); @@ -635,9 +640,13 @@ AddBookmarkForm::CreateItem(int index, int itemWidth) delete pBitmap; return null; } - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); + + radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR); + radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED); + +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); folderTitle = CommonUtil::GetString(L"IDS_BR_TAB_BOOKMARKS") ; radioItem->SetText(folderTitle); } @@ -659,9 +668,11 @@ AddBookmarkForm::CreateItem(int index, int itemWidth) return null; } - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); + radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR); + radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); radioItem->SetText(folderTitle); } else @@ -678,9 +689,11 @@ AddBookmarkForm::CreateItem(int index, int itemWidth) } //radioItem->AddElement(Rectangle(MARGIN_X, 0, __pList->GetBounds().width, LIST_ITEM_HEIGHT), IDA_FORMAT_STRING1, CommonUtil::GetString(L"IDS_CREATE_NEW_FOLDER"), textsize, Color::GetColor(COLOR_ID_BLACK), Color::GetColor(COLOR_ID_BLACK), Color::GetColor(COLOR_ID_BLACK), true); folderTitle = CommonUtil::GetString(L"IDS_BR_OPT_NEW_FOLDER"); - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); - radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); + radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR); + radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); +// radioItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_HIGHLIGHTED, CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND); radioItem->SetText(folderTitle); } diff --git a/src/IntAddressbar.cpp b/src/IntAddressbar.cpp index 63fb2f5..3293c78 100644 --- a/src/IntAddressbar.cpp +++ b/src/IntAddressbar.cpp @@ -700,3 +700,9 @@ Addressbar::GetAddressbarURL() { return __pAddressbarUrlField->GetText(); } + +bool +Addressbar::HasCurrentFocus() +{ + return __pAddressbarUrlField->HasFocus(); +} diff --git a/src/IntBookmarkListForm.cpp b/src/IntBookmarkListForm.cpp index 6819afa..704a632 100644 --- a/src/IntBookmarkListForm.cpp +++ b/src/IntBookmarkListForm.cpp @@ -80,6 +80,7 @@ BookmarkListForm::BookmarkListForm(void) __selectedindex = 0; __searchText = L""; __previousSceneId = L""; + __fontSize = 44; } BookmarkListForm::~BookmarkListForm(void) @@ -158,6 +159,7 @@ BookmarkListForm::OnInitializing(void) return E_FAILURE; } + __fontSize = CommonUtil::GetFontSize(); __pItemContextFolder = new(std::nothrow) ListContextItem(); __pItemContextFolder->Construct(); __pItemContextFolder->AddElement(IDA_CONTEXT_ITEM_FOLDER_EDIT, CommonUtil::GetString(L"IDS_BR_SK_EDIT")); @@ -592,17 +594,17 @@ BookmarkListForm::CreateItem(int index, int itemWidth) } if ( pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER ) { - r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth,112), LIST_ANNEX_STYLE_DETAILED); + r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth,112 - 44 + __fontSize), LIST_ANNEX_STYLE_DETAILED); TryCatch(!IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r)); pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN); if (pBitmap != null) { - pItem->AddElement(Rectangle(x_Margin_Icon, 20, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null); + pItem->AddElement(Rectangle(x_Margin_Icon, 20+(__fontSize - 44)/2, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null); delete pBitmap; } - pItem->AddElement(Rectangle(x_Margin_Title, 26, width_Title, 60), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(), true); + pItem->AddElement(Rectangle(x_Margin_Title, 26, width_Title, 60 + (__fontSize - 44) ), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(),__fontSize, CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); if ( __pItemContextFolder != NULL) { @@ -611,7 +613,7 @@ BookmarkListForm::CreateItem(int index, int itemWidth) } else { - r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, itemHeight), style); + r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, itemHeight - 44 + __fontSize), style); TryCatch( !IsFailed(r),,"BookmarkListForm::CreateItem Construct failed %s",GetErrorMessage(r)); AppLogDebug("BookmarkListForm::faviconid %ls",pBookMark->GetFaviconId().GetPointer()); @@ -660,12 +662,12 @@ BookmarkListForm::CreateItem(int index, int itemWidth) AppLogDebug("BookmarkListForm::CreateItem bitmap is null"); pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN(); } - 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); + pItem->AddElement(Rectangle(x_Margin_Icon, y_Margin_Icon +(__fontSize - 44)/2, width_Icon, height_Icon), IDA_FORMAT_ICON, *pBitmap, null); + pItem->AddElement(Rectangle(x_Margin_Title, 0, width_Title, itemHeight - height_Url - 44 + __fontSize), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),__fontSize,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 - 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); + pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url - 44 + __fontSize, width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true); if (pBitmap != null) { @@ -1101,6 +1103,7 @@ BookmarkListForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui: } __searchText = __pSearchBar->GetText(); + AppLog("SearchbarGettext result %s",GetErrorMessage(GetLastResult())); __searchBookmark = true; __pListview->SetShowState(false); __pSearchListView->SetEnabled(true); diff --git a/src/IntCommonLib.cpp b/src/IntCommonLib.cpp index 46edda8..5995da8 100644 --- a/src/IntCommonLib.cpp +++ b/src/IntCommonLib.cpp @@ -22,12 +22,21 @@ #include #include +#include #include "IntCommonLib.h" using namespace Tizen::App; using namespace Tizen::Base; using namespace Tizen::Graphics; using namespace Tizen::Media; +using namespace Tizen::System; + +const int FONT_MAIN_TEXT_SIZE_GIANT = 98; +const int FONT_MAIN_TEXT_SIZE_HUGE = 81; +const int FONT_MAIN_TEXT_SIZE_LARGE = 64; +const int FONT_MAIN_TEXT_SIZE_NORMAL = 44; +const int FONT_MAIN_TEXT_SIZE_SMALL = 36; +const wchar_t* SETTING_INFO_KEY_FONT_SIZE = L"http://tizen.org/setting/font.size"; CommonBitmapTable CommonUtil::__commonBitmapTable[] = { @@ -195,3 +204,37 @@ CommonUtil::GetNinepatchedBitmapN(const String& strPath, const int width, const return null; } + +int +CommonUtil::GetFontSize(void) +{ + int fontSize = FONT_MAIN_TEXT_SIZE_NORMAL; + return fontSize; + String fontSizeValue; + + if (SettingInfo::GetValue(SETTING_INFO_KEY_FONT_SIZE, fontSizeValue) == E_SUCCESS) + { + if (fontSizeValue.Equals(L"giant", false)) + { + fontSize = FONT_MAIN_TEXT_SIZE_GIANT; + } + else if (fontSizeValue.Equals(L"huge", false)) + { + fontSize = FONT_MAIN_TEXT_SIZE_HUGE; + } + else if (fontSizeValue.Equals(L"large", false)) + { + fontSize = FONT_MAIN_TEXT_SIZE_LARGE; + } + else if (fontSizeValue.Equals(L"medium", false)) + { + fontSize = FONT_MAIN_TEXT_SIZE_NORMAL; + } + else + { + fontSize = FONT_MAIN_TEXT_SIZE_SMALL; + } + } + return fontSize; +} + diff --git a/src/IntEditBookmarkListForm.cpp b/src/IntEditBookmarkListForm.cpp index 488f442..a53f67f 100644 --- a/src/IntEditBookmarkListForm.cpp +++ b/src/IntEditBookmarkListForm.cpp @@ -73,6 +73,7 @@ EditBookmarkListForm::EditBookmarkListForm(void) __pCheckButton = null; __pConfirmationPopup = null; __pSelectedList = null; + __fontSize = 44; } EditBookmarkListForm::~EditBookmarkListForm(void) @@ -115,6 +116,7 @@ EditBookmarkListForm::OnInitializing(void) pSceneManager->AddSceneEventListener(IDSCN_EDIT_BOOKMARK_LIST, *this); } + __fontSize = CommonUtil::GetFontSize(); Header* pHeader = GetHeader(); if (pHeader == NULL) @@ -414,32 +416,32 @@ EditBookmarkListForm::CreateItem(int index, int itemWidth) } if (pBookMark->GetBookmarkType() == BOOKMARK_TYPE_FOLDER) { - r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112), style); + r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 112 - 44 + __fontSize), style); TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::CreateItem contruct item failed %s",GetErrorMessage(r)); pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_FOLDER_OPEN); if (pBitmap != null) { - pItem->AddElement(Rectangle(16, 26, 60, 60), IDA_FORMAT_ICON, *pBitmap, null); + pItem->AddElement(Rectangle(16, 26+(__fontSize - 44)/2, 60, 60), IDA_FORMAT_ICON, *pBitmap, null); delete pBitmap; } - pItem->AddElement(Rectangle(92, 8, width_Title/*__pListview->GetWidth() - 92 - 80*/, 112), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(), true); + pItem->AddElement(Rectangle(92, 8, width_Title/*__pListview->GetWidth() - 92 - 80*/, 112 + (__fontSize - 44)), IDA_FORMAT_FOLDER, pBookMark->GetBookmarkTitle(),__fontSize, CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ITEM); if (pBitmap != null) { - pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 80, 20, 60, 60), IDA_FORMAT_BITMAP, *pBitmap, null, null); + pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 80, 20 + (__fontSize - 44)/2, 60, 60), IDA_FORMAT_BITMAP, *pBitmap, null, null); pItem->SetElementSelectionEnabled(IDA_FORMAT_BITMAP, true); delete pBitmap; } } else { - r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128), style); + r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128 + (__fontSize - 44)), style); TryCatch( r == E_SUCCESS,,"EditBookmarkListForm::CreateItem contruct item failed %s",GetErrorMessage(r)); pBitmap = pBookMark->GetFavIconBitmap(); @@ -449,17 +451,17 @@ EditBookmarkListForm::CreateItem(int index, int itemWidth) pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN(); } - pItem->AddElement(Rectangle(16, 28, 72, 72), IDA_FORMAT_ICON, *pBitmap, null); + pItem->AddElement(Rectangle(16, 28 + (__fontSize - 44)/2, 72, 72), IDA_FORMAT_ICON, *pBitmap, null); delete pBitmap; - pItem->AddElement(Rectangle(104, 10, width_Title, itemHeight - height_Url), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(), true); - 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); + pItem->AddElement(Rectangle(104, 10, width_Title, itemHeight - height_Url + (__fontSize - 44)), IDA_FORMAT_SITE, pBookMark->GetBookmarkTitle(),__fontSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); + pItem->AddElement(Rectangle(x_Margin_Url, y_Margin_Url + (__fontSize - 44), width_Url, height_Url), IDA_FORMAT_URL, pBookMark->GetUrl(),textSize,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true); //pBitmap = AppResource::GetInstance()->GetBitmapN("I01_picker_arrow_right.png"); pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_RIGHT_ARROW); if (pBitmap != null) { - pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 84, 32, 64, 64), IDA_FORMAT_BITMAP, *pBitmap, null, null); + pItem->AddElement(Rectangle(GetClientAreaBounds().width - 92 - 84, 32 + (__fontSize - 44)/2, 64, 64), IDA_FORMAT_BITMAP, *pBitmap, null, null); pItem->SetElementSelectionEnabled(IDA_FORMAT_BITMAP, true); delete pBitmap; } diff --git a/src/IntEditHistoryListForm.cpp b/src/IntEditHistoryListForm.cpp index a6b1f1f..095da6c 100644 --- a/src/IntEditHistoryListForm.cpp +++ b/src/IntEditHistoryListForm.cpp @@ -62,6 +62,7 @@ EditHistoryListForm::EditHistoryListForm(void) ,__pSelectedLabel(null) ,__selectedCount(0) ,__isNoHistoryPresent(true) +,__fontSize(44) { } @@ -95,6 +96,8 @@ EditHistoryListForm::OnInitializing(void) AppLogDebug("EditHistoryListForm::OnInitializing"); SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER); + __fontSize = CommonUtil::GetFontSize(); + Header* pHeader = GetHeader(); if (pHeader == NULL) @@ -527,7 +530,7 @@ EditHistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth) } Bitmap* pBitmap = null; - r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128), LIST_ANNEX_STYLE_MARK); + r = pItem->Construct(Tizen::Graphics::Dimension(itemWidth, 128 + (__fontSize - 44)), LIST_ANNEX_STYLE_MARK); @@ -539,10 +542,10 @@ EditHistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth) if (pBitmap != null) { - pItem->AddElement(Rectangle(16, 26, 60, 60), IDA_FORMAT_ICON, *pBitmap, null); + pItem->AddElement(Rectangle(16, 26 + (__fontSize - 44)/2, 60, 60), IDA_FORMAT_ICON, *pBitmap, null); delete pBitmap; } - r = pItem->AddElement(Rectangle(92, 4, GetClientAreaBounds().width - 96 - 32 -64 -32, 60), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), 44,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); + r = pItem->AddElement(Rectangle(92, 4, GetClientAreaBounds().width - 96 - 32 -64 -32, 60 + (__fontSize - 44)), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), __fontSize,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); if (IsFailed(r)) { delete pItem; @@ -550,7 +553,7 @@ EditHistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth) return null; } - pItem->AddElement(Rectangle(92, 68, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 52), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true); + pItem->AddElement(Rectangle(92, 68 + (__fontSize - 44), GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 52), IDA_FORMAT_URL, pHistory->GetHistoryUrl(),32,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY,true); return pItem; } diff --git a/src/IntFormFactory.cpp b/src/IntFormFactory.cpp index 5ee2843..436d95a 100644 --- a/src/IntFormFactory.cpp +++ b/src/IntFormFactory.cpp @@ -25,6 +25,7 @@ #include "IntArticleReaderForm.h" #include "IntBookmarkListForm.h" #include "IntBrightnessForm.h" +#include "IntCommonLib.h" #include "IntCreateBookmarkFolderForm.h" #include "IntEditBookmarkListForm.h" #include "IntEditHistoryListForm.h" @@ -36,8 +37,10 @@ #include "IntFormFactory.h" #include "IntSettingForm.h" - +using namespace Tizen::App; using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Ui; using namespace Tizen::Ui::Controls; using namespace Tizen::Ui::Scenes; @@ -216,5 +219,102 @@ FormFactory::CreateFormN(const String& formId, const SceneId& sceneId) pNewForm = pForm; } AppLogDebug("FormFactory createForm exit"); +// pSceneManager->AddSceneEventListener(sceneId, *this); return pNewForm; } + + +void +FormFactory::SetFontSize(Container& container, int font) +{ + IList* pControls = container.GetControls(); + if(pControls == null) + { + return; + } + for(int count = 0; count < pControls->GetCount(); count++) + { + //Check if the control is again an container + Container *pContainer = dynamic_cast(pControls->GetAt(count)); + if(pContainer != null) + { + SetFontSize(*pContainer, font); + } + else //Check if it is a button + { + Button *pButton = dynamic_cast(pControls->GetAt(count)); + if(pButton != null) + { + pButton->SetTextSize(font); + } + else //Check if a label + { + Label *pLabel = dynamic_cast(pControls->GetAt(count)); + if(pLabel != null) + { + pLabel->SetTextConfig(font, pLabel->GetTextStyle()); + } + else //Check if a EditField + { + EditField *pEditField = dynamic_cast(pControls->GetAt(count)); + if(pEditField != null) + { + pEditField->SetTextSize(font); + } + else //Check if a EditArea + { + EditArea *pEditArea = dynamic_cast(pControls->GetAt(count)); + if(pEditArea != null) + { + pEditArea->SetTextSize(font); + } + else //Check if a ExpandableEditArea + { + ExpandableEditArea *pExpandableEditArea = dynamic_cast(pControls->GetAt(count)); + if(pExpandableEditArea != null) + { + pExpandableEditArea->SetTextSize(font); + } + else //Check if a TextBox + { + TextBox *pTextBox = dynamic_cast(pControls->GetAt(count)); + if(pTextBox != null) + { + pTextBox->SetTextSize(font); + } + else //Check if a SearchBar + { + SearchBar *pSearchBar = dynamic_cast(pControls->GetAt(count)); + if(pSearchBar != null) + { + pSearchBar->SetSearchFieldTextSize(font); + } + else //Check if a List + { + + } + } + } + } + } + } + } + } + } +} + +void +FormFactory::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs) +{ + AppLog("FormFactory::OnSceneActivatedN"); + Form *pForm = UiApp::GetInstance()->GetFrameAt(0)->GetCurrentForm(); + + if(pForm != null) + { + String fontSizeStr = ""; + int fontSize = CommonUtil::GetFontSize(); + AppLog("Font sizeStr: %ls, fontsize:%d", fontSizeStr.GetPointer(), fontSize); + SetFontSize(*pForm, fontSize); + pForm->Invalidate(true); + } +} diff --git a/src/IntHistoryListForm.cpp b/src/IntHistoryListForm.cpp index 288ccc6..578126a 100644 --- a/src/IntHistoryListForm.cpp +++ b/src/IntHistoryListForm.cpp @@ -128,6 +128,7 @@ HistoryListForm::OnInitializing(void) pSceneManager->AddSceneEventListener(IDSCN_HISTORY_LIST, *this); } + __fontSize = CommonUtil::GetFontSize(); if (pAppResource == null) { return E_FAILURE; @@ -533,7 +534,7 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth) delete pItem; return null; } - r = pItem->Construct(Dimension(itemWidth, 128), LIST_ANNEX_STYLE_NORMAL); + r = pItem->Construct(Dimension(itemWidth, 128 - 44 + __fontSize), LIST_ANNEX_STYLE_NORMAL); if (IsFailed(r)) { delete pItem; @@ -567,7 +568,7 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth) } if (pBitmap != null) { - r = pItem->AddElement(Rectangle(16, 28,72, 72), IDA_FORMAT_ICON, *pBitmap, null); + r = pItem->AddElement(Rectangle(16, 28 + (__fontSize - 44)/2,72, 72), IDA_FORMAT_ICON, *pBitmap, null); delete pBitmap; if (IsFailed(r)) { @@ -601,17 +602,17 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth) bookmarkBtnWidth = 64; - 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); + r = pItem->AddElement(Rectangle(104, 10, GetClientAreaBounds().width - 108 - 32 - bookmarkBtnWidth - 32, 60 - 44 + __fontSize), IDA_FORMAT_TITLE, pHistory->GetHistoryTitle(), __fontSize,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 - 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); + r = pItem->AddElement(Rectangle(104, 70 - 44 +__fontSize, 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) { - r = pItem->AddElement(Rectangle(GetClientAreaBounds().width - bookmarkBtnWidth - 16, (128 - pBookmarkBitmap->GetHeight())/2, bookmarkBtnWidth, bookmarkBtnWidth), IDA_FORMAT_BOOKMARK, *pBookmarkBitmap); + r = pItem->AddElement(Rectangle(GetClientAreaBounds().width - bookmarkBtnWidth - 16, (128 - pBookmarkBitmap->GetHeight())/2 +(__fontSize - 44)/2, bookmarkBtnWidth, bookmarkBtnWidth), IDA_FORMAT_BOOKMARK, *pBookmarkBitmap); TryCatch(!IsFailed(r), "CreateItem failed with %s",GetErrorMessage(r)); delete pBookmarkBitmap; } @@ -1138,6 +1139,7 @@ HistoryListForm::OnKeypadActionPerformed(Control &source, KeypadAction keypadAct __pSearchListView->SetEnabled(true); __searchHistory = true; __searchText =__pSearchBar->GetText(); + AppLog("SearchTextHistory %S errormsg %s",__searchText.GetPointer(),GetErrorMessage(GetLastResult())); r = __pGroupedListView->SetShowState(false); if (IsFailed(r)) diff --git a/src/IntInternetApp.cpp b/src/IntInternetApp.cpp index 8731acf..2ba1b68 100644 --- a/src/IntInternetApp.cpp +++ b/src/IntInternetApp.cpp @@ -143,7 +143,7 @@ InternetApp::OnAppInitialized(void) if (__pNewWindowInfo == null)//if the application is launched normally { - __pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(homePage); + __pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(homePage); } if (__pNewWindowInfo == null) @@ -289,7 +289,7 @@ InternetApp::OnAppControlRequestReceived(RequestId reqId, const String &operatio if (__pNewWindowInfo == null) { - __pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(urlData, true); + __pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(urlData, true); } if (__pNewWindowInfo == null) { diff --git a/src/IntMainForm.cpp b/src/IntMainForm.cpp index f23c0ac..0c391c4 100644 --- a/src/IntMainForm.cpp +++ b/src/IntMainForm.cpp @@ -208,6 +208,7 @@ MainForm::MainForm(void) __pClearBtn = null; __pReaderBtn = null; __isWebKeypadOpened = false; + __fontSize = 44; } MainForm::~MainForm(void) @@ -270,6 +271,7 @@ MainForm::OnInitializing(void) const int WIDTH_CONTEXT_MENU_BUTTON = 336; const int HEIGHT_CONTEXT_MENU_BUTTON = 72; + __fontSize = CommonUtil::GetFontSize(); Panel* pFooterPanel = null; __pSaveImage = new Image(); @@ -1137,7 +1139,7 @@ MainForm::CreateItem (int index, int itemWidth) Rectangle screenBounds = GetBounds(); if (pItem != null) { - r = pItem->Construct(Dimension(itemWidth, 128), style); + r = pItem->Construct(Dimension(itemWidth, 128 + (__fontSize - 44)), style); } if (IsFailed(r)) { @@ -1162,8 +1164,8 @@ MainForm::CreateItem (int index, int itemWidth) if ( pListIconImage != NULL) { - listImageRect.SetBounds(screenBounds.x + 16, screenBounds.y + 28,72, 72); - pagetTitleRect.SetBounds(listImageRect.x + 72 + 16,10, screenBounds.width - 2 * pListIconImage->GetWidth() - 120, 60); + listImageRect.SetBounds(screenBounds.x + 16, screenBounds.y + 28 + (__fontSize - 44)/2 , 72, 72); + pagetTitleRect.SetBounds(listImageRect.x + 72 + 16,10, screenBounds.width - 2 * pListIconImage->GetWidth() - 120, 60 + (__fontSize - 44)); pageURLRect.SetBounds(pagetTitleRect.x, pagetTitleRect.y + pagetTitleRect.height, screenBounds.width - 2 * pListIconImage->GetWidth() - 120, 48); @@ -1177,7 +1179,7 @@ MainForm::CreateItem (int index, int itemWidth) { if (pItem != null) { - pItem->AddElement(pagetTitleRect, IDA_FORMAT_TITLE_STRING, pageTitle, 44, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, true); + pItem->AddElement(pagetTitleRect, IDA_FORMAT_TITLE_STRING, pageTitle, __fontSize, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, true); } } @@ -1817,7 +1819,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) case IDA_NEWWINDOWBTN_CLICKED: { - WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(); + WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(); if (pNewWindowInfo == null) { @@ -2080,7 +2082,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) { String srcUrl = __pHitElementResult->GetUrl(); - WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(srcUrl); + WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(srcUrl); if (pNewWindowInfo == null) { @@ -2210,6 +2212,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) break; case IDA_SHARE_TEXT_CLICKED: { + __pWebViewer->ReleaseBlock(); AppLogDebug("IDA_SHARE_TEXT_CLICKED"); if(__pPopUp != null) { @@ -2320,7 +2323,13 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) String url = __pFooterUrlField->GetText(); AppLog("MainForm::OnUrlSubmitted url is %ls", url.GetPointer()); - LoadUrl(url); +// LoadUrl(url); + __pWebViewer->Reload(); + if (__pAddressbar != null) + { + //__pAddressbar->SetAddressbarMode((AddressBarMode)ADDRESSBAR_MODE_LOADING); + SetAddressbarMode((AddressBarMode)ADDRESSBAR_MODE_LOADING); + } //OnUrlSubmitted(); UpdateProgressBitmap(); @@ -2425,10 +2434,10 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, // hiding the address bar // __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight()); __pAddressbar->SetShowState(false); - if(__pWebViewer != null) - { - __pWebViewer->Resume(); - } +// if(__pWebViewer != null) +// { +// __pWebViewer->Resume(); +// } if(pUrl != null && pUrl->GetLength() > 0) { @@ -2535,6 +2544,7 @@ MainForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, if (__pWebViewer != null) { pWebCanvas = __pWebViewer->GetCanvasN(); + } if (pWebCanvas == null) { @@ -3293,6 +3303,7 @@ MainForm::OnAddressBarKeypadBoundsChanged(const Addressbar& addBar) void MainForm::OnPageTitleReceived(const Tizen::Base::String& title) { + AppLog("MainForm::OnPageTitleReceived"); if (__pWindowInfo) { __pWindowInfo->pageTitle = title; @@ -3515,12 +3526,13 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph String tagName = __pHitElementResult->GetTagName(); String type = __pHitElementResult->GetAttributeValue("type"); + __currentSelectedStr.Clear(); AppLog("__currentSelectedStr after clear %ls",__currentSelectedStr.GetPointer()); __currentSelectedStr = __pWebViewer->GetTextFromBlock(); AppLog("__currentSelectedStr after GetTextFromBlock %ls",__currentSelectedStr.GetPointer()); - if (((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) /*&& __isLongPressedDone == true*/) + if (((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) /*&& __isLongPressedDone == true*/ && __currentSelectedStr.CompareTo(L"") !=0) { AppLog("MainForm::OnWebPageBlockSelected show paste option"); @@ -3560,7 +3572,7 @@ MainForm::OnWebPageShowRequested(Tizen::Web::Controls::Web& source) Web* MainForm::OnWebWindowCreateRequested(void) { - WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(); + WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(); if (pNewWindowInfo == null) { @@ -3962,6 +3974,12 @@ MainForm::OnWebKeypadClosed(Tizen::Web::Controls::Web& source) } void +MainForm::OnWebKeypadBoundsChanged(Tizen::Web::Controls::Web& source) +{ +// RelativeLayout(false); +} + +void MainForm::OnTouchDoublePressed(const Control& source, const Point& currentPosition, const TouchEventInfo& touchInfo) { Control* temp = const_cast< Control* >(&source); @@ -4041,9 +4059,12 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen: AppLog("tag name is %ls", tagName.GetPointer()); AppLog("type is %ls", type.GetPointer()); - AppLog("innerHtml is %ls", innerHtml.GetPointer()); - if (((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) && innerHtml.GetLength() == 0 && __isWebKeypadOpened == true) + + + //__isLongPressedDone = true; + result r =__pWebViewer->SetBlockSelectionPosition(currentPosition); + if (((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) && innerHtml.GetLength() == 0 && __isWebKeypadOpened == true && __currentSelectedStr.CompareTo(L"") == 0 && r == E_INVALID_ARG) { AppLog("MainForm::OnWebPageBlockSelected show paste option"); @@ -4055,8 +4076,6 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen: __pImageMenu->Invalidate(true); } } - //__isLongPressedDone = true; - result r =__pWebViewer->SetBlockSelectionPosition(currentPosition); AppLog("setselectionselectedornot %s",GetErrorMessage(r)); } @@ -4300,11 +4319,11 @@ MainForm::OnSettingsChange(int settingvalue) if (settingvalue == (int) REGISTRY_SETTING_DEFAULT_VIEW) { WebSetting settings = __pWebViewer->GetSetting(); - if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_FIT_TO_WIDTH")) == 0) + if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo((L"IDS_BR_BODY_FIT_TO_WIDTH")) == 0) { settings.SetAutoFittingEnabled(true); } - else if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_READABLE")) == 0) + else if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo((L"IDS_BR_BODY_READABLE")) == 0) { settings.SetAutoFittingEnabled(false); } @@ -4321,6 +4340,7 @@ MainForm::OnSettingsChange(int settingvalue) WebSetting settings = __pWebViewer->GetSetting(); settings.SetAutoImageLoadEnabled(SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled()); __pWebViewer->SetSetting(settings); + __pWebViewer->Reload(); } else if (settingvalue == (int) REGISTRY_SETTING_BLOCK_POPUP) { @@ -5065,6 +5085,8 @@ AddressBarMode MainForm::GetAddressbarMode(void) void MainForm::SetUrl(const String& url) { __displayUrl = url; + if(__displayUrl.GetLength() > 2048) + __displayUrl.SubString(0,2048,__displayUrl); if (__pFooterUrlField != NULL) { @@ -5072,20 +5094,20 @@ void MainForm::SetUrl(const String& url) if (removedHttpUrl.IsEmpty() == false) { __pFooterUrlField->SetText(removedHttpUrl); - if(__pAddressbar != NULL) - __pAddressbar->SetUrl(__displayUrl); + if(__pAddressbar != NULL && __pAddressbar->HasCurrentFocus() == false) + __pAddressbar->SetUrl(__displayUrl); } else { __pFooterUrlField->SetText(__displayUrl); - if(__pAddressbar != NULL) - __pAddressbar->SetUrl(__displayUrl); + if(__pAddressbar != NULL && __pAddressbar->HasCurrentFocus() == false) + __pAddressbar->SetUrl(__displayUrl); } if(__pFooterUrlField) __pFooterUrlField->SetCursorPosition(__pFooterUrlField->GetTextLength()); __pFooterUrlField->Invalidate(false); - if(__pAddressbar != NULL) - __pAddressbar->Invalidate(true); + if(__pAddressbar != NULL && __pAddressbar->HasFocus()) + __pAddressbar->Invalidate(true); // __pFooterUrlField->SetCursorPosition(0); } } diff --git a/src/IntMultipleWindowForm.cpp b/src/IntMultipleWindowForm.cpp index 3160b61..5d5adf2 100644 --- a/src/IntMultipleWindowForm.cpp +++ b/src/IntMultipleWindowForm.cpp @@ -48,6 +48,7 @@ MultipleWindowForm::MultipleWindowForm(void) { __startPosition.x = -1; __startPosition.y = -1; + __fontSize = 44; } MultipleWindowForm::~MultipleWindowForm(void) @@ -87,6 +88,7 @@ MultipleWindowForm::OnInitializing(void) FooterItem closeButton; FooterItem newButton; + __fontSize = CommonUtil::GetFontSize(); SceneManager* pSceneManager = SceneManager::GetInstance(); if (pSceneManager == null) @@ -203,7 +205,7 @@ MultipleWindowForm::OnActionPerformed(const Control& source, int actionId) { case IDA_BUTTON_NEW: { - WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(); + WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(); if (pNewWindowInfo == null) { @@ -297,7 +299,7 @@ MultipleWindowForm::OnActionPerformed(const Control& source, int actionId) SceneRegister::DestroyAndUnRegisterScene(pWindowInfo->sceneID); } pAllWindowList->RemoveAll(true); - WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(); + WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(); if (pNewWindowInfo == null) { @@ -536,7 +538,7 @@ MultipleWindowForm::CreateItem(int index, int itemWidth) } Rectangle screenBounds = GetBounds(); - r = pItem->Construct(Dimension(itemWidth, 128), style); + r = pItem->Construct(Dimension(itemWidth, 128 + (__fontSize - 44)), style); if (IsFailed(r)) { return NULL; @@ -566,18 +568,18 @@ MultipleWindowForm::CreateItem(int index, int itemWidth) } - listImageRect.SetBounds(screenBounds.x + 16, screenBounds.y + 28,width, 72); - pagetTitleRect.SetBounds(listImageRect.x + width + 16,10, screenBounds.width - 2 * width - 24 - 64, 60); + listImageRect.SetBounds(screenBounds.x + 16, screenBounds.y + 28 + (__fontSize - 44)/2,width, 72 ); + pagetTitleRect.SetBounds(listImageRect.x + width + 16,10, screenBounds.width - 2 * width - 24 - 64, 60 + (__fontSize - 44)); pageURLRect.SetBounds(pagetTitleRect.x, pagetTitleRect.y + pagetTitleRect.height, screenBounds.width - 2 * width - 120, 48); if(__pListDeleteImage != null) { - deleteImageRect.SetBounds(screenBounds.width - __pListDeleteImage->GetWidth() - 24, (128 - __pListDeleteImage->GetHeight() - 8)/2, __pListDeleteImage->GetWidth() + 8, __pListDeleteImage->GetHeight() + 8); + deleteImageRect.SetBounds(screenBounds.width - __pListDeleteImage->GetWidth() - 24, (128 + (__fontSize - 44) - __pListDeleteImage->GetHeight() - 8)/2, __pListDeleteImage->GetWidth() + 8, __pListDeleteImage->GetHeight() + 8); } pItem->AddElement(listImageRect, IDA_FORMAT_BITMAP, *__pListIconImage, null, null); if (pageTitle.CompareTo(L"") != 0) { - pItem->AddElement(pagetTitleRect, IDA_FORMAT_TITLE_STRING, pageTitle, 44, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, true); + pItem->AddElement(pagetTitleRect, IDA_FORMAT_TITLE_STRING, pageTitle, __fontSize, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, true); } if (pageURL.CompareTo(L"") != 0) diff --git a/src/IntMultipleWindowPresentationModel.cpp b/src/IntMultipleWindowPresentationModel.cpp index baaf8db..13910c7 100644 --- a/src/IntMultipleWindowPresentationModel.cpp +++ b/src/IntMultipleWindowPresentationModel.cpp @@ -201,7 +201,7 @@ MultipleWindowPresentationModel::SetValue(Key key, Object* value) } WindowInfo* -MultipleWindowPresentationModel::CreateNewMainViewScene(const String& Url, bool isAppControlTriggered) +MultipleWindowPresentationModel::CreateNewMainViewSceneN(const String& Url, bool isAppControlTriggered) { if (GetInstance()->GetAllWindowArrayList()->GetCount() >= 9) diff --git a/src/IntSettingForm.cpp b/src/IntSettingForm.cpp index 54d5b87..b8d496d 100644 --- a/src/IntSettingForm.cpp +++ b/src/IntSettingForm.cpp @@ -52,6 +52,7 @@ SettingForm::SettingForm(void) __currentURL = L""; __pList = null; InitializeSettingValues(); + __fontSize = 44; } SettingForm::~SettingForm(void) @@ -255,6 +256,8 @@ SettingForm::OnInitializing(void) Footer* pFooter = NULL; SceneManager* pSceneManager = NULL; + __fontSize = CommonUtil::GetFontSize(); + __pList = static_cast< GroupedListView* >(GetControl(L"IDC_SETTING_LIST")); if ( __pList != NULL ) { diff --git a/src/IntSettingPresentationModel.cpp b/src/IntSettingPresentationModel.cpp index 047b2d8..1b83d52 100644 --- a/src/IntSettingPresentationModel.cpp +++ b/src/IntSettingPresentationModel.cpp @@ -83,6 +83,14 @@ SettingPresentationModel::SetDefaultValues(void) __setting.SetAutoFormDataShowEnabled(__rememberFormData); __setting.SetAutoLoginFormFillEnabled(__rememberPassword); + if (__defaultViewLevel.CompareTo((L"IDS_BR_BODY_FIT_TO_WIDTH")) == 0) + { + __setting.SetAutoFittingEnabled(true); + } + else if (__defaultViewLevel.CompareTo((L"IDS_BR_BODY_READABLE")) == 0) + { + __setting.SetAutoFittingEnabled(false); + } if (__securityWarnings == true) { __setting.SetCertificateErrorHandlingMode(WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM); @@ -456,11 +464,11 @@ SettingPresentationModel::SetDefaultView(const String& viewLevel) { __defaultViewLevel = viewLevel; //CommonUtil::GetString(L"IDS_FIT_TO_WIDTH") - if (__defaultViewLevel.CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_FIT_TO_WIDTH")) == 0) + if (__defaultViewLevel.CompareTo((L"IDS_BR_BODY_FIT_TO_WIDTH")) == 0) { __setting.SetAutoFittingEnabled(true); } - else if (__defaultViewLevel.CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_READABLE")) == 0) + else if (__defaultViewLevel.CompareTo((L"IDS_BR_BODY_READABLE")) == 0) { __setting.SetAutoFittingEnabled(false); } diff --git a/src/IntSharePopup.cpp b/src/IntSharePopup.cpp index 5a79c39..a7294b8 100644 --- a/src/IntSharePopup.cpp +++ b/src/IntSharePopup.cpp @@ -33,11 +33,13 @@ using namespace Tizen::App; using namespace Tizen::Io; using namespace Tizen::Base; using namespace Tizen::Base::Collection; +using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; using namespace Tizen::Ui; using namespace Tizen::Ui::Controls; using namespace Tizen::Ui::Scenes; + const int SharePopup::IDA_CANCEL_BUTTON = 101; const int SharePopup::ID_FORMAT_MESSAGE_STRING = 500; const int SharePopup::ID_FORMAT_EMAIL_STRING = 501; @@ -47,7 +49,6 @@ const int SharePopup::ID_FORMAT_TWITTER_STRING = 503; ShareInfo:: ShareInfo(void) { isImageAttached = false; - } ShareInfo:: ~ShareInfo(void) @@ -110,6 +111,7 @@ SharePopup::SharePopup(void) :__pList(null),__pShareList(null) { __appControlOngoing = false; + __pTimer = null; } SharePopup::~SharePopup(void) @@ -144,6 +146,8 @@ SharePopup::Initialize(void) pCancelButton->SetActionId(IDA_CANCEL_BUTTON); } + __pTimer = new(std::nothrow) Timer(); + __pTimer->Construct(*this); return true; } @@ -155,6 +159,13 @@ SharePopup::OnTerminating(void) } void +SharePopup::OnTimerExpired(Timer& timer) +{ + Popup::SetShowState(false); + Popup::Show(); +} + +void SharePopup::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) { switch(actionId) @@ -189,6 +200,7 @@ SharePopup::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, __appControlOngoing = true; // share via message StartMessageAppControl(); + __pTimer->Start(1000); } } break; @@ -199,6 +211,7 @@ SharePopup::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, __appControlOngoing = true; // share via email StartEmailAppControl(); + __pTimer->Start(1000); } } -- 2.7.4