Commit ff252337b4a5c2ceac642cd2b18816701425178f
1 parent
c06d81af
Fix labeling bug at image-view.example
There was some bug when we click 'Change' button. Now we fix it. + Third button will show 'current status'. Not 'next status'. (previous version may confused to beginner) Change-Id: I9e2509accc589de9d5bcafe72097d08c55eef24a Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
Showing
1 changed file
with
22 additions
and
10 deletions
examples/image-view/image-view-example.cpp
| ... | ... | @@ -76,7 +76,7 @@ enum { |
| 76 | 76 | STATUS_NORMAL = 0, |
| 77 | 77 | STATUS_ROUND = 1, |
| 78 | 78 | STATUS_BORDERLINE = 2, |
| 79 | - STATUS_ROUNDED_BORDERLINE = 3, | |
| 79 | + STATUS_ROUNDED_BORDERLINE = STATUS_ROUND | STATUS_BORDERLINE, | |
| 80 | 80 | NUMBER_OF_STATUS, |
| 81 | 81 | }; |
| 82 | 82 | const char* BUTTON_LABEL[NUMBER_OF_STATUS] = { |
| ... | ... | @@ -162,7 +162,7 @@ public: |
| 162 | 162 | mTable.AddChild(button2, Toolkit::TableView::CellPosition(CellPlacement::MID_BUTTON, x)); |
| 163 | 163 | |
| 164 | 164 | Toolkit::PushButton button3 = Toolkit::PushButton::New(); |
| 165 | - button3.SetProperty(Toolkit::Button::Property::LABEL, BUTTON_LABEL[(STATUS_NORMAL + 1) % NUMBER_OF_STATUS]); | |
| 165 | + button3.SetProperty(Toolkit::Button::Property::LABEL, BUTTON_LABEL[STATUS_NORMAL]); | |
| 166 | 166 | button3.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER); |
| 167 | 167 | button3.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER); |
| 168 | 168 | button3.ClickedSignal().Connect(this, &ImageViewController::RoundedCornerClicked); |
| ... | ... | @@ -234,13 +234,19 @@ private: |
| 234 | 234 | mImageViewImageIndexStatus[buttonIndex] = 0; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - // Reset corner radius state value | |
| 238 | - mImageViewRoundedCornerStatus[buttonIndex] = STATUS_NORMAL; | |
| 239 | - button.SetProperty(Toolkit::Button::Property::LABEL, BUTTON_LABEL[(mImageViewRoundedCornerStatus[buttonIndex] + 1) % NUMBER_OF_STATUS]); | |
| 240 | - | |
| 241 | 237 | Property::Map imagePropertyMap; |
| 242 | 238 | imagePropertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE); |
| 243 | 239 | imagePropertyMap.Insert(Toolkit::ImageVisual::Property::URL, IMAGE_PATH[mImageViewImageIndexStatus[buttonIndex]]); |
| 240 | + if(mImageViewRoundedCornerStatus[buttonIndex] & STATUS_ROUND) | |
| 241 | + { | |
| 242 | + imagePropertyMap.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS_VALUE); | |
| 243 | + } | |
| 244 | + if(mImageViewRoundedCornerStatus[buttonIndex] & STATUS_BORDERLINE) | |
| 245 | + { | |
| 246 | + imagePropertyMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH_VALUE); | |
| 247 | + imagePropertyMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET_VALUE); | |
| 248 | + } | |
| 249 | + | |
| 244 | 250 | mImageViews[buttonIndex].SetProperty(Toolkit::ImageView::Property::IMAGE, imagePropertyMap); |
| 245 | 251 | } |
| 246 | 252 | return true; |
| ... | ... | @@ -254,14 +260,20 @@ private: |
| 254 | 260 | { |
| 255 | 261 | mImageViewRoundedCornerStatus[buttonIndex] = (mImageViewRoundedCornerStatus[buttonIndex] + 1) % NUMBER_OF_STATUS; |
| 256 | 262 | |
| 257 | - button.SetProperty(Toolkit::Button::Property::LABEL, BUTTON_LABEL[(mImageViewRoundedCornerStatus[buttonIndex] + 1) % NUMBER_OF_STATUS]); | |
| 263 | + button.SetProperty(Toolkit::Button::Property::LABEL, BUTTON_LABEL[mImageViewRoundedCornerStatus[buttonIndex]]); | |
| 258 | 264 | |
| 259 | 265 | Property::Map imagePropertyMap; |
| 260 | 266 | imagePropertyMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE); |
| 261 | 267 | imagePropertyMap.Insert(Toolkit::ImageVisual::Property::URL, IMAGE_PATH[mImageViewImageIndexStatus[buttonIndex]]); |
| 262 | - imagePropertyMap.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, mImageViewRoundedCornerStatus[buttonIndex] & 1 ? CORNER_RADIUS_VALUE : 0.0f); | |
| 263 | - imagePropertyMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, mImageViewRoundedCornerStatus[buttonIndex] & 2 ? BORDERLINE_WIDTH_VALUE : 0.0f); | |
| 264 | - imagePropertyMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, mImageViewRoundedCornerStatus[buttonIndex] & 2 ? BORDERLINE_OFFSET_VALUE : 0.0f); | |
| 268 | + if(mImageViewRoundedCornerStatus[buttonIndex] & STATUS_ROUND) | |
| 269 | + { | |
| 270 | + imagePropertyMap.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS_VALUE); | |
| 271 | + } | |
| 272 | + if(mImageViewRoundedCornerStatus[buttonIndex] & STATUS_BORDERLINE) | |
| 273 | + { | |
| 274 | + imagePropertyMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH_VALUE); | |
| 275 | + imagePropertyMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET_VALUE); | |
| 276 | + } | |
| 265 | 277 | |
| 266 | 278 | mImageViews[buttonIndex].SetProperty(Toolkit::ImageView::Property::IMAGE, imagePropertyMap); |
| 267 | 279 | } | ... | ... |