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

MxBoxLayout allocation bug #36

Open
ghost opened this issue Feb 13, 2012 · 2 comments
Open

MxBoxLayout allocation bug #36

ghost opened this issue Feb 13, 2012 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 13, 2012

The children's allocation doesn't honour the MX_ALIGN_END flag when the allocation box is smaller than the sum of all children's natural width/height.

@ghost
Copy link
Author

ghost commented Feb 13, 2012

const Lang = imports.lang;
const Clutter = imports.gi.Clutter;
const Mx = imports.gi.Mx;

Clutter.init(null, null);

var mwindow = new Mx.Window();
mwindow.connect('destroy', Lang.bind(this, Clutter.main_quit));
mwindow.set_window_size(200, 100);

var mhbox = new Mx.BoxLayout({ orientation: Mx.Orientation.HORIZONTAL });
mwindow.set_child(mhbox);

var hbox_buttons = new Mx.BoxLayout({ orientation: Mx.Orientation.HORIZONTAL });
mhbox.add_actor(hbox_buttons, 0);
mhbox.child_set_expand(hbox_buttons, true);
mhbox.child_set_x_fill(hbox_buttons, false);
mhbox.child_set_x_align(hbox_buttons, Mx.Align.START);

var hbox_applets = new Mx.BoxLayout({ orientation: Mx.Orientation.HORIZONTAL });
mhbox.add_actor(hbox_applets, 2);
mhbox.child_set_expand(hbox_applets, false);
mhbox.child_set_x_fill(hbox_applets, false);
mhbox.child_set_x_align(hbox_applets, Mx.Align.END);

var button = new Mx.Button({ label: "Test1 Test1",
icon_name: "player_play",
label_visible: true });
hbox_buttons.add_actor(button, 0);
var button = new Mx.Button({ label: "Test2 Test2",
icon_name: "player_play" });
hbox_buttons.add_actor(button, 1);
var button = new Mx.Button({ label: "Test3 Test3",
icon_name: "player_play" });
hbox_buttons.add_actor(button, 2);

var button = new Mx.Button({ label: "Applet1",
icon_name: "player_play" });
hbox_applets.add_actor(button, 0);

mwindow.show();

Clutter.main();

@ghost
Copy link
Author

ghost commented Feb 13, 2012

Previously attached, a javascript example of the problem.
Try to expand the window's width, and at some point you will see the last button jumping from the right end side of the previous button to the end of the window.
This button should always be at the end if the window.

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

No branches or pull requests

0 participants