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

Introduce a ToggleButtons button_width style attribute. #1257

Merged
merged 3 commits into from Jul 15, 2017

Conversation

Projects
None yet
2 participants
@jasongrout
Member

jasongrout commented Apr 5, 2017

Fixes #1189

screen shot 2017-04-05 at 3 10 41 pm

However, after doing this, I'm thinking we should do it a different way. For one, the assumption at https://github.com/jupyter-widgets/ipywidgets/blob/master/jupyter-js-widgets/src/widget.ts#L818 is now not true - the size of the widget could change. Two, perhaps a more useful default is to size the buttons with the content with some margin, with a minimum width so things don't get too small. Or use flex to layout the buttons in the space of the widget, so it's easy to control the total size of the buttons by changing the size of the buttons container.

@jasongrout

This comment has been minimized.

Member

jasongrout commented Apr 5, 2017

One question: is it more likely for people to want equal-sized buttons, or buttons sized to content?

@jasongrout jasongrout added this to the 7.0 milestone Apr 5, 2017

@maartenbreddels

This comment has been minimized.

Member

maartenbreddels commented Apr 18, 2017

Sometimes you want an ugly-but-using-all-the-availiable-space solution :)

@jasongrout

This comment has been minimized.

Member

jasongrout commented Apr 19, 2017

which would be equivalent to setting the button's width to flex: 1 (i.e., flex grow to fill space), right?

@maartenbreddels

This comment has been minimized.

Member

maartenbreddels commented Apr 20, 2017

I ment as small as possible, to use all the available space for widgets, would that also be possible?

@jasongrout

This comment has been minimized.

Member

jasongrout commented Apr 20, 2017

Okay, that was my question. Should we just change the default to 'size to content', but still provide an option to set a fixed size?

@jasongrout jasongrout force-pushed the jupyter-widgets:master branch 6 times, most recently from 0a7fab4 to c0fc921 May 19, 2017

@jasongrout

This comment has been minimized.

Member

jasongrout commented Jun 30, 2017

@jasongrout

This comment has been minimized.

Member

jasongrout commented Jul 9, 2017

which would be equivalent to setting the button's width to flex: 1 (i.e., flex grow to fill space), right?

Not sure what I was thinking there - we can't set the flex property in a width css attribute.

I'll punt this one to the beta.

jasongrout added some commits Jul 15, 2017

Abstract out the styling so it can be applied separately from registr…
…ation.

This is needed if, for example, the DOM structure is regenerated, and we want to set back the styles.

@jasongrout jasongrout force-pushed the jasongrout:tbuttonswidth branch from 5f0abd2 to 78e510f Jul 15, 2017

@jasongrout

This comment has been minimized.

Member

jasongrout commented Jul 15, 2017

I updated this for the current state of the codebase.

@jasongrout

This comment has been minimized.

Member

jasongrout commented Jul 15, 2017

Let's try this out. The default is the same fixed width as before. Setting the style.button_width to 'initial' makes each button size to its content.

@jasongrout jasongrout merged commit 6b68292 into jupyter-widgets:master Jul 15, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jasongrout jasongrout referenced this pull request Jul 15, 2017

Closed

Update Changelog #1279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment