DropDownCustomItem(void);
virtual ~DropDownCustomItem(void);
- result Construct(int width);
+ result Construct(int width , int height);
DropDownItemState GetCurState(void) const;
Tizen::Base::String GetMainText(void) const;
Tizen::Base::String GetSubText(void) const;
- result Make(void);
+ result Make(int fontsize, int itemHeight);
void SetCurState(const DropDownItemState);
void SetMainText(const Tizen::Base::String& text);
void SetSubText(const Tizen::Base::String& text);
Tizen::Base::String GetText(void) const;
bool GetSelected(void) const;
- result Make(void);
+ result Make(int fontSize);
void SetText(const Tizen::Base::String& text);
void SetSelected(const bool selectedValue);
, public Tizen::Ui::Controls::IGroupedListViewItemProvider
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::Scenes::ISceneEventListener
+ , public Tizen::System::ISettingEventListener
+
{
public:
SettingMainForm(void);
virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
const Tizen::Ui::Scenes::SceneId& nextSceneId);
+ virtual void OnSettingChanged(Tizen::Base::String& key);
+
class SettingItemInfo
{
public:
* @exception E_SYSTEM A system error has occurred.
*
*/
- result Make(void);
+ result Make(int fontSize);
/**
* @brief The method used to set the text of CustomItem
__pOptionMenu = new (std::nothrow) OptionMenu();
__pOptionMenu->Construct();
__pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"),IDA_FOOTER_EDIT);
- __pOptionMenu->AddItem(ResourceManager::GetString(L"IDS_COM_HEADER_EDIT"), IDA_FOOTER_EDIT);
__pOptionMenu->SetShowState(false);
__pOptionMenu->AddActionEventListener(*this);
SetFormMenuEventListener(this);
}
result
-DropDownCustomItem::Construct(int width)
+DropDownCustomItem::Construct(int width , int height)
{
__width = width;
- __height = 140;
+ __height = height + 28 ;
Dimension dim(__width, __height);
result r = CustomItem::Construct(dim, LIST_ANNEX_STYLE_NORMAL);
return r;
}
result
-DropDownCustomItem::Make(void)
+DropDownCustomItem::Make(int fontsize, int itemHeight)
{
AppLogDebug("DropDownCustomItem::Make entered");
+ int xMargin = 26;
+ int yMargin = 22;
+ int subTextHeight = 42 ;
+ int mainTextHeight = itemHeight - yMargin - subTextHeight ;
+
Tizen::Graphics::Bitmap* pDropperBitmapNormal = null;
- AddElement(Rectangle(26, 22, __width - 126, 54), IDA_FORMAT_MAIN_STRING,__mainText, 44,
+ AddElement(Rectangle(xMargin, yMargin, __width - 126, mainTextHeight ), IDA_FORMAT_MAIN_STRING,__mainText, fontsize,
CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT);
- AddElement(Rectangle(26, 76, __width - 126, 42), IDA_FORMAT_SUB_STRING,__subText, 34, CUSTOM_COLOR_GREY,
+ AddElement(Rectangle(xMargin, yMargin + mainTextHeight , __width - 126, subTextHeight), IDA_FORMAT_SUB_STRING,__subText, 34, CUSTOM_COLOR_GREY,
CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY);
AppResource* pAppResource = UiApp::GetInstance()->GetAppResource();
}
result
-RadioCustomItem::Make(void)
+RadioCustomItem::Make(int fontSize)
{
result r = E_FAILURE;
Color textColor = CUSTOM_COLOR_LISTVIEW_TEXT2;
AppLogDebug("RadioCustomItem::the text is %ls", __text.GetPointer());
r = AddElement(Rectangle(26 + pBitmap->GetWidth() + 10, 5, __width - 26 - 10 - pBitmap->GetWidth(),
- __height), IDA_FORMAT_STRING, __text, 40, textColor, textColor, textColor, true);
+ __height), IDA_FORMAT_STRING, __text, fontSize , textColor, textColor, textColor, true);
delete pBitmap;
}
TryCatch(!IsFailed(r),,"RadioCustomItem::the value is %s",GetErrorMessage(r));
{
AppLogDebug("ENTER");
__pPresentationModel = SettingPresentationModel::GetInstance();
+ SettingInfo::AddSettingEventListener(*this);
InitializeSettingValues();
effectiveIndex = effectiveIndex + itemIndex;
AppLogDebug("SettingMainForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d effectiveIndex %d", groupIndex, itemIndex, itemWidth, effectiveIndex);
+ String fontSizeStr;
+ int fontSize = 0;
+ int itemHeight = 0;
+ int defaultHeight = 112 ;
+ int defaultFontSize = 44 ;
+
+ SettingInfo::GetValue("http://tizen.org/setting/font.size", fontSizeStr);
+ AppLog("the font value is %S",fontSizeStr.GetPointer());
+
+ if(fontSizeStr == "medium")
+ {
+ fontSize = 44;
+ itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+ }
+ else if(fontSizeStr == "huge")
+ {
+ fontSize = 81;
+ itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+ }
+ else if(fontSizeStr == "giant")
+ {
+ fontSize = 98;
+ itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+ }
+ else if(fontSizeStr == "small")
+ {
+ fontSize = 36;
+ itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+ }
+ else if(fontSizeStr == "large")
+ {
+ fontSize = 64;
+ itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+ }
+ else
+ {
+ fontSize = 44;
+ }
+
+
if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
{
SettingToggleCustomItem* pItem = new (std::nothrow) SettingToggleCustomItem();
- r = pItem->Construct(itemWidth, 112);
+ r = pItem->Construct(itemWidth, itemHeight);
if (IsFailed(r))
{
}
pItem->SetText(settingInfo[effectiveIndex].titleText);
- pItem->Make();
+ pItem->Make(fontSize);
return pItem;
}
else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
{
DropDownCustomItem* pItem = new (std::nothrow) DropDownCustomItem();
- r = pItem->Construct(itemWidth);
+ r = pItem->Construct(itemWidth,itemHeight);
if (IsFailed(r))
{
delete pItem;
pItem->SetCurState(DROP_DOWN_ITEM_STATE_CLOSED);
}
- r = pItem->Make();
+ r = pItem->Make(fontSize,itemHeight);
if (IsFailed(r))
{
}
else
{
- pItem->Construct(itemWidth, 112);
+ pItem->Construct(itemWidth, itemHeight);
}
pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_RADIO_ITEM_BACKGROUND_COLOR);
AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
- pItem->Make();
+ pItem->Make(fontSize);
return pItem;
}
, isSelected(false)
{
}
+
+
+void
+SettingMainForm::OnSettingChanged(String& key)
+{
+ AppLogDebug("ENTER");
+ if (key == L"http://tizen.org/setting/font.size")
+ {
+ __pList->UpdateList();
+ }
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
}
result
-SettingToggleCustomItem::Make(void)
+SettingToggleCustomItem::Make(int fontSize)
{
const Color textColor = CUSTOM_COLOR_TRANSPARENT;
const Color pressedTextColor = CUSTOM_COLOR_TRANSPARENT;
const int X_Margin = 26;
const int Y_Margin = 26;
- const int textSize = 40;
- AddElement(Rectangle(X_Margin, Y_Margin, __width - 60, 60), IDA_FORMAT_STRING, __text, textSize, textColor, pressedTextColor, pressedTextColor, true);
+ AddElement(Rectangle(X_Margin, Y_Margin, __width - 60, __height - 2* Y_Margin), IDA_FORMAT_STRING, __text, fontSize, textColor, pressedTextColor, pressedTextColor, true);
return E_SUCCESS;
}