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

Improvements for widget alignment #367

Merged
merged 3 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion panel/models/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export abstract class Player extends Widget {
value: [ p.Any, 0 ],
})

this.override({width: 350})
this.override({width: 400})
}
}

Expand Down
11 changes: 7 additions & 4 deletions panel/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,13 @@ def link(change):
options = options.values()
if ((is_parameterized(value) or any(is_parameterized(o) for o in options))
and (self.expand_button or (self.expand_button is None and not self.expand))):
toggle = Toggle(name='\u00B7\u00B7\u00B7', button_type='primary',
disabled=not is_parameterized(value),
max_width=40, height_policy='fit')
return Row(widget, toggle)
widget.margin = (5, 0, 5, 10)
toggle = Toggle(name='\u22EE', button_type='primary',
disabled=not is_parameterized(value), max_height=30,
max_width=20, height_policy='fit', align='center',
margin=(0, 0, 0, 10))
widget.width = self._widget_box.width-60
return Row(widget, toggle, width_policy='max', margin=0)
else:
return widget

Expand Down
5 changes: 5 additions & 0 deletions panel/viewable.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@

class Layoutable(param.Parameterized):

align = param.ObjectSelector(default='start',
objects=['start', 'end', 'center'], doc="""
Whether the object should be aligned with the start, end or
center of its container""")

aspect_ratio = param.Parameter(default=None, doc="""
Describes the proportional relationship between component's
width and height. This works if any of component's dimensions
Expand Down