#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali-toolkit/devel-api/text/rendering-backend.h>
#include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
#include <dali-toolkit/internal/styling/style-manager-impl.h>
#include <dali-toolkit/internal/text/rendering/text-backend.h>
#include <dali-toolkit/internal/text/text-effects-style.h>
if(mController && mController->IsShowingRealText())
{
mController->SelectWholeText();
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
}
mController->TapEvent(gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top);
mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top);
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
void TextEditor::OnPan(const PanGesture& gesture)
const Vector2& localPoint = gesture.GetLocalPoint();
mController->LongPressEvent(gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top);
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
bool TextEditor::OnKeyEvent(const KeyEvent& event)
if(mController && mController->IsShowingRealText())
{
mController->SetTextSelectionRange(start, end);
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
}
return true;
}
-Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset( size_t offset, Dali::Accessibility::TextBoundary boundary)
+Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary)
{
- auto self = Toolkit::TextEditor::DownCast(Self());
- auto text = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
+ auto self = Toolkit::TextEditor::DownCast(Self());
+ auto text = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
auto textSize = text.size();
auto range = Dali::Accessibility::Range{};
case Dali::Accessibility::TextBoundary::LINE:
{
auto textString = text.c_str();
- auto breaks = std::vector<char>(textSize, 0);
+ auto breaks = std::vector<char>(textSize, 0);
if(boundary == Dali::Accessibility::TextBoundary::WORD)
{
return {};
}
- auto self = Toolkit::TextEditor::DownCast(Self());
- auto controller = Dali::Toolkit::GetImpl(self).GetTextController();
+ auto self = Toolkit::TextEditor::DownCast(Self());
+ auto controller = Dali::Toolkit::GetImpl(self).GetTextController();
std::string value{};
controller->RetrieveSelection(value);
auto indices = controller->GetSelectionIndexes();
{
using namespace Dali::Accessibility;
- auto states = DevelControl::AccessibleImpl::CalculateStates();
+ auto states = DevelControl::AccessibleImpl::CalculateStates();
states[State::EDITABLE] = true;
states[State::FOCUSABLE] = true;
bool TextEditor::AccessibleImpl::InsertText(size_t startPosition, std::string text)
{
- auto self = Toolkit::TextEditor::DownCast(Self());
+ auto self = Toolkit::TextEditor::DownCast(Self());
auto insertedText = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
insertedText.insert(startPosition, text);
#include <dali-toolkit/devel-api/controls/text-controls/text-field-devel.h>
#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
#include <dali-toolkit/devel-api/text/rendering-backend.h>
+#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
#include <dali-toolkit/internal/styling/style-manager-impl.h>
#include <dali-toolkit/internal/text/rendering/text-backend.h>
#include <dali-toolkit/internal/text/text-effects-style.h>
if(mController && mController->IsShowingRealText())
{
mController->SelectWholeText();
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
}
if(mController && mController->IsShowingRealText())
{
mController->SetTextSelectionRange(start, end);
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
}
mController->TapEvent(gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top);
mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top);
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
void TextField::OnPan(const PanGesture& gesture)
const Vector2& localPoint = gesture.GetLocalPoint();
mController->LongPressEvent(gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top);
- SetKeyInputFocus();
+ if(!Self().GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
+ {
+ SetKeyInputFocus();
+ }
}
bool TextField::OnKeyEvent(const KeyEvent& event)
Dali::Accessibility::Range TextField::AccessibleImpl::GetTextAtOffset(
size_t offset, Dali::Accessibility::TextBoundary boundary)
{
- auto self = Toolkit::TextField::DownCast(Self());
- auto text = self.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
+ auto self = Toolkit::TextField::DownCast(Self());
+ auto text = self.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
auto textSize = text.size();
auto range = Dali::Accessibility::Range{};
case Dali::Accessibility::TextBoundary::LINE:
{
auto textString = text.c_str();
- auto breaks = std::vector<char>(textSize, 0);
+ auto breaks = std::vector<char>(textSize, 0);
if(boundary == Dali::Accessibility::TextBoundary::WORD)
{
return {};
}
- auto self = Toolkit::TextField::DownCast(Self());
- auto controller = Dali::Toolkit::GetImpl(self).GetTextController();
+ auto self = Toolkit::TextField::DownCast(Self());
+ auto controller = Dali::Toolkit::GetImpl(self).GetTextController();
std::string value{};
controller->RetrieveSelection(value);
auto indices = controller->GetSelectionIndexes();
bool TextField::AccessibleImpl::InsertText(size_t startPosition, std::string text)
{
- auto self = Toolkit::TextField::DownCast(Self());
+ auto self = Toolkit::TextField::DownCast(Self());
auto insertedText = self.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
insertedText.insert(startPosition, text);
textureColor = mix(textureColor, vec4(borderlineColor.xyz, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
}
borderlineOpacity *= borderlineColor.a;
+ return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
}
- return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
+ return mix(textureColor, borderlineColor, borderlineOpacity);
}
#endif
void main()
{
- lowp vec4 targetColor = vec4(mixColor, 1.0) * uColor;
+ lowp vec4 targetColor = vec4(mixColor, 1.0);
#if IS_REQUIRED_BLUR || IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
// skip most potential calculate for performance
if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
{
- OUT_COLOR = targetColor;
+ OUT_COLOR = targetColor * uColor;
return;
}
PreprocessPotential();
#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
targetColor = convertBorderlineColor(targetColor);
#endif
- OUT_COLOR = targetColor;
+ OUT_COLOR = targetColor * uColor;
#if IS_REQUIRED_BLUR
mediump float opacity = calculateBlurOpacity();
textureColor = mix(textureColor, vec4(borderlineColor.xyz, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
}
borderlineOpacity *= borderlineColor.a;
+ return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
}
- return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
+ return mix(textureColor, borderlineColor, borderlineOpacity);
}
#endif
void main()
{
#if RADIAL
- lowp vec4 textureColor = TEXTURE(sTexture, vec2(length(vTexCoord), 0.5)) * vec4(mixColor, 1.0) * uColor;
+ lowp vec4 textureColor = TEXTURE(sTexture, vec2(length(vTexCoord), 0.5)) * vec4(mixColor, 1.0);
#else
- lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0) * uColor;
+ lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0);
#endif
#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
// skip most potential calculate for performance
if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
{
- OUT_COLOR = textureColor;
+ OUT_COLOR = textureColor * uColor;
return;
}
PreprocessPotential();
#if IS_REQUIRED_BORDERLINE
textureColor = convertBorderlineColor(textureColor);
#endif
- OUT_COLOR = textureColor;
+ OUT_COLOR = textureColor * uColor;
#if IS_REQUIRED_ROUNDED_CORNER
mediump float opacity = calculateCornerOpacity();
mediump float tCornerRadius = -gCenterPosition;
mediump float MaxTexturelinePotential = tCornerRadius + gPotentialRange;
mediump float MinTexturelinePotential = tCornerRadius - gPotentialRange;
+ lowp vec3 BorderlineColorRGB = borderlineColor.xyz;
+ BorderlineColorRGB *= mix(1.0, borderlineColor.a, preMultipliedAlpha);
if(potential > MaxTexturelinePotential)
{
// potential is out of texture range. use borderline color instead of texture
- textureColor = vec4(borderlineColor.xyz, 0.0);
+ textureColor = vec4(BorderlineColorRGB, 0.0);
}
else if(potential > MinTexturelinePotential)
{
// potential is in texture range
- textureColor = mix(textureColor, vec4(borderlineColor.xyz, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
+ textureColor = mix(textureColor, vec4(BorderlineColorRGB, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
}
borderlineOpacity *= borderlineColor.a;
+ return mix(textureColor, vec4(BorderlineColorRGB, 1.0), borderlineOpacity);
}
- return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
+ return mix(textureColor, borderlineColor, borderlineOpacity);
}
#endif
mediump vec2 texCoord = vTexCoord;
#endif
- lowp vec4 textureColor = TEXTURE( sTexture, texCoord ) * uColor * vec4( mixColor, 1.0 );
+ lowp vec4 textureColor = TEXTURE( sTexture, texCoord ) * vec4( mixColor, 1.0 );
#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
// skip most potential calculate for performance
if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
{
- OUT_COLOR = textureColor;
+ OUT_COLOR = textureColor * uColor;
return;
}
PreprocessPotential();
#if IS_REQUIRED_BORDERLINE
textureColor = convertBorderlineColor(textureColor);
#endif
- OUT_COLOR = textureColor;
+ OUT_COLOR = textureColor * uColor;
#if IS_REQUIRED_ROUNDED_CORNER
mediump float opacity = calculateCornerOpacity();