Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-14144] moved defer control rendering flag to not collide with size property #86

Merged
merged 6 commits into from Jun 13, 2013

Conversation

mtnlife999
Copy link
Contributor

No description provided.

@pec1985
Copy link
Contributor

pec1985 commented Jun 7, 2013

Setting top and bottom on the inner label does not expand its parent and places the label on the left instead of centering.

var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
    backgroundColor: 'blue',
    height: Ti.UI.SIZE
});

var label = Ti.UI.createLabel({
    text: 'hello world',
    backgroundColor: 'red',
    height: Ti.UI.SIZE,
    top: 10,
    bottom: 10
});

view.add(label);
win.add(view);
win.open()

@pec1985
Copy link
Contributor

pec1985 commented Jun 7, 2013

Setting the top and bottom of the inner label without a height property makes the parent view's height become FILL

var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
    backgroundColor: 'blue',
    height: Ti.UI.SIZE
});

var label = Ti.UI.createLabel({
    text: 'hello world',
    backgroundColor: 'red',
    top: 10,
    bottom: 10
});

view.add(label);
win.add(view);
win.open()

@pec1985
Copy link
Contributor

pec1985 commented Jun 7, 2013

Setting the parent view and label to width Ti.UI.SIZE and giving left and right properties to label, makes the parent view tiny and places the label on top. This needs to make the parent view width as big as the label plus the right and left margins.

var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
    backgroundColor: '#ccc',
    width: Ti.UI.SIZE,
});

var label = Ti.UI.createLabel({
    text: 'hello world',
    backgroundColor: 'red',
    width: Ti.UI.SIZE,
    left: 5, right: 5
});

view.add(label);
win.add(view);
win.open()

@pec1985
Copy link
Contributor

pec1985 commented Jun 10, 2013

Margins are broken again on views with SIZE as default.

This sample is supposed to grow the view and put a 10 margin on left and right, instead it sizes the view and puts a 10 margin on the left only.

var win = Ti.UI.createWindow();

var label = Ti.UI.createLabel({
    text: 'hello world',
    backgroundColor: 'red',
    right: 10,
    left: 10
});
win.add(label);
win.open()

This one is supposed to do the same but on top and bottom. It places the view on top and does not grow to it's bottom margin

var win = Ti.UI.createWindow();

var label = Ti.UI.createLabel({
    text: 'hello world',
    backgroundColor: 'red',
    top: 10,
    bottom: 10
});
win.add(label);
win.open()

This one makes the outer view become FILL, again, and the inner view, the label, have it's margins. The margins are fine, but the outer view should not be height FILL. Change the Label to a View and you will see the correct behavior.

var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
    backgroundColor: 'blue',
    height: Ti.UI.SIZE
});

var label = Ti.UI.createLabel({
    backgroundColor: 'red',
    height: 30, text: 'Hello World',
    left: 10, right: 10,
    top: 10, bottom: 10
});

view.add(label);
win.add(view);
win.open()

@pec1985
Copy link
Contributor

pec1985 commented Jun 11, 2013

These two cases still fail. It is supposed to create a label of width and height SIZE. The parent view is supposed to be bigger by 5 points margins all around
This one makes it tiny

var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
    backgroundColor: '#ccc',
    height: Ti.UI.SIZE,
    width: Ti.UI.SIZE
});

var label = Ti.UI.createLabel({
    text: 'hello world',
    backgroundColor: 'red',
    left:5, right: 5,
    top: 5, bottom: 5,
    width: Ti.UI.SIZE,
    height: Ti.UI.SIZE
});

view.add(label);
win.add(view);
win.open()

This one makes it fill the screen

var win = Ti.UI.createWindow();

var view = Ti.UI.createView({
    backgroundColor: '#ccc',
    height: Ti.UI.SIZE,
    width: Ti.UI.SIZE
});

var label = Ti.UI.createLabel({
    text: 'hello world',
    backgroundColor: 'red',
    left:5, right: 5,
    top: 5, bottom: 5
});

view.add(label);
win.add(view);
win.open()

Both of these cases need to behave the same.

@pec1985
Copy link
Contributor

pec1985 commented Jun 13, 2013

The second and last code snippet still fail. Add these lines to the NativeControlObject after line 205 and it will fix the layout

deferWidthType_ = Size;
deferHeightType_ = Size;

@pec1985 pec1985 merged commit 373ea00 into appcelerator-archive:master Jun 13, 2013
@pec1985
Copy link
Contributor

pec1985 commented Jun 13, 2013

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants