From: Park Kyoung Hee Date: Tue, 2 Apr 2013 10:28:50 +0000 (+0900) Subject: apply black theme image of scrolling effect X-Git-Tag: accepted/tizen_2.1/20130425.033138~460^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf88d358ea5fd07d74d192c9dd763a286edb9242;p=framework%2Fosp%2Fuifw.git apply black theme image of scrolling effect Change-Id: I5c59585e3fd35f6f1165f223ed68c63a5c48735e Signed-off-by: Park Kyoung Hee --- diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_bottom.#.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_bottom.#.png new file mode 100644 index 0000000..155b4ee Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_bottom.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_left.#.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_left.#.png new file mode 100644 index 0000000..2a0f9dd Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_left.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_right.#.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_right.#.png new file mode 100644 index 0000000..9ee6dd4 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_right.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_top.#.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_top.#.png new file mode 100644 index 0000000..a12762b Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_overscrolling_top.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_bottom.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_bottom.#.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_bottom.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_left.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_left.#.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_left.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_right.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_right.#.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_right.#.png diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_top.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/480x800/00_overscrolling_top.#.png rename to res/common/usr/share/osp/bitmaps/480x800/white/00_overscrolling_top.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_bottom.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_bottom.#.png new file mode 100644 index 0000000..d3477a2 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_bottom.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_left.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_left.#.png new file mode 100644 index 0000000..d88ac6d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_left.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_right.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_right.#.png new file mode 100644 index 0000000..f9fa49d Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_right.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_top.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_top.#.png new file mode 100644 index 0000000..72301b8 Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_overscrolling_top.#.png differ diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_bottom.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_bottom.#.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_bottom.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_left.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_left.#.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_left.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_right.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_right.#.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_right.#.png diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_top.#.png old mode 100755 new mode 100644 similarity index 100% rename from res/common/usr/share/osp/bitmaps/720x1280/00_overscrolling_top.#.png rename to res/common/usr/share/osp/bitmaps/720x1280/white/00_overscrolling_top.#.png diff --git a/src/ui/controls/FUiCtrl_ScrollPanel.cpp b/src/ui/controls/FUiCtrl_ScrollPanel.cpp index 2f82810..7e6f8af 100644 --- a/src/ui/controls/FUiCtrl_ScrollPanel.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPanel.cpp @@ -123,7 +123,7 @@ _ScrollPanel::CreateScrollPanelN(const FloatRectangle& rect, ScrollPanelScrollDi _Scroll* pHorizontalScrollBar = null; _Scroll* pVerticalScrollBar = null; - FloatRectangle areaBounds = const_cast(rect); + FloatRectangle areaBounds(rect); _ScrollPanel* pScrollPanel = new (std::nothrow) _ScrollPanel; SysTryReturn(NID_UI_CTRL, pScrollPanel != null, null, E_OUT_OF_MEMORY, "[%s] The memory is insufficient.", GetErrorMessage(E_OUT_OF_MEMORY)); diff --git a/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp b/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp index 1f33e2c..5c1b53a 100644 --- a/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ScrollPanelPresenter.cpp @@ -208,8 +208,7 @@ _ScrollPanelPresenter::OnBoundsChanged(void) void _ScrollPanelPresenter::OnChildAttached(const _Control& child) { - if (&child != __pScrollPanel->GetVerticalScrollBar() - && &child != __pScrollPanel->GetHorizontalScrollBar()) + if (child.GetArea() != _CONTROL_AREA_SYSTEM) { if (__pScrollPanel->IsScrollAreaAutoResizingEnabled()) { @@ -226,8 +225,7 @@ _ScrollPanelPresenter::OnChildAttached(const _Control& child) void _ScrollPanelPresenter::OnChildDetached(const _Control& child) { - if (&child != __pScrollPanel->GetVerticalScrollBar() - && &child != __pScrollPanel->GetHorizontalScrollBar()) + if (child.GetArea() != _CONTROL_AREA_SYSTEM) { if (__pScrollPanel->IsScrollAreaAutoResizingEnabled()) { @@ -244,8 +242,7 @@ _ScrollPanelPresenter::OnChildDetached(const _Control& child) void _ScrollPanelPresenter::OnChildBoundsChanged(const _Control& child) { - if (&child != __pScrollPanel->GetVerticalScrollBar() - && &child != __pScrollPanel->GetHorizontalScrollBar()) + if (child.GetArea() != _CONTROL_AREA_SYSTEM) { if (__pScrollPanel->IsScrollAreaAutoResizingEnabled()) { @@ -373,20 +370,31 @@ _ScrollPanelPresenter::FixScrollPositionIntoScrollAreaBounds(float position) con float _ScrollPanelPresenter::FixScrollPositionIntoScrollAreaBounds(float position, FloatRectangle bounds, FloatRectangle scrollArea) const { - float minScrollPos = 0.0f; - float maxScrollPos = 0.0f; + float minScrollPosition = 0.0f; + float maxScrollPosition = 0.0f; if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - minScrollPos = scrollArea.x; - maxScrollPos = scrollArea.x + scrollArea.width - bounds.width; + minScrollPosition = scrollArea.x; + maxScrollPosition = scrollArea.x + scrollArea.width - bounds.width; } else { - minScrollPos = scrollArea.y; - maxScrollPos = scrollArea.y + scrollArea.height - bounds.height; + minScrollPosition = scrollArea.y; + maxScrollPosition = scrollArea.y + scrollArea.height - bounds.height; + } + + if (minScrollPosition > maxScrollPosition) + { + maxScrollPosition = minScrollPosition; + } + if (position < minScrollPosition) + { + position = minScrollPosition; + } + if (position > maxScrollPosition) + { + position = maxScrollPosition; } - position = position < minScrollPos ? minScrollPos : position; - position = position > maxScrollPos ? maxScrollPos : position; return position; } @@ -495,23 +503,25 @@ _ScrollPanelPresenter::RunTouchReleased(const _Control& source, const _TouchInfo if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { pageSize = __pScrollPanel->GetPageScrollAlignSize().width; - maxPosition = GetScrollAreaBounds().width - pageSize; + maxPosition = GetScrollAreaBounds().width - __pScrollPanel->GetBoundsF().width; currentPosition = GetHorizontalScrollPosition(); } else { pageSize = __pScrollPanel->GetPageScrollAlignSize().height; - maxPosition = GetScrollAreaBounds().height - pageSize; + maxPosition = GetScrollAreaBounds().height - __pScrollPanel->GetBoundsF().height; currentPosition = GetVerticalScrollPosition(); } float targetPosition = 0.0f; - float pageGap = currentPosition - (((int)(currentPosition / pageSize)) * pageSize); int lowerPageIndex = currentPosition / pageSize; float currentPageMin = pageSize * lowerPageIndex; + float pageGap = currentPosition - currentPageMin; float currentPageMax = currentPageMin + pageSize; - currentPageMin = currentPageMax > maxPosition ? (maxPosition / pageSize) * pageSize : currentPageMin; - currentPageMax = currentPageMax > maxPosition ? maxPosition : currentPageMax; + if (currentPageMax > maxPosition) + { + currentPageMax = maxPosition; + } if (pageGap <= currentPageMax - currentPageMin - pageGap) { @@ -984,22 +994,20 @@ _ScrollPanelPresenter::DoFlickGestureRecognized(_TouchFlickGestureDetector& gest if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { pageSize = __pScrollPanel->GetPageScrollAlignSize().width; - maxPosition = scrollArea.width - pageSize; + maxPosition = scrollArea.width - scrollPanelBounds.width; scrollPosition = __pScrollPanelModel->GetCurrentHorizontalScrollPosition(); } else { pageSize = __pScrollPanel->GetPageScrollAlignSize().height; - maxPosition = scrollArea.height - pageSize; + maxPosition = scrollArea.height - scrollPanelBounds.height; scrollPosition = __pScrollPanelModel->GetCurrentVerticalScrollPosition(); } - float pageGap = scrollPosition - (((int)(scrollPosition / pageSize)) * pageSize); int lowerPageIndex = (scrollPosition + moveAmount) / pageSize; float targetPageMin = pageSize * lowerPageIndex; + float pageGap = (scrollPosition + moveAmount) - targetPageMin; float targetPageMax = targetPageMin + pageSize; - targetPageMin = targetPageMax > maxPosition ? (maxPosition / pageSize) * pageSize : targetPageMin; - targetPageMax = targetPageMax > maxPosition ? maxPosition : targetPageMax; if (pageGap <= targetPageMax - targetPageMin - pageGap) { @@ -1369,13 +1377,16 @@ _ScrollPanelPresenter::AdjustModel() _Control* pControl = __pScrollPanel->GetChild(i); SysTryReturnVoidResult(NID_UI_CTRL, pControl != null, E_SYSTEM, "[%s] pControl(child) is invalid pointer.", GetErrorMessage(E_SYSTEM)); - if (pControl == pVerticalScrollBar || pControl == pHorizontalScrollBar) + if (pControl->GetArea() == _CONTROL_AREA_SYSTEM) { continue; } float targetMaxPos = pControl->GetBoundsF().GetBottomRight().y; - scrollArea.height = (scrollArea.height < targetMaxPos) ? targetMaxPos : scrollArea.height; + if (scrollArea.height < targetMaxPos) + { + scrollArea.height = targetMaxPos; + } } } else if (__pScrollPanel->GetScrollDirection() == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) @@ -1385,13 +1396,16 @@ _ScrollPanelPresenter::AdjustModel() _Control* pControl = __pScrollPanel->GetChild(i); SysTryReturnVoidResult(NID_UI_CTRL, pControl != null, E_SYSTEM, "[%s] pControl(child) is invalid pointer.", GetErrorMessage(E_SYSTEM)); - if (pControl == pVerticalScrollBar || pControl == pHorizontalScrollBar) + if (pControl->GetArea() == _CONTROL_AREA_SYSTEM) { continue; } float targetMaxPos = pControl->GetBoundsF().GetBottomRight().x; - scrollArea.width = (scrollArea.width < targetMaxPos) ? targetMaxPos : scrollArea.width; + if (scrollArea.width < targetMaxPos) + { + scrollArea.width = targetMaxPos; + } } } } @@ -1400,13 +1414,19 @@ _ScrollPanelPresenter::AdjustModel() scrollArea = GetScrollAreaBounds(); if (scrollDirection == SCROLL_PANEL_SCROLL_DIRECTION_HORIZONTAL) { - scrollArea.width = scrollArea.width < scrollPanelBounds.width ? scrollPanelBounds.width : scrollArea.width; + if (scrollArea.width < scrollPanelBounds.width) + { + scrollArea.width = scrollPanelBounds.width; + } scrollArea.height = scrollPanelBounds.height; } else { scrollArea.width = scrollPanelBounds.width; - scrollArea.height = scrollArea.height < scrollPanelBounds.height ? scrollPanelBounds.height : scrollArea.height; + if (scrollArea.height < scrollPanelBounds.height) + { + scrollArea.height = scrollPanelBounds.height; + } } }