projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[dali_2.3.37] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
controls
/
slider
/
slider-impl.cpp
diff --git
a/dali-toolkit/internal/controls/slider/slider-impl.cpp
b/dali-toolkit/internal/controls/slider/slider-impl.cpp
index
a48ddbe
..
20b498c
100644
(file)
--- a/
dali-toolkit/internal/controls/slider/slider-impl.cpp
+++ b/
dali-toolkit/internal/controls/slider/slider-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
1
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
4
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-862,14
+862,16
@@
float Slider::SnapToMark(float value)
for(MarkList::SizeType i = 0; i < mMarks.Count(); ++i)
{
const Property::Value& propertyValue = mMarks[i];
for(MarkList::SizeType i = 0; i < mMarks.Count(); ++i)
{
const Property::Value& propertyValue = mMarks[i];
- propertyValue.Get(mark);
- mark = MapValuePercentage(mark);
-
- float dist = fabsf(mark - value);
- if(dist < closestDist)
+ if(propertyValue.Get(mark))
{
{
- closestDist = dist;
- closestMark = mark;
+ mark = MapValuePercentage(mark);
+
+ float dist = fabsf(mark - value);
+ if(dist < closestDist)
+ {
+ closestDist = dist;
+ closestMark = mark;
+ }
}
}
}
}
@@
-891,22
+893,24
@@
bool Slider::MarkReached(float value, int& outIndex)
current = head + (tail - head) / 2;
const Property::Value& propertyValue = mMarks[current];
current = head + (tail - head) / 2;
const Property::Value& propertyValue = mMarks[current];
- propertyValue.Get(mark);
- mark = MapValuePercentage(mark);
-
- if(fabsf(mark - value) < MARK_TOLERANCE)
+ if(propertyValue.Get(mark))
{
{
- outIndex = current;
- return true;
- }
+ mark = MapValuePercentage(mark);
- if(value < mark)
- {
- tail = current - 1;
- }
- else
- {
- head = current + 1;
+ if(fabsf(mark - value) < MARK_TOLERANCE)
+ {
+ outIndex = current;
+ return true;
+ }
+
+ if(value < mark)
+ {
+ tail = current - 1;
+ }
+ else
+ {
+ head = current + 1;
+ }
}
}
}
}
@@
-949,9
+953,11
@@
void Slider::SetValue(float value)
{
mValue = value;
DisplayValue(mValue, true);
{
mValue = value;
DisplayValue(mValue, true);
- if(Self() == Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor())
+
+ auto accessible = GetAccessibleObject();
+ if(DALI_LIKELY(accessible) && accessible->IsHighlighted())
{
{
-
GetAccessibleObject()
->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::VALUE);
+
accessible
->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::VALUE);
}
}
}
}
@@
-1424,6
+1430,11
@@
double Slider::SliderAccessible::GetCurrent() const
return self.GetProperty(Toolkit::Slider::Property::VALUE).Get<float>();
}
return self.GetProperty(Toolkit::Slider::Property::VALUE).Get<float>();
}
+std::string Slider::SliderAccessible::GetValueText() const
+{
+ return {}; // Text mode is not used at the moment
+}
+
double Slider::SliderAccessible::GetMaximum() const
{
auto self = Toolkit::Slider::DownCast(Self());
double Slider::SliderAccessible::GetMaximum() const
{
auto self = Toolkit::Slider::DownCast(Self());
@@
-1435,7
+1446,7
@@
bool Slider::SliderAccessible::SetCurrent(double current)
if(current < GetMinimum() || current > GetMaximum())
return false;
if(current < GetMinimum() || current > GetMaximum())
return false;
- auto self = Toolkit::Slider::DownCast(Self());
+ auto
self = Toolkit::Slider::DownCast(Self());
auto& impl = Toolkit::GetImpl(self);
const float prev = self.GetProperty<float>(Toolkit::Slider::Property::VALUE);
auto& impl = Toolkit::GetImpl(self);
const float prev = self.GetProperty<float>(Toolkit::Slider::Property::VALUE);