Merge branch 'feature/VNQ-#-edit-text-field-fixes' into 'master'

[VNQ-#] Фиксы в OffscreenEditText

See merge request qt/qtandroidextensions!95
parents 33798ee5 1677cf63
......@@ -332,6 +332,14 @@ void QAndroidOffscreenEditText::setPadding(int left, int top, int right, int bot
}
}
void QAndroidOffscreenEditText::setIncludeFontPadding(bool enabled)
{
if (QJniObject * view = offscreenView())
{
view->callVoid("setIncludeFontPadding", jboolean(enabled));
}
}
void QAndroidOffscreenEditText::setPaintFlags(int flags)
{
if (QJniObject * view = offscreenView())
......
......@@ -169,6 +169,7 @@ public:
//! Sets the padding.
void setPadding(int left, int top, int right, int bottom);
void setIncludeFontPadding(bool enabled);
// http://developer.android.com/reference/android/graphics/Paint.html
static const int
......
......@@ -118,6 +118,7 @@ public slots:
//! Sets the padding.
void setPadding(int left, int top, int right, int bottom) { androidEditText()->setPadding(left, top, right, bottom); }
void setIncludeFontPadding(bool enabled) { androidEditText()->setIncludeFontPadding(enabled); }
//! Sets flags on the Paint being used to display the text and reflows the text if they are different from the old flags.
void setPaintFlags(int flags) { androidEditText()->setPaintFlags(flags); }
......
......@@ -649,6 +649,16 @@ class OffscreenEditText extends OffscreenView
});
}
void setIncludeFontPadding(final boolean enabled)
{
runViewAction(new Runnable(){
@Override
public void run(){
((MyEditText)getView()).setIncludeFontPadding(enabled);
}
});
}
void setPaintFlags(final int flags)
{
runViewAction(new Runnable(){
......
......@@ -320,7 +320,7 @@ public abstract class OffscreenView
layout_.setRight(view_width_);
layout_.setBottom(view_height_);
}
layout_.addView(view);
layout_.addView(view, new ViewGroup.LayoutParams(view_width_, view_height_));
uiAttachViewToQtScreen();
}
......@@ -1079,6 +1079,7 @@ public abstract class OffscreenView
public void run() {
final View v = getView();
if (v != null) {
v.setLayoutParams(new ViewGroup.LayoutParams(w, h));
if (!attaching_mode_) {
if (getApiLevel() >= 11) {
v.setLeft(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment