From 08c7558aabf1ee094ce8704daac4702033f89d8a Mon Sep 17 00:00:00 2001 From: Syed Khaja Moinuddin Date: Thu, 18 Apr 2013 15:41:31 +0900 Subject: [PATCH] GUI 3.6 applied in EditDate & EditTime Signed-off-by: Syed Khaja Moinuddin Change-Id: I6e950f1196ae5574b14b86bf8e7dbd7491337a66 Signed-off-by: Syed Khaja Moinuddin --- inc/FUiUiConfigurationTypes.h | 14 - src/ui/FUiUiConfiguration.cpp | 2 - src/ui/controls/FUiCtrl_DateTimeBar.cpp | 5 - src/ui/controls/FUiCtrl_EditDate.cpp | 9 + src/ui/controls/FUiCtrl_EditDatePresenter.cpp | 393 +++++++++++++++---------- src/ui/controls/FUiCtrl_EditTime.cpp | 8 + src/ui/controls/FUiCtrl_EditTimePresenter.cpp | 312 +++++++++++++++----- src/ui/inc/FUiCtrl_EditDatePresenter.h | 19 +- src/ui/inc/FUiCtrl_EditTimePresenter.h | 14 +- src/ui/inc/FUi_ResourceEditDateConfig.h | 13 +- src/ui/inc/FUi_ResourceEditTimeConfig.h | 3 +- src/ui/resource/FUi_ResourceConfigParser.cpp | 8 - src/ui/resource/FUi_ResourceEditDateConfig.cpp | 36 ++- src/ui/resource/FUi_ResourceEditTimeConfig.cpp | 41 +-- 14 files changed, 575 insertions(+), 302 deletions(-) diff --git a/inc/FUiUiConfigurationTypes.h b/inc/FUiUiConfigurationTypes.h index 351013b..7c7fd8a 100644 --- a/inc/FUiUiConfigurationTypes.h +++ b/inc/FUiUiConfigurationTypes.h @@ -766,20 +766,6 @@ struct _OSP_EXPORT_ ColorKey _OSP_EXPORT_ static const int TITLE_TEXT_DISABLED; /** - * The property key to get the color of the left half divider of edit date. - * - * @since 2.1 - */ - _OSP_EXPORT_ static const int DIVIDER_HALF_LEFT; - - /** - * The property key to get the color of the right half divider of edit date. - * - * @since 2.1 - */ - _OSP_EXPORT_ static const int DIVIDER_HALF_RIGHT; - - /** * The property key to get the normal background color of the picker button of edit date * * @since 2.1 diff --git a/src/ui/FUiUiConfiguration.cpp b/src/ui/FUiUiConfiguration.cpp index e99a328..29d1956 100644 --- a/src/ui/FUiUiConfiguration.cpp +++ b/src/ui/FUiUiConfiguration.cpp @@ -134,8 +134,6 @@ const int ColorKey::EditDate::TEXT_PRESSED = _EDITDATE::TEXT_PRESSED_COLOR; const int ColorKey::EditDate::TEXT_DISABLED = _EDITDATE::TEXT_DISABLED_COLOR; const int ColorKey::EditDate::TITLE_TEXT_NORMAL = _EDITDATE::TITLE_TEXT_NORMAL_COLOR; const int ColorKey::EditDate::TITLE_TEXT_DISABLED = _EDITDATE::TITLE_TEXT_DISABLED_COLOR; -const int ColorKey::EditDate::DIVIDER_HALF_LEFT = _EDITDATE::DIVIDER_LEFT_HALF_COLOR; -const int ColorKey::EditDate::DIVIDER_HALF_RIGHT = _EDITDATE::DIVIDER_RIGHT_HALF_COLOR; const int ColorKey::EditDate::CONTENT_BG_NORMAL = _EDITDATE::CONTENT_BG_NORMAL_COLOR; const int ColorKey::EditDate::CONTENT_BG_PRESSED = _EDITDATE::CONTENT_BG_PRESSED_COLOR; const int ColorKey::EditDate::CONTENT_BG_DISABLED = _EDITDATE::CONTENT_BG_DISABLED_COLOR; diff --git a/src/ui/controls/FUiCtrl_DateTimeBar.cpp b/src/ui/controls/FUiCtrl_DateTimeBar.cpp index 9efe5d8..ed61c9a 100644 --- a/src/ui/controls/FUiCtrl_DateTimeBar.cpp +++ b/src/ui/controls/FUiCtrl_DateTimeBar.cpp @@ -439,11 +439,6 @@ _DateTimeBar::OnDeactivated(void) { ReleaseTouchCapture(); - if (__pOwner != null) - { - __pOwner->Invalidate(); - } - return _Window::OnDeactivated(); } diff --git a/src/ui/controls/FUiCtrl_EditDate.cpp b/src/ui/controls/FUiCtrl_EditDate.cpp index 6573220..a3fccb5 100644 --- a/src/ui/controls/FUiCtrl_EditDate.cpp +++ b/src/ui/controls/FUiCtrl_EditDate.cpp @@ -921,6 +921,15 @@ _EditDate::OnSettingChanged(String& key) { if (key.Equals(L"http://tizen.org/setting/locale.date.format", false)) { + __pEditDatePresenter->Initialize(); + __pEditDatePresenter->SetLastSelectedId(DATETIME_ID_NONE); + + if (GetDateTimeBar() != null) + { + GetDateTimeBar()->SetVisibleState(false); + GetDateTimeBar()->Close(); + } + Invalidate(); } diff --git a/src/ui/controls/FUiCtrl_EditDatePresenter.cpp b/src/ui/controls/FUiCtrl_EditDatePresenter.cpp index 173fdff..6f48d5d 100644 --- a/src/ui/controls/FUiCtrl_EditDatePresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditDatePresenter.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "FUi_ResourceManager.h" #include "FUiCtrl_EditDatePresenter.h" @@ -54,6 +55,13 @@ _EditDatePresenter::_EditDatePresenter(void) , __monthTouchBounds(FloatRectangle()) , __yearTouchBounds(FloatRectangle()) , __titleBounds(FloatRectangle()) + , __pContentBgNormalColorReplacementBitmap(null) + , __pContentBgDisabledColorReplacementBitmap(null) + , __pContentBgPressedColorReplacementBitmap(null) + , __pContentBgHighlightedColorReplacementBitmap(null) + , __pContentBgEffectNormalBitmap(null) + , __pContentBgEffectPressedBitmap(null) + , __pContentBgEffectDisabledBitmap(null) , __datePickerEnabled(true) , __selectedId(DATETIME_ID_NONE) , __lastSelectedId(DATETIME_ID_NONE) @@ -61,7 +69,7 @@ _EditDatePresenter::_EditDatePresenter(void) , __titleObject() , __textObject() , __pFont(null) - , __dividerLineWidth(0.0f) + , __elementMargin(0.0f) , __dividerLineHeight(0.0f) , __titleFontSize(0.0f) , __dateFontSize(0.0f) @@ -79,6 +87,27 @@ _EditDatePresenter::~_EditDatePresenter(void) delete __pEditDateTimeModel; __pEditDateTimeModel = null; + + delete __pContentBgNormalColorReplacementBitmap; + __pContentBgNormalColorReplacementBitmap = null; + + delete __pContentBgDisabledColorReplacementBitmap; + __pContentBgDisabledColorReplacementBitmap = null; + + delete __pContentBgPressedColorReplacementBitmap; + __pContentBgPressedColorReplacementBitmap = null; + + delete __pContentBgHighlightedColorReplacementBitmap; + __pContentBgHighlightedColorReplacementBitmap = null; + + delete __pContentBgEffectNormalBitmap; + __pContentBgEffectNormalBitmap = null; + + delete __pContentBgEffectPressedBitmap; + __pContentBgEffectPressedBitmap = null; + + delete __pContentBgEffectDisabledBitmap; + __pContentBgEffectDisabledBitmap = null; } _EditDatePresenter* @@ -106,29 +135,38 @@ _EditDatePresenter::SetTitle(const String& title) { __title = title; } + result _EditDatePresenter::Initialize(void) { result r = E_SUCCESS; float editDateHeight = 0.0f; float editDateWidth = 0.0f; - float leftMargin = 0.0f; + float dateLeftMargin = 0.0f; + float titleLeftMargin = 0.0f; float titledateMargin = 0.0f; float dateHeight = 0.0f; + float monthYearMinWidth = 0.0f; + float dayElementWidth = 0.0f; + float dayElementMinWidth = 0.0f; FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); GET_SHAPE_CONFIG(EDITDATE::WIDTH, __pEditDate->GetOrientation(), editDateWidth); GET_SHAPE_CONFIG(EDITDATE::HEIGHT, __pEditDate->GetOrientation(), editDateHeight); - GET_SHAPE_CONFIG(EDITDATE::DATE_TEXT_LEFT_MARGIN, __pEditDate->GetOrientation(), leftMargin); - GET_FIXED_VALUE_CONFIG(EDITDATE::ITEM_DIVIDER_WIDTH, __pEditDate->GetOrientation(), __dividerLineWidth); + GET_SHAPE_CONFIG(EDITDATE::TITLE_TEXT_LEFT_MARGIN, __pEditDate->GetOrientation(), titleLeftMargin); GET_SHAPE_CONFIG(EDITDATE::ITEM_DIVIDER_HEIGHT, __pEditDate->GetOrientation(), __dividerLineHeight); GET_SHAPE_CONFIG(EDITDATE::TEXT_FONT_SIZE, __pEditDate->GetOrientation(), __titleFontSize); GET_SHAPE_CONFIG(EDITDATE::DATE_FONT_SIZE, __pEditDate->GetOrientation(), __dateFontSize); GET_SHAPE_CONFIG(EDITDATE::TITLE_DATE_MARGIN, __pEditDate->GetOrientation(), titledateMargin); GET_SHAPE_CONFIG(EDITDATE::DATE_HEIGHT, __pEditDate->GetOrientation(), dateHeight); GET_SHAPE_CONFIG(EDITDATE::TITLE_HEIGHT, __pEditDate->GetOrientation(), __titleBounds.height); + GET_SHAPE_CONFIG(EDITDATE::MONTH_YEAR_ELEMENT_WIDTH, __pEditDate->GetOrientation(), __elementWidth); + GET_SHAPE_CONFIG(EDITDATE::DAY_ELEMENT_WIDTH, __pEditDate->GetOrientation(), dayElementWidth); + GET_SHAPE_CONFIG(EDITDATE::ELEMENT_MARGIN, __pEditDate->GetOrientation(), __elementMargin); + GET_SHAPE_CONFIG(EDITDATE::DATE_TEXT_LEFT_MARGIN, __pEditDate->GetOrientation(), dateLeftMargin); - CalculateElementWidth(); + GET_SHAPE_CONFIG(EDITDATE::MONTH_YEAR_ELEMENT_MIN_WIDTH, __pEditDate->GetOrientation(), monthYearMinWidth); + GET_SHAPE_CONFIG(EDITDATE::DAY_ELEMENT_MIN_WIDTH, __pEditDate->GetOrientation(), dayElementMinWidth); if (__pEditDate->GetBoundsF().height > editDateHeight) { @@ -141,16 +179,12 @@ _EditDatePresenter::Initialize(void) if (__title.IsEmpty() == false) { - __titleBounds.x = leftMargin; + __titleBounds.x = titleLeftMargin; __titleBounds.y = (editDateHeight - (__titleBounds.height + titledateMargin + dateHeight)) / 2.0f; - __titleBounds.width = editDateWidth; + __titleBounds.width = editDateWidth - __titleBounds.x; bounds.y = __titleBounds.y + __titleBounds.height + titledateMargin; - __dayBounds.height = dateHeight; - __monthBounds.height = dateHeight; - __yearBounds.height = dateHeight; - if (!__isEditDateInitialized) { r = InitializeTitleObject(); @@ -161,18 +195,24 @@ _EditDatePresenter::Initialize(void) } else { - __dayBounds.height = editDateHeight; - __monthBounds.height = editDateHeight; - __yearBounds.height = editDateHeight; + bounds.y = (editDateHeight - dateHeight) / 2.0f; + } - __dayBounds.width = __elementWidth; + dayElementWidth = GetElementWidth(dayElementMinWidth, dayElementWidth); + __elementWidth = GetElementWidth(monthYearMinWidth, __elementWidth); + + __dayBounds.height = dateHeight; + __monthBounds.height = dateHeight; + __yearBounds.height = dateHeight; + + __dayBounds.width = dayElementWidth; __monthBounds.width = __elementWidth; __yearBounds.width = __elementWidth; - __dayBounds.x = 0.0f; - __monthBounds.x = 0.0f; - __yearBounds.x = 0.0f; + __dayBounds.x = dateLeftMargin; + __monthBounds.x = dateLeftMargin; + __yearBounds.x = dateLeftMargin; __dayBounds.y = bounds.y; __monthBounds.y = bounds.y; @@ -180,6 +220,9 @@ _EditDatePresenter::Initialize(void) if (!__isEditDateInitialized) { + r = LoadResource(); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = InitializeTextObject(); SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -243,48 +286,131 @@ _EditDatePresenter::InitializeTextObject(void) } float -_EditDatePresenter::GetTextWidth(_DateTimeId boxId) const +_EditDatePresenter::GetElementWidth(const float minWidth, const float maxWidth) const { - result r = E_SUCCESS; - FloatDimension dim; - TextObject dateObject; - - String monthString; - String yearString; - String dayString; - - _DateTimeUtils dateTimeUtils; - monthString = dateTimeUtils.GetMonthString(GetMonth()); - yearString.Format(10, L"%04d", GetYear()); - dayString.Format(10, L"%02d", GetDay()); + FloatRectangle bounds; + FloatDimension minSize; + bounds = __pEditDate->GetBoundsF(); - r = dateObject.Construct(); - SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + float elementWidth = 0.0f; + float editDateWidth = 0.0f; - TextSimple* pSimpleText = null; + GET_SHAPE_CONFIG(EDITDATE::WIDTH, __pEditDate->GetOrientation(), editDateWidth); + GET_DIMENSION_CONFIG(EDITDATE::MIN_SIZE, __pEditDate->GetOrientation(), minSize); - if (boxId == DATETIME_ID_DAY) + if (bounds.width >= editDateWidth) { - pSimpleText = new (std::nothrow)TextSimple((const_cast (dayString.GetPointer())), dayString.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); + return maxWidth; } - else if (boxId == DATETIME_ID_MONTH) + + if (bounds.width <= minSize.width) { - pSimpleText = new (std::nothrow)TextSimple((const_cast (monthString.GetPointer())), monthString.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); + elementWidth = minWidth; } - else if (boxId == DATETIME_ID_YEAR) + else if (bounds.width < editDateWidth && bounds.width > minSize.width) { - pSimpleText = new (std::nothrow)TextSimple((const_cast (yearString.GetPointer())), yearString.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); + elementWidth = maxWidth - + ((maxWidth - minWidth) / (editDateWidth - minSize.width)) * (editDateWidth - bounds.width); } - SysTryReturn(NID_UI_CTRL, (pSimpleText != null), dim.width, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + return elementWidth; +} + +result +_EditDatePresenter::LoadResource(void) +{ + result r = E_SUCCESS; + + Color contentNormalBgColor; + Color contentDisabledBgColor; + Color contentPressedColor; + Color contentHighlightedColor; + + Bitmap* pTempBitmap = null; + + GET_COLOR_CONFIG(EDITDATE::CONTENT_BG_NORMAL, contentNormalBgColor); + GET_COLOR_CONFIG(EDITDATE::CONTENT_BG_DISABLED, contentDisabledBgColor); + GET_COLOR_CONFIG(EDITDATE::CONTENT_BG_PRESSED, contentPressedColor); + GET_COLOR_CONFIG(EDITDATE::CONTENT_BG_HIGHLIGHTED, contentHighlightedColor); + + r = GET_BITMAP_CONFIG_N(EDITDATE::CONTENT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgNormalColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentNormalBgColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgNormalColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITDATE::CONTENT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgPressedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentPressedColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgPressedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITDATE::CONTENT_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgDisabledColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentDisabledBgColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgDisabledColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITDATE::CONTENT_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgHighlightedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentHighlightedColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgHighlightedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + r = GET_BITMAP_CONFIG_N(EDITDATE::CONTENT_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pContentBgEffectNormalBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = GET_BITMAP_CONFIG_N(EDITDATE::CONTENT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pContentBgEffectPressedBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = GET_BITMAP_CONFIG_N(EDITDATE::CONTENT_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pContentBgEffectDisabledBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + + delete pTempBitmap; + pTempBitmap = null; + + return r; + +CATCH: + delete pTempBitmap; + pTempBitmap = null; + + delete __pContentBgNormalColorReplacementBitmap; + __pContentBgNormalColorReplacementBitmap = null; + + delete __pContentBgPressedColorReplacementBitmap; + __pContentBgPressedColorReplacementBitmap = null; + + delete __pContentBgDisabledColorReplacementBitmap; + __pContentBgDisabledColorReplacementBitmap = null; - dateObject.AppendElement(*pSimpleText); - dateObject.SetFont(__pFont, 0, dateObject.GetTextLength()); - dim = dateObject.GetTextExtentF(0, dateObject.GetTextLength()); + delete __pContentBgHighlightedColorReplacementBitmap; + __pContentBgHighlightedColorReplacementBitmap = null; - dateObject.RemoveAll(); + delete __pContentBgEffectNormalBitmap; + __pContentBgEffectNormalBitmap = null; - return dim.width; + delete __pContentBgEffectPressedBitmap; + __pContentBgEffectPressedBitmap = null; + + delete __pContentBgEffectDisabledBitmap; + __pContentBgEffectDisabledBitmap = null; + + return r; } int @@ -463,11 +589,6 @@ _EditDatePresenter::Draw(void) r = DrawText(*pCanvas, GetDateAreaBounds(DATETIME_ID_YEAR), yearString, DATETIME_ID_YEAR); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - r = DrawDividers(*pCanvas); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - - CalculateTouchAreaBounds(); - delete pCanvas; return r; @@ -484,82 +605,28 @@ _EditDatePresenter::CalculateAreaBounds(void) if (GetLocaleDateFormat() == DATE_FORMAT_DDMMYYYY) { - __monthBounds.x = __dayBounds.x + __dayBounds.width + __dividerLineWidth; - __yearBounds.x = __monthBounds.x + __monthBounds.width + __dividerLineWidth; + __monthBounds.x = __dayBounds.x + __dayBounds.width + __elementMargin; + __yearBounds.x = __monthBounds.x + __monthBounds.width + __elementMargin; } else if (GetLocaleDateFormat() == DATE_FORMAT_MMDDYYYY) { - __dayBounds.x = __monthBounds.x + __monthBounds.width + __dividerLineWidth; - __yearBounds.x = __dayBounds.x + __dayBounds.width + __dividerLineWidth; + __dayBounds.x = __monthBounds.x + __monthBounds.width + __elementMargin; + __yearBounds.x = __dayBounds.x + __dayBounds.width + __elementMargin; } else if (GetLocaleDateFormat() == DATE_FORMAT_YYYYMMDD) { - __monthBounds.x = __yearBounds.x + __yearBounds.width + __dividerLineWidth; - __dayBounds.x = __monthBounds.x + __monthBounds.width + __dividerLineWidth; + __monthBounds.x = __yearBounds.x + __yearBounds.width + __elementMargin; + __dayBounds.x = __monthBounds.x + __monthBounds.width + __elementMargin; } else if (GetLocaleDateFormat() == DATE_FORMAT_YYYYDDMM) { - __dayBounds.x = __yearBounds.x + __yearBounds.width + __dividerLineWidth; - __monthBounds.x = __dayBounds.x + __dayBounds.width + __dividerLineWidth; + __dayBounds.x = __yearBounds.x + __yearBounds.width + __elementMargin; + __monthBounds.x = __dayBounds.x + __dayBounds.width + __elementMargin; } return r; } -void -_EditDatePresenter::CalculateTouchAreaBounds(void) -{ - __dayTouchBounds.width = GetTextWidth(DATETIME_ID_DAY); - __dayTouchBounds.x = __dayBounds.x + (__elementWidth - __dayTouchBounds.width) / 2.0f; - __dayTouchBounds.y = __dayBounds.y; - __dayTouchBounds.height = __dayBounds.height; - - __monthTouchBounds.width = GetTextWidth(DATETIME_ID_MONTH); - __monthTouchBounds.x = __monthBounds.x + (__elementWidth - __monthTouchBounds.width) / 2.0f; - __monthTouchBounds.y = __monthBounds.y; - __monthTouchBounds.height = __monthBounds.height; - - __yearTouchBounds.width = GetTextWidth(DATETIME_ID_YEAR); - __yearTouchBounds.x = __yearBounds.x + (__elementWidth - __yearTouchBounds.width) / 2.0f; - __yearTouchBounds.y = __yearBounds.y; - __yearTouchBounds.height = __yearBounds.height; - - return; -} - -void -_EditDatePresenter::CalculateElementWidth(void) -{ - FloatRectangle bounds; - FloatDimension minSize; - bounds = __pEditDate->GetBoundsF(); - - float elementMinWidth = 0.0f; - float width = 0.0f; - float minWidth = 0.0f; - - GET_SHAPE_CONFIG(EDITDATE::TEXT_ELEMENT_WIDTH, __pEditDate->GetOrientation(), __elementWidth); - GET_SHAPE_CONFIG(EDITDATE::TEXT_ELEMENT_MIN_WIDTH, __pEditDate->GetOrientation(), elementMinWidth); - GET_SHAPE_CONFIG(EDITDATE::WIDTH, __pEditDate->GetOrientation(), width); - GET_DIMENSION_CONFIG(EDITDATE::MIN_SIZE, __pEditDate->GetOrientation(), minSize); - - if (bounds.width >= width) - { - return; - } - - if (bounds.width <= minSize.width) - { - __elementWidth = elementMinWidth; - } - else if (bounds.width < width && bounds.width > minSize.width) - { - __elementWidth = __elementWidth - ((__elementWidth - elementMinWidth) / (width - minWidth)) * (width - bounds.width); - } - - return; -} - result _EditDatePresenter::DrawTitle(Canvas& canvas) { @@ -571,6 +638,7 @@ _EditDatePresenter::DrawTitle(Canvas& canvas) } (_FontImpl::GetInstance(*__pFont))->SetSize(__titleFontSize); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); __titleObject.SetFont(__pFont, 0, __titleObject.GetTextLength()); __titleObject.Draw(*_CanvasImpl::GetInstance(canvas)); @@ -591,11 +659,16 @@ _EditDatePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const GET_COLOR_CONFIG(EDITDATE::TEXT_NORMAL, textColor); } + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_PLAIN); + if (boxId == __selectedId && boxId != DATETIME_ID_NONE) { + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); GET_COLOR_CONFIG(EDITDATE::TEXT_PRESSED, textColor); } + DrawContentBitmap(canvas, bounds, boxId); + FloatRectangle drawAreaBounds(0.0f, 0.0f, 0.0f, 0.0f); drawAreaBounds = bounds; @@ -606,7 +679,6 @@ _EditDatePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const __textObject.RemoveAll(); (_FontImpl::GetInstance(*__pFont))->SetSize(__dateFontSize); - __textObject.AppendElement(*pSimpleText); __textObject.SetFont(__pFont, 0, __textObject.GetTextLength()); @@ -618,78 +690,88 @@ _EditDatePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const } result -_EditDatePresenter::DrawDividers(Canvas& canvas) +_EditDatePresenter::DrawContentBitmap(Canvas& canvas, const FloatRectangle& bounds, _DateTimeId boxId) { result r = E_SUCCESS; - float editDateHeight = 0.0f; - float dateHeight = 0.0f; + bool isCustomBitmap = false; + Bitmap* pReplacementBitmap = null; + Bitmap* pEffectBitmap = null; - GET_SHAPE_CONFIG(EDITDATE::DATE_HEIGHT, __pEditDate->GetOrientation(), dateHeight); - GET_SHAPE_CONFIG(EDITDATE::HEIGHT, __pEditDate->GetOrientation(), editDateHeight); - - if (__pEditDate->GetBoundsF().height > editDateHeight) + if (!__pEditDate->IsEnabled()) { - editDateHeight = __pEditDate->GetBoundsF().height; + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_DISABLED); + pReplacementBitmap = __pContentBgDisabledColorReplacementBitmap; + pEffectBitmap = __pContentBgEffectDisabledBitmap; } - - Color dividerHalfLeftColor; - Color dividerHalfRightColor; - - GET_COLOR_CONFIG(EDITDATE::DIVIDER_LEFT_HALF, dividerHalfLeftColor); - GET_COLOR_CONFIG(EDITDATE::DIVIDER_RIGHT_HALF, dividerHalfRightColor); - - FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); - - bounds.x = __elementWidth; - - if (__title.IsEmpty() == false) + else if (__selectedId != boxId) { - bounds.y = __dayBounds.y + ((dateHeight - __dividerLineHeight) / 2.0f); + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_NORMAL); + pReplacementBitmap = __pContentBgNormalColorReplacementBitmap; + pEffectBitmap = __pContentBgEffectNormalBitmap; } else { - bounds.y = __dayBounds.y + ((editDateHeight - __dividerLineHeight) / 2.0f); + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_PRESSED); + pReplacementBitmap = __pContentBgPressedColorReplacementBitmap; + pEffectBitmap = __pContentBgEffectPressedBitmap; } - for (int divider = 0; divider < __dividerCount; divider++) + r = DrawResourceBitmap(canvas, bounds, pReplacementBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (!isCustomBitmap) { - canvas.SetForegroundColor(dividerHalfLeftColor); - canvas.SetLineWidth(__dividerLineWidth / 2.0f); + r = DrawResourceBitmap(canvas, bounds, pEffectBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + } - r = canvas.DrawLine(FloatPoint(bounds.x, bounds.y), FloatPoint(bounds.x, bounds.y + __dividerLineHeight)); - SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); + return r; +} - canvas.SetForegroundColor(dividerHalfRightColor); - canvas.SetLineWidth(__dividerLineWidth / 2.0f); +result +_EditDatePresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap) +{ + result r = E_SUCCESS; - r = canvas.DrawLine(FloatPoint(bounds.x + 1.0f, bounds.y), FloatPoint(bounds.x + 1.0f, bounds.y + __dividerLineHeight)); - SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r)); + if (pBitmap == null) + { + return r; + } - bounds.x = bounds.x + __elementWidth; + if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap)) + { + r = canvas.DrawNinePatchedBitmap(bounds, *pBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + r = canvas.DrawBitmap(bounds, *pBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); } return r; } + _DateTimeId _EditDatePresenter::GetBoxIdFromPosition(const FloatPoint& point) const { _DateTimeId displayBoxId = DATETIME_ID_NONE; - if (point.y < __dayTouchBounds.y || point.y > __dayTouchBounds.y + __dayTouchBounds.height) + if (point.y < __dayBounds.y || point.y > __dayBounds.y + __dayBounds.height) { return displayBoxId; } - if (__dayTouchBounds.Contains(point) == true) + if (__dayBounds.Contains(point) == true) { displayBoxId = DATETIME_ID_DAY; } - else if (__monthTouchBounds.Contains(point) == true) + else if (__monthBounds.Contains(point) == true) { displayBoxId = DATETIME_ID_MONTH; } - else if (__yearTouchBounds.Contains(point) == true) + else if (__yearBounds.Contains(point) == true) { displayBoxId = DATETIME_ID_YEAR; } @@ -997,6 +1079,11 @@ _EditDatePresenter::Animate(void) VisualElementPropertyAnimation* pNewBoundsAnimation = null; VisualElementPropertyAnimation* pOldBoundsAnimation = null; Canvas *pCanvas = null; + Color contentBgColor; + Color textPressedColor; + + GET_COLOR_CONFIG(EDITTIME::CONTENT_BG_PRESSED, contentBgColor); + GET_COLOR_CONFIG(EDITTIME::TEXT_PRESSED, textPressedColor); __pFont->GetTextExtent(newValue, newValue.GetLength(), newTextDim); __pFont->GetTextExtent(__lastSelectedValue, __lastSelectedValue.GetLength(), oldTextDim); @@ -1093,7 +1180,7 @@ _EditDatePresenter::Animate(void) pCanvas = pEditDateElement->GetCanvasN(rect); - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->SetBackgroundColor(contentBgColor); pCanvas->Clear(); delete pCanvas; @@ -1126,6 +1213,8 @@ _EditDatePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); + pCanvas->SetForegroundColor(textPressedColor); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); pCanvas->SetFont(*__pFont); pCanvas->DrawText(FloatPoint(0.0f, 0.0f), __lastSelectedValue); @@ -1138,6 +1227,8 @@ _EditDatePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); + pCanvas->SetForegroundColor(textPressedColor); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); pCanvas->SetFont(*__pFont); pCanvas->DrawText(FloatPoint(0.0f, 0.0f), newValue); diff --git a/src/ui/controls/FUiCtrl_EditTime.cpp b/src/ui/controls/FUiCtrl_EditTime.cpp index e7ad78d..66400a5 100644 --- a/src/ui/controls/FUiCtrl_EditTime.cpp +++ b/src/ui/controls/FUiCtrl_EditTime.cpp @@ -713,6 +713,14 @@ _EditTime::OnSettingChanged(String& key) if (key.Equals(L"http://tizen.org/setting/locale.time.format.24hour", false)) { __pEditTimePresenter->UpdateTimeFormat(); + __pEditTimePresenter->SetLastSelectedId(DATETIME_ID_NONE); + + if (GetDateTimeBar() != null) + { + GetDateTimeBar()->SetVisibleState(false); + GetDateTimeBar()->Close(); + } + Invalidate(); } diff --git a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp index 0c0dbe7..26b4994 100644 --- a/src/ui/controls/FUiCtrl_EditTimePresenter.cpp +++ b/src/ui/controls/FUiCtrl_EditTimePresenter.cpp @@ -48,8 +48,6 @@ _EditTimePresenter::_EditTimePresenter(const String& title) , __pEditTime(null) , __bounds(FloatRectangle()) , __titleBounds(FloatRectangle()) - , __hourTouchBounds(FloatRectangle()) - , __minuteTouchBounds(FloatRectangle()) , __ampmString(String()) , __hourString(String()) , __minuteString(String()) @@ -64,11 +62,19 @@ _EditTimePresenter::_EditTimePresenter(const String& title) , __pAmPmBgNormalColorReplacementBitmap(null) , __pAmPmBgDisabledColorReplacementBitmap(null) , __pAmPmBgPressedColorReplacementBitmap(null) + , __pAmPmBgHighlightedColorReplacementBitmap(null) , __pAmPmBgEffectNomralBitmap(null) , __pAmPmBgEffectPressedBitmap(null) , __pAmPmBgEffectDisabledBitmap(null) , __pColonColorReplacementBitmap(null) , __pColonDisabledColorReplacementBitmap(null) + , __pContentBgNormalColorReplacementBitmap(null) + , __pContentBgDisabledColorReplacementBitmap(null) + , __pContentBgPressedColorReplacementBitmap(null) + , __pContentBgHighlightedColorReplacementBitmap(null) + , __pContentBgEffectNormalBitmap(null) + , __pContentBgEffectPressedBitmap(null) + , __pContentBgEffectDisabledBitmap(null) , __pContentProvider(null) , __textObject() , __pFont(null) @@ -98,6 +104,9 @@ _EditTimePresenter::~_EditTimePresenter(void) delete __pAmPmBgPressedColorReplacementBitmap; __pAmPmBgPressedColorReplacementBitmap = null; + delete __pAmPmBgHighlightedColorReplacementBitmap; + __pAmPmBgHighlightedColorReplacementBitmap = null; + delete __pAmPmBgEffectNomralBitmap; __pAmPmBgEffectNomralBitmap = null; @@ -112,6 +121,27 @@ _EditTimePresenter::~_EditTimePresenter(void) delete __pColonDisabledColorReplacementBitmap; __pColonDisabledColorReplacementBitmap = null; + + delete __pContentBgNormalColorReplacementBitmap; + __pContentBgNormalColorReplacementBitmap = null; + + delete __pContentBgDisabledColorReplacementBitmap; + __pContentBgDisabledColorReplacementBitmap = null; + + delete __pContentBgPressedColorReplacementBitmap; + __pContentBgPressedColorReplacementBitmap = null; + + delete __pContentBgHighlightedColorReplacementBitmap; + __pContentBgHighlightedColorReplacementBitmap = null; + + delete __pContentBgEffectNormalBitmap; + __pContentBgEffectNormalBitmap = null; + + delete __pContentBgEffectPressedBitmap; + __pContentBgEffectPressedBitmap = null; + + delete __pContentBgEffectDisabledBitmap; + __pContentBgEffectDisabledBitmap = null; } _EditTimePresenter* @@ -287,9 +317,9 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f); - float width = 0.0f; + float editTimeHeight = 0.0f; float colonWidth = 0.0f; - float margin = 0.0f; + float timeAmPmMargin = 0.0f; float colonMargin = 0.0f; float timeElementWidth = 0.0f; float amPmHeight = 0.0f; @@ -297,23 +327,23 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) float titleTimeMargin = 0.0f; float leftMargin = 0.0f; - GET_SHAPE_CONFIG(EDITTIME::TIME_WIDTH, __pEditTime->GetOrientation(), width); - GET_SHAPE_CONFIG(EDITTIME::HEIGHT, __pEditTime->GetOrientation(), bounds.height); + GET_SHAPE_CONFIG(EDITTIME::HEIGHT, __pEditTime->GetOrientation(), editTimeHeight); GET_SHAPE_CONFIG(EDITTIME::COLON_WIDTH, __pEditTime->GetOrientation(), colonWidth); - GET_SHAPE_CONFIG(EDITTIME::TIME_AMPM_MARGIN, __pEditTime->GetOrientation(), margin); + GET_SHAPE_CONFIG(EDITTIME::TIME_AMPM_MARGIN, __pEditTime->GetOrientation(), timeAmPmMargin); GET_SHAPE_CONFIG(EDITTIME::COLON_MARGIN, __pEditTime->GetOrientation(), colonMargin); - GET_SHAPE_CONFIG(EDITTIME::HOUR_MINUTE_WIDTH, __pEditTime->GetOrientation(), timeElementWidth); GET_SHAPE_CONFIG(EDITTIME::AMPM_HEIGHT, __pEditTime->GetOrientation(), amPmHeight); GET_SHAPE_CONFIG(EDITTIME::TITLE_TIME_MARGIN, __pEditTime->GetOrientation(), titleTimeMargin); GET_SHAPE_CONFIG(EDITTIME::TIME_HEIGHT, __pEditTime->GetOrientation(), timeHeight); - leftMargin = GetLeftMargin(); + GET_SHAPE_CONFIG(EDITTIME::TIME_TEXT_LEFT_MARGIN, __pEditTime->GetOrientation(), leftMargin); if (__pEditTime->GetBoundsF().height > bounds.height) { - bounds.height = __pEditTime->GetBoundsF().height; + editTimeHeight = __pEditTime->GetBoundsF().height; } + bounds.y = (editTimeHeight - timeHeight) / 2.0f; + if (!__title.IsEmpty()) { if (displayBoxId == DATETIME_ID_AMPM) @@ -323,16 +353,13 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) else { bounds.y = __titleBounds.y + __titleBounds.height + titleTimeMargin; - bounds.height = timeHeight; } } - if (__pEditTime->GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) - { - leftMargin = 0.0f; - } + bounds.x = leftMargin; + bounds.height = timeHeight; - bounds.x = leftMargin + ((width - (2.0f * timeElementWidth + colonWidth + 2.0f * colonMargin)) / 2.0f); + timeElementWidth = GetTimeElementWidth(); if (displayBoxId == DATETIME_ID_HOUR) { @@ -340,16 +367,16 @@ _EditTimePresenter::GetDisplayAreaBoundsFromHoursStyle(_DateTimeId displayBoxId) } else if (displayBoxId == DATETIME_ID_MINUTE) { - bounds.x = bounds.x + timeElementWidth + colonWidth + 2.0f * colonMargin; + bounds.x = bounds.x + timeElementWidth + colonWidth + (2.0f * colonMargin); bounds.width = timeElementWidth; } else if (displayBoxId == DATETIME_ID_AMPM) { - bounds.x = leftMargin + width + margin; + bounds.x = leftMargin + (2.0f * timeElementWidth) + colonWidth + (2.0f * colonMargin) + timeAmPmMargin; if (__title.IsEmpty()) { - bounds.y = bounds.y + (bounds.height - amPmHeight) / 2.0f; + bounds.y = (editTimeHeight - amPmHeight) / 2.0f; } GET_SHAPE_CONFIG(EDITTIME::AMPM_WIDTH, __pEditTime->GetOrientation(), bounds.width); @@ -400,17 +427,11 @@ _EditTimePresenter::GetTextWidth(_DateTimeId boxId) const void _EditTimePresenter::SetTitleBounds(void) { - if (__pEditTime->GetOrientation() == _CONTROL_ORIENTATION_LANDSCAPE) - { - GET_SHAPE_CONFIG(EDITTIME::TIME_TEXT_LEFT_MARGIN, __pEditTime->GetOrientation(), __titleBounds.x); - } - else - { - __titleBounds.x = GetLeftMargin(); - } + GET_SHAPE_CONFIG(EDITTIME::TITLE_TEXT_LEFT_MARGIN, __pEditTime->GetOrientation(), __titleBounds.x); GET_SHAPE_CONFIG(EDITTIME::WIDTH, __pEditTime->GetOrientation(), __titleBounds.width); GET_SHAPE_CONFIG(EDITTIME::TITLE_HEIGHT, __pEditTime->GetOrientation(), __titleBounds.height); + __titleBounds.width = __titleBounds.width - __titleBounds.x; return; } @@ -427,14 +448,26 @@ _EditTimePresenter::LoadResource(void) Color buttonNormalBgColor; Color buttonDisabledBgColor; - Color buttonNormalPressedColor; + Color buttonPressedColor; + Color buttonHighlightedColor; + Color contentNormalBgColor; + Color contentDisabledBgColor; + Color contentPressedColor; + Color contentHighlightedColor; Color colonTextColor; Color colonTextDisabledColor; Bitmap* pTempBitmap = null; GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_NORMAL, buttonNormalBgColor); - GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_PRESSED, buttonNormalPressedColor); + GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_PRESSED, buttonPressedColor); GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_DISABLED, buttonDisabledBgColor); + GET_COLOR_CONFIG(EDITTIME::BUTTON_BG_HIGHLIGHTED, buttonHighlightedColor); + + GET_COLOR_CONFIG(EDITTIME::CONTENT_BG_NORMAL, contentNormalBgColor); + GET_COLOR_CONFIG(EDITTIME::CONTENT_BG_DISABLED, contentDisabledBgColor); + GET_COLOR_CONFIG(EDITTIME::CONTENT_BG_PRESSED, contentPressedColor); + GET_COLOR_CONFIG(EDITTIME::CONTENT_BG_HIGHLIGHTED, contentHighlightedColor); + GET_COLOR_CONFIG(EDITTIME::TEXT_NORMAL, colonTextColor); GET_COLOR_CONFIG(EDITTIME::TEXT_DISABLED, colonTextDisabledColor); @@ -479,10 +512,60 @@ _EditTimePresenter::LoadResource(void) r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - __pAmPmBgPressedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonNormalPressedColor); + __pAmPmBgPressedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonPressedColor); SysTryCatch(NID_UI_CTRL, (__pAmPmBgPressedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pAmPmBgHighlightedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonHighlightedColor); + SysTryCatch(NID_UI_CTRL, (__pAmPmBgHighlightedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITTIME::CONTENT_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgNormalColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentNormalBgColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgNormalColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITTIME::CONTENT_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgPressedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentPressedColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgPressedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITTIME::CONTENT_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgDisabledColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentDisabledBgColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgDisabledColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + + delete pTempBitmap; + pTempBitmap = null; + + r = GET_BITMAP_CONFIG_N(EDITTIME::CONTENT_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pTempBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + __pContentBgHighlightedColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pTempBitmap, Color::GetColor(COLOR_ID_MAGENTA), contentHighlightedColor); + SysTryCatch(NID_UI_CTRL, (__pContentBgHighlightedColorReplacementBitmap != null), r = GetLastResult(), GetLastResult(), + "[%s] Propagating.", GetErrorMessage(GetLastResult())); + r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pAmPmBgEffectNomralBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -492,6 +575,15 @@ _EditTimePresenter::LoadResource(void) r = GET_BITMAP_CONFIG_N(EDITTIME::BUTTON_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pAmPmBgEffectDisabledBitmap); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + r = GET_BITMAP_CONFIG_N(EDITTIME::CONTENT_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pContentBgEffectNormalBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = GET_BITMAP_CONFIG_N(EDITTIME::CONTENT_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pContentBgEffectPressedBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + + r = GET_BITMAP_CONFIG_N(EDITTIME::CONTENT_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pContentBgEffectDisabledBitmap); + SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); + delete pTempBitmap; pTempBitmap = null; @@ -508,15 +600,48 @@ CATCH: delete __pAmPmBgPressedColorReplacementBitmap; __pAmPmBgPressedColorReplacementBitmap = null; + delete __pAmPmBgDisabledColorReplacementBitmap; + __pAmPmBgDisabledColorReplacementBitmap = null; + + delete __pAmPmBgHighlightedColorReplacementBitmap; + __pAmPmBgHighlightedColorReplacementBitmap = null; + + delete __pContentBgNormalColorReplacementBitmap; + __pContentBgNormalColorReplacementBitmap = null; + + delete __pContentBgPressedColorReplacementBitmap; + __pContentBgPressedColorReplacementBitmap = null; + + delete __pContentBgDisabledColorReplacementBitmap; + __pContentBgDisabledColorReplacementBitmap = null; + + delete __pContentBgHighlightedColorReplacementBitmap; + __pContentBgHighlightedColorReplacementBitmap = null; + delete __pAmPmBgEffectNomralBitmap; __pAmPmBgEffectNomralBitmap = null; delete __pAmPmBgEffectPressedBitmap; __pAmPmBgEffectPressedBitmap = null; + delete __pAmPmBgEffectDisabledBitmap; + __pAmPmBgEffectDisabledBitmap = null; + + delete __pContentBgEffectNormalBitmap; + __pContentBgEffectNormalBitmap = null; + + delete __pContentBgEffectPressedBitmap; + __pContentBgEffectPressedBitmap = null; + + delete __pContentBgEffectDisabledBitmap; + __pContentBgEffectDisabledBitmap = null; + delete __pColonColorReplacementBitmap; __pColonColorReplacementBitmap = null; + delete __pColonDisabledColorReplacementBitmap; + __pColonDisabledColorReplacementBitmap = null; + return r; } @@ -544,54 +669,39 @@ _EditTimePresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bou return r; } -void -_EditTimePresenter::CalculateTouchAreaBounds(const FloatRectangle hourBounds, const FloatRectangle minuteBounds) -{ - __hourTouchBounds.width = GetTextWidth(DATETIME_ID_HOUR); - __hourTouchBounds.x = hourBounds.x + (hourBounds.width - __hourTouchBounds.width) / 2.0f; - __hourTouchBounds.y = hourBounds.y; - __hourTouchBounds.height = hourBounds.height; - - __minuteTouchBounds.width = GetTextWidth(DATETIME_ID_MINUTE); - __minuteTouchBounds.x = minuteBounds.x + (minuteBounds.width - __minuteTouchBounds.width) / 2.0f; - __minuteTouchBounds.y = minuteBounds.y; - __minuteTouchBounds.height = minuteBounds.height; - - return; -} - float -_EditTimePresenter::GetLeftMargin(void) const +_EditTimePresenter::GetTimeElementWidth(void) const { FloatRectangle bounds; FloatDimension minSize; bounds = __pEditTime->GetBoundsF(); - float leftMargin = 0.0f; - float leftMinMargin = 0.0f; - float width = 0.0f; + float timeElementWidth = 0.0f; + float timeElementMinWidth = 0.0f; + float editTimeWidth = 0.0f; - GET_SHAPE_CONFIG(EDITTIME::TIME_TEXT_LEFT_MARGIN, __pEditTime->GetOrientation(), leftMargin); - GET_SHAPE_CONFIG(EDITTIME::TIME_TEXT_LEFT_MIN_MARGIN, __pEditTime->GetOrientation(), leftMinMargin); - GET_SHAPE_CONFIG(EDITTIME::WIDTH, __pEditTime->GetOrientation(), width); + GET_SHAPE_CONFIG(EDITTIME::HOUR_MINUTE_WIDTH, __pEditTime->GetOrientation(), timeElementWidth); + GET_SHAPE_CONFIG(EDITTIME::HOUR_MINUTE_MIN_WIDTH, __pEditTime->GetOrientation(), timeElementMinWidth); + GET_SHAPE_CONFIG(EDITTIME::WIDTH, __pEditTime->GetOrientation(), editTimeWidth); GET_DIMENSION_CONFIG(EDITTIME::MIN_SIZE, __pEditTime->GetOrientation(), minSize); - if (bounds.width >= width) + if (bounds.width >= editTimeWidth) { - return leftMargin; + return timeElementWidth; } if (bounds.width <= minSize.width) { - leftMargin = leftMinMargin; + timeElementWidth = timeElementMinWidth; } - else if (bounds.width < width && bounds.width > minSize.width) + else if (bounds.width < editTimeWidth && bounds.width > minSize.width) { - leftMargin = leftMargin - ((leftMargin - leftMinMargin) / (width - minSize.width)) * (width - bounds.width); + timeElementWidth = timeElementWidth - + ((timeElementWidth - timeElementMinWidth) / (editTimeWidth - minSize.width)) * (editTimeWidth - bounds.width); } - return leftMargin; + return timeElementWidth; } result @@ -733,8 +843,6 @@ _EditTimePresenter::Draw(void) r = DrawColon(*pCanvas, colonBounds); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - CalculateTouchAreaBounds(hourBounds, minuteBounds); - if (__24hours == false) { r = DrawResourceBitmap(*pCanvas, ampmBounds, pReplacementBitmap); @@ -784,6 +892,7 @@ _EditTimePresenter::DrawTitle(Canvas& canvas) } (_FontImpl::GetInstance(*__pFont))->SetSize(__titleFontSize); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); __titleObject.SetFont(__pFont, 0, __titleObject.GetTextLength()); __titleObject.Draw(*_CanvasImpl::GetInstance(canvas)); @@ -792,6 +901,46 @@ _EditTimePresenter::DrawTitle(Canvas& canvas) } result +_EditTimePresenter::DrawContentBitmap(Canvas& canvas, const FloatRectangle& bounds, _DateTimeId boxId) +{ + result r = E_SUCCESS; + + bool isCustomBitmap = false; + Bitmap* pReplacementBitmap = null; + Bitmap* pEffectBitmap = null; + + if (!__pEditTime->IsEnabled()) + { + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_DISABLED); + pReplacementBitmap = __pContentBgDisabledColorReplacementBitmap; + pEffectBitmap = __pContentBgEffectDisabledBitmap; + } + else if (__selectedId != boxId) + { + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_NORMAL); + pReplacementBitmap = __pContentBgNormalColorReplacementBitmap; + pEffectBitmap = __pContentBgEffectNormalBitmap; + } + else + { + isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_PRESSED); + pReplacementBitmap = __pContentBgPressedColorReplacementBitmap; + pEffectBitmap = __pContentBgEffectPressedBitmap; + } + + r = DrawResourceBitmap(canvas, bounds, pReplacementBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + + if (!isCustomBitmap) + { + r = DrawResourceBitmap(canvas, bounds, pEffectBitmap); + SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r)); + } + + return r; +} + +result _EditTimePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const String& text, _DateTimeId boxId, float textSize) { result r = E_SUCCESS; @@ -837,6 +986,11 @@ _EditTimePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const } } + if (boxId != DATETIME_ID_AMPM) + { + DrawContentBitmap(canvas, bounds, boxId); + } + FloatRectangle drawAreaBounds(0.0f, 0.0f, 0.0f, 0.0f); drawAreaBounds = bounds; @@ -847,19 +1001,22 @@ _EditTimePresenter::DrawText(Canvas& canvas, const FloatRectangle& bounds, const __textObject.RemoveAll(); (_FontImpl::GetInstance(*__pFont))->SetSize(__timeFontSize); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_PLAIN); __textObject.AppendElement(*pSimpleText); - if (boxId == DATETIME_ID_AMPM) + if (boxId == __selectedId && boxId != DATETIME_ID_AMPM) { - (_FontImpl::GetInstance(*__pFont))->SetSize(textSize); - __textObject.SetFont(__pFont, 0, __textObject.GetTextLength()); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); } - else + + if (boxId == DATETIME_ID_AMPM) { - __textObject.SetFont(__pFont, 0, __textObject.GetTextLength()); + (_FontImpl::GetInstance(*__pFont))->SetSize(textSize); } + __textObject.SetFont(__pFont, 0, __textObject.GetTextLength()); + __textObject.SetForegroundColor(textColor, 0, __textObject.GetTextLength()); __textObject.SetBounds(drawAreaBounds); __textObject.Draw(*_CanvasImpl::GetInstance(canvas)); @@ -873,22 +1030,27 @@ _EditTimePresenter::GetBoxIdFromPosition(const FloatPoint& point) const _DateTimeId displayBoxId = DATETIME_ID_NONE; FloatRectangle ampmBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle hoursBounds(0.0f, 0.0f, 0.0f, 0.0f); + FloatRectangle minutesBounds(0.0f, 0.0f, 0.0f, 0.0f); if (__24hours == false) { ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM); } - if (point.y < __hourTouchBounds.y || point.y > __hourTouchBounds.y + __hourTouchBounds.height) + hoursBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR); + minutesBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE); + + if (point.y < hoursBounds.y || point.y > hoursBounds.y + hoursBounds.height) { return displayBoxId; } - if (__hourTouchBounds.Contains(point) == true) + if (hoursBounds.Contains(point) == true) { displayBoxId = DATETIME_ID_HOUR; } - else if (__minuteTouchBounds.Contains(point) == true) + else if (minutesBounds.Contains(point) == true) { displayBoxId = DATETIME_ID_MINUTE; } @@ -1309,6 +1471,12 @@ _EditTimePresenter::Animate(void) VisualElementPropertyAnimation* pNewBoundsAnimation = null; VisualElementPropertyAnimation* pOldBoundsAnimation = null; Canvas *pCanvas = null; + Color contentBgColor; + Color textNormalColor; + Color textPressedColor; + + GET_COLOR_CONFIG(EDITTIME::CONTENT_BG_PRESSED, contentBgColor); + GET_COLOR_CONFIG(EDITTIME::TEXT_PRESSED, textPressedColor); __pFont->GetTextExtent(newValue, newValue.GetLength(), newTextDim); __pFont->GetTextExtent(__lastSelectedValue, __lastSelectedValue.GetLength(), oldTextDim); @@ -1405,7 +1573,7 @@ _EditTimePresenter::Animate(void) } pCanvas = pEditTimeElement->GetCanvasN(rect); - pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); + pCanvas->SetBackgroundColor(contentBgColor); pCanvas->Clear(); delete pCanvas; @@ -1438,6 +1606,8 @@ _EditTimePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); + pCanvas->SetForegroundColor(textPressedColor); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); pCanvas->SetFont(*__pFont); pCanvas->DrawText(FloatPoint(0.0f, 0.0f), __lastSelectedValue); @@ -1450,6 +1620,8 @@ _EditTimePresenter::Animate(void) pCanvas->SetBackgroundColor(Color(0, 0, 0, 0)); pCanvas->Clear(); + pCanvas->SetForegroundColor(textPressedColor); + (_FontImpl::GetInstance(*__pFont))->SetStyle(FONT_STYLE_BOLD); pCanvas->SetFont(*__pFont); pCanvas->DrawText(FloatPoint(0.0f, 0.0f), newValue); diff --git a/src/ui/inc/FUiCtrl_EditDatePresenter.h b/src/ui/inc/FUiCtrl_EditDatePresenter.h index 7fdaa37..9d83b0e 100644 --- a/src/ui/inc/FUiCtrl_EditDatePresenter.h +++ b/src/ui/inc/FUiCtrl_EditDatePresenter.h @@ -91,16 +91,15 @@ private: void SetTitle(const Tizen::Base::String& title); result InitializeTextObject(void); result InitializeTitleObject(void); - float GetTextWidth(_DateTimeId boxId) const; + float GetElementWidth(const float minWidth, const float maxWidth) const; + result LoadResource(void); result CalculateAreaBounds(void); result DrawTitle(Tizen::Graphics::Canvas& canvas); result DrawText(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Base::String& text, _DateTimeId boxId = DATETIME_ID_NONE); - result DrawDividers(Tizen::Graphics::Canvas& canvas); + result DrawContentBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, _DateTimeId displayBoxId); + result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); _DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::FloatPoint& point) const; - void CalculateTouchAreaBounds(void); - void CalculateElementWidth(void); - private: _DateTimeModel* __pEditDateTimeModel; _EditDate* __pEditDate; @@ -112,6 +111,14 @@ private: Tizen::Graphics::FloatRectangle __monthTouchBounds; Tizen::Graphics::FloatRectangle __yearTouchBounds; Tizen::Graphics::FloatRectangle __titleBounds; + Tizen::Graphics::Bitmap* __pContentBgNormalColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgDisabledColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgPressedColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgHighlightedColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgEffectNormalBitmap; + Tizen::Graphics::Bitmap* __pContentBgEffectPressedBitmap; + Tizen::Graphics::Bitmap* __pContentBgEffectDisabledBitmap; + Tizen::Base::String __title; Tizen::Base::String __lastSelectedValue; @@ -123,7 +130,7 @@ private: Tizen::Graphics::_Text::TextObject __titleObject; Tizen::Graphics::_Text::TextObject __textObject; Tizen::Graphics::Font* __pFont; - float __dividerLineWidth; + float __elementMargin; float __dividerLineHeight; float __titleFontSize; float __dateFontSize; diff --git a/src/ui/inc/FUiCtrl_EditTimePresenter.h b/src/ui/inc/FUiCtrl_EditTimePresenter.h index c4a015f..e81b02f 100644 --- a/src/ui/inc/FUiCtrl_EditTimePresenter.h +++ b/src/ui/inc/FUiCtrl_EditTimePresenter.h @@ -94,13 +94,13 @@ private: void SetTimeConversion(void); result DrawTitle(Tizen::Graphics::Canvas& canvas); + result DrawContentBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, _DateTimeId displayBoxId); result DrawText(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Base::String& text, _DateTimeId displayBoxId, float textSize = 0.0f); result DrawColon(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds); _DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::FloatPoint& point) const; result LoadResource(void); result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap); - void CalculateTouchAreaBounds(const Tizen::Graphics::FloatRectangle hourBounds, const Tizen::Graphics::FloatRectangle minuteBounds); - float GetLeftMargin(void) const; + float GetTimeElementWidth(void) const; private: _DateTimeModel* __pEditDateTimeModel; @@ -108,8 +108,6 @@ private: Tizen::Graphics::FloatRectangle __bounds; Tizen::Graphics::FloatRectangle __titleBounds; - Tizen::Graphics::FloatRectangle __hourTouchBounds; - Tizen::Graphics::FloatRectangle __minuteTouchBounds; Tizen::Base::String __ampmString; Tizen::Base::String __hourString; @@ -130,11 +128,19 @@ private: Tizen::Graphics::Bitmap* __pAmPmBgNormalColorReplacementBitmap; Tizen::Graphics::Bitmap* __pAmPmBgDisabledColorReplacementBitmap; Tizen::Graphics::Bitmap* __pAmPmBgPressedColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pAmPmBgHighlightedColorReplacementBitmap; Tizen::Graphics::Bitmap* __pAmPmBgEffectNomralBitmap; Tizen::Graphics::Bitmap* __pAmPmBgEffectPressedBitmap; Tizen::Graphics::Bitmap* __pAmPmBgEffectDisabledBitmap; Tizen::Graphics::Bitmap* __pColonColorReplacementBitmap; Tizen::Graphics::Bitmap* __pColonDisabledColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgNormalColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgDisabledColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgPressedColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgHighlightedColorReplacementBitmap; + Tizen::Graphics::Bitmap* __pContentBgEffectNormalBitmap; + Tizen::Graphics::Bitmap* __pContentBgEffectPressedBitmap; + Tizen::Graphics::Bitmap* __pContentBgEffectDisabledBitmap; Tizen::Ui::Animations::VisualElement* __pContentProvider; Tizen::Graphics::_Text::TextObject __textObject; diff --git a/src/ui/inc/FUi_ResourceEditDateConfig.h b/src/ui/inc/FUi_ResourceEditDateConfig.h index 4d1e646..9bafff7 100644 --- a/src/ui/inc/FUi_ResourceEditDateConfig.h +++ b/src/ui/inc/FUi_ResourceEditDateConfig.h @@ -30,8 +30,8 @@ DECLARE_UI_CONFIG(EDITDATE); DECLARE_COLOR_CONFIG(TEXT_DISABLED,3); DECLARE_COLOR_CONFIG(TITLE_TEXT_NORMAL,4); DECLARE_COLOR_CONFIG(TITLE_TEXT_DISABLED,5); - DECLARE_COLOR_CONFIG(DIVIDER_LEFT_HALF,6); - DECLARE_COLOR_CONFIG(DIVIDER_RIGHT_HALF,7); + //DECLARE_COLOR_CONFIG(DIVIDER_LEFT_HALF,6); + //DECLARE_COLOR_CONFIG(DIVIDER_RIGHT_HALF,7); DECLARE_COLOR_CONFIG(CONTENT_BG_NORMAL,8); DECLARE_COLOR_CONFIG(CONTENT_BG_PRESSED,9); DECLARE_COLOR_CONFIG(CONTENT_BG_DISABLED,10); @@ -50,12 +50,15 @@ DECLARE_UI_CONFIG(EDITDATE); DECLARE_SHAPE_CONFIG(DATE_FONT_SIZE,5); DECLARE_SHAPE_CONFIG(TEXT_FONT_SIZE,6); DECLARE_SHAPE_CONFIG(DATE_TEXT_LEFT_MARGIN,7); - DECLARE_SHAPE_CONFIG(TEXT_ELEMENT_WIDTH,8); + DECLARE_SHAPE_CONFIG(MONTH_YEAR_ELEMENT_WIDTH,8); DECLARE_SHAPE_CONFIG(ITEM_DIVIDER_HEIGHT,9); DECLARE_SHAPE_CONFIG(TITLE_DATE_MARGIN,10); DECLARE_SHAPE_CONFIG(DATE_BAR_MARGIN,11); - DECLARE_SHAPE_CONFIG(TEXT_ELEMENT_MIN_WIDTH,12); - DECLARE_FIXED_VALUE_CONFIG(ITEM_DIVIDER_WIDTH,1); + DECLARE_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN,12); + DECLARE_SHAPE_CONFIG(ELEMENT_MARGIN,13); + DECLARE_SHAPE_CONFIG(DAY_ELEMENT_WIDTH,14); + DECLARE_SHAPE_CONFIG(DAY_ELEMENT_MIN_WIDTH,15); + DECLARE_SHAPE_CONFIG(MONTH_YEAR_ELEMENT_MIN_WIDTH,16); DECLARE_DIMENSION_CONFIG(MIN_SIZE,1); DECLARE_END_UI_CONFIG(EDITDATE); diff --git a/src/ui/inc/FUi_ResourceEditTimeConfig.h b/src/ui/inc/FUi_ResourceEditTimeConfig.h index 8252c34..620e53f 100644 --- a/src/ui/inc/FUi_ResourceEditTimeConfig.h +++ b/src/ui/inc/FUi_ResourceEditTimeConfig.h @@ -73,7 +73,8 @@ DECLARE_UI_CONFIG(EDITTIME); DECLARE_SHAPE_CONFIG(COLON_WIDTH,15); DECLARE_SHAPE_CONFIG(COLON_MARGIN,16); DECLARE_SHAPE_CONFIG(TIME_TEXT_LEFT_MARGIN,17); - DECLARE_SHAPE_CONFIG(TIME_TEXT_LEFT_MIN_MARGIN,18); + DECLARE_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN,18); + DECLARE_SHAPE_CONFIG(HOUR_MINUTE_MIN_WIDTH,19); DECLARE_DIMENSION_CONFIG(MIN_SIZE,1); DECLARE_END_UI_CONFIG(EDITTIME); diff --git a/src/ui/resource/FUi_ResourceConfigParser.cpp b/src/ui/resource/FUi_ResourceConfigParser.cpp index 2cacec5..2a20599 100644 --- a/src/ui/resource/FUi_ResourceConfigParser.cpp +++ b/src/ui/resource/FUi_ResourceConfigParser.cpp @@ -2505,14 +2505,6 @@ ConfigParser::GetColorKeyTable(void) __pColorKeyTable->Add(ResourceKey(key), _EDITDATE::TITLE_TEXT_NORMAL_COLOR); } { - const char* key ="EDITDATE::DIVIDER_LEFT_HALF"; - __pColorKeyTable->Add(ResourceKey(key), _EDITDATE::DIVIDER_LEFT_HALF_COLOR); - } - { - const char* key ="EDITDATE::DIVIDER_RIGHT_HALF"; - __pColorKeyTable->Add(ResourceKey(key), _EDITDATE::DIVIDER_RIGHT_HALF_COLOR); - } - { const char* key ="EDITDATE::CONTENT_BG_NORMAL"; __pColorKeyTable->Add(ResourceKey(key), _EDITDATE::CONTENT_BG_NORMAL_COLOR); } diff --git a/src/ui/resource/FUi_ResourceEditDateConfig.cpp b/src/ui/resource/FUi_ResourceEditDateConfig.cpp index c41ad88..7e502fc 100644 --- a/src/ui/resource/FUi_ResourceEditDateConfig.cpp +++ b/src/ui/resource/FUi_ResourceEditDateConfig.cpp @@ -25,12 +25,12 @@ START_UI_CONFIG(EDITDATE); { ADD_COLOR_CONFIG(TEXT_NORMAL, $F011L1); - ADD_COLOR_CONFIG(TEXT_PRESSED, $F011L2); - ADD_COLOR_CONFIG(TEXT_DISABLED, $F011L1); + ADD_COLOR_CONFIG(TEXT_PRESSED, $F011L1P); + ADD_COLOR_CONFIG(TEXT_DISABLED, $F011L1D); ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $B052L5); ADD_COLOR_CONFIG(TITLE_TEXT_DISABLED, $B052L5); - ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0224); - ADD_COLOR_CONFIG(DIVIDER_RIGHT_HALF, $B0222); + //ADD_COLOR_CONFIG(DIVIDER_LEFT_HALF, $B0224); + //ADD_COLOR_CONFIG(DIVIDER_RIGHT_HALF, $B0222); ADD_COLOR_CONFIG(CONTENT_BG_NORMAL, $W011); ADD_COLOR_CONFIG(CONTENT_BG_PRESSED, $B042); ADD_COLOR_CONFIG(CONTENT_BG_DISABLED, $W011); @@ -46,29 +46,33 @@ START_UI_CONFIG(EDITDATE); START_UI_CONFIG_MODE(720x1280); { - ADD_SHAPE_CONFIG(WIDTH, 400); + ADD_SHAPE_CONFIG(WIDTH, 345); ADD_SHAPE_CONFIG(HEIGHT, 112); - ADD_SHAPE_CONFIG(DATE_HEIGHT, 46); + ADD_SHAPE_CONFIG(DATE_HEIGHT, 48); ADD_SHAPE_CONFIG(TITLE_HEIGHT, 36); - ADD_SHAPE_CONFIG(DATE_FONT_SIZE, 36); + ADD_SHAPE_CONFIG(DATE_FONT_SIZE, 34); ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(DATE_TEXT_LEFT_MARGIN, 20); - ADD_SHAPE_CONFIG(TEXT_ELEMENT_WIDTH, 132); - ADD_SHAPE_CONFIG(TEXT_ELEMENT_MIN_WIDTH, 122); - ADD_FIXED_VALUE_CONFIG(ITEM_DIVIDER_WIDTH, 2); + ADD_SHAPE_CONFIG(DATE_TEXT_LEFT_MARGIN, 17); + ADD_SHAPE_CONFIG(MONTH_YEAR_ELEMENT_WIDTH, 104); + ADD_SHAPE_CONFIG(MONTH_YEAR_ELEMENT_MIN_WIDTH, 104); ADD_SHAPE_CONFIG(ITEM_DIVIDER_HEIGHT, 42); - ADD_SHAPE_CONFIG(TITLE_DATE_MARGIN, 5); + ADD_SHAPE_CONFIG(TITLE_DATE_MARGIN, 6); ADD_SHAPE_CONFIG(DATE_BAR_MARGIN, 10); + ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 20); + ADD_SHAPE_CONFIG(ELEMENT_MARGIN, 17); + ADD_SHAPE_CONFIG(DAY_ELEMENT_WIDTH, 69); + ADD_SHAPE_CONFIG(DAY_ELEMENT_MIN_WIDTH, 69); - ADD_DIMENSION_CONFIG(MIN_SIZE, 370, 112); + ADD_DIMENSION_CONFIG(MIN_SIZE, 345, 112); } END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); { - ADD_DIMENSION_CONFIG(MIN_SIZE, 370, 112); - ADD_SHAPE_CONFIG(WIDTH, 730); - ADD_SHAPE_CONFIG(TEXT_ELEMENT_WIDTH, 242); + ADD_DIMENSION_CONFIG(MIN_SIZE, 345, 112); + ADD_SHAPE_CONFIG(WIDTH, 675); + ADD_SHAPE_CONFIG(MONTH_YEAR_ELEMENT_WIDTH, 229); + ADD_SHAPE_CONFIG(DAY_ELEMENT_WIDTH, 149); } END_UI_CONFIG_MODE(1280x720); diff --git a/src/ui/resource/FUi_ResourceEditTimeConfig.cpp b/src/ui/resource/FUi_ResourceEditTimeConfig.cpp index d2af95e..e494566 100644 --- a/src/ui/resource/FUi_ResourceEditTimeConfig.cpp +++ b/src/ui/resource/FUi_ResourceEditTimeConfig.cpp @@ -36,8 +36,8 @@ START_UI_CONFIG(EDITTIME); ADD_COLOR_CONFIG(BUTTON_TEXT_PRESSED, $F031L1P); ADD_COLOR_CONFIG(BUTTON_TEXT_DISABLED, $F031L1D); ADD_COLOR_CONFIG(TEXT_NORMAL, $F011L1); - ADD_COLOR_CONFIG(TEXT_PRESSED, $F011L2); - ADD_COLOR_CONFIG(TEXT_DISABLED, $F011L1); + ADD_COLOR_CONFIG(TEXT_PRESSED, $F011L1P); + ADD_COLOR_CONFIG(TEXT_DISABLED, $F011L1D); ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $B052L5); ADD_COLOR_CONFIG(TITLE_TEXT_DISABLED, $B052L5); @@ -59,34 +59,35 @@ START_UI_CONFIG(EDITTIME); START_UI_CONFIG_MODE(720x1280); { - ADD_SHAPE_CONFIG(WIDTH, 292); + ADD_SHAPE_CONFIG(WIDTH, 306); ADD_SHAPE_CONFIG(HEIGHT, 112); - ADD_SHAPE_CONFIG(TIME_WIDTH, 114); - ADD_SHAPE_CONFIG(HOUR_MINUTE_WIDTH, 48); - ADD_SHAPE_CONFIG(TITLE_TIME_MARGIN, 5); + ADD_SHAPE_CONFIG(TIME_WIDTH, 160); + ADD_SHAPE_CONFIG(HOUR_MINUTE_WIDTH, 69); + ADD_SHAPE_CONFIG(HOUR_MINUTE_MIN_WIDTH, 69); + ADD_SHAPE_CONFIG(TITLE_TIME_MARGIN, 6); ADD_SHAPE_CONFIG(TIME_BAR_MARGIN, 10); - ADD_SHAPE_CONFIG(TIME_HEIGHT, 46); - ADD_SHAPE_CONFIG(TIME_AMPM_MARGIN, 26); - ADD_SHAPE_CONFIG(AMPM_WIDTH, 106); - ADD_SHAPE_CONFIG(AMPM_HEIGHT, 56); + ADD_SHAPE_CONFIG(TIME_HEIGHT, 48); + ADD_SHAPE_CONFIG(TIME_AMPM_MARGIN, 17); + ADD_SHAPE_CONFIG(AMPM_WIDTH, 95); + ADD_SHAPE_CONFIG(AMPM_HEIGHT, 60); ADD_SHAPE_CONFIG(TITLE_HEIGHT, 36); - ADD_SHAPE_CONFIG(TIME_FONT_SIZE, 36); + ADD_SHAPE_CONFIG(TIME_FONT_SIZE, 34); ADD_SHAPE_CONFIG(TEXT_FONT_SIZE, 32); - ADD_SHAPE_CONFIG(AMPM_FONT_SIZE, 36); + ADD_SHAPE_CONFIG(AMPM_FONT_SIZE, 34); ADD_SHAPE_CONFIG(COLON_WIDTH, 12); - ADD_SHAPE_CONFIG(COLON_MARGIN, 3); - ADD_SHAPE_CONFIG(TIME_TEXT_LEFT_MARGIN, 20); - ADD_SHAPE_CONFIG(TIME_TEXT_LEFT_MIN_MARGIN, 10); - ADD_DIMENSION_CONFIG(MIN_SIZE, 270, 112); + ADD_SHAPE_CONFIG(COLON_MARGIN, 5); + ADD_SHAPE_CONFIG(TIME_TEXT_LEFT_MARGIN, 17); + ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 20); + ADD_DIMENSION_CONFIG(MIN_SIZE, 306, 112); } END_UI_CONFIG_MODE(720x1280); START_UI_CONFIG_MODE(1280x720); { - ADD_DIMENSION_CONFIG(MIN_SIZE, 270, 112); - ADD_SHAPE_CONFIG(WIDTH, 516); - ADD_SHAPE_CONFIG(TIME_WIDTH, 242); - ADD_SHAPE_CONFIG(TIME_AMPM_MARGIN, 84); + ADD_DIMENSION_CONFIG(MIN_SIZE, 306, 112); + ADD_SHAPE_CONFIG(WIDTH, 466); + ADD_SHAPE_CONFIG(HOUR_MINUTE_WIDTH, 149); + ADD_SHAPE_CONFIG(TIME_WIDTH, 320); } END_UI_CONFIG_MODE(1280x720); } -- 2.7.4