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

let user set the side_panel height #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def set_anim_type(name):
x: root.x - \
(1-root._anim_progress)* \
root.side_panel_init_offset*root.side_panel_width
height: root.height
height: root.side_panel_height if root.side_panel_height else root.height
width: root.side_panel_width
opacity: root.side_panel_opacity + \
(1-root.side_panel_opacity)*root._anim_progress
Expand Down Expand Up @@ -244,6 +244,9 @@ class NavigationDrawer(StencilView):
side_panel_width = NumericProperty()
'''The width of the hidden side panel. Defaults to the minimum of
250dp or half the NavigationDrawer width.'''
side_panel_height = NumericProperty(0)
'''The height of the hidden side panel. Defaults to the
NavigationDrawer height, unless explicitly set by the user.'''
separator_image = StringProperty('')
'''The path to an image that will be placed between the side and main
panels. If set to `''`, defaults to a gradient from black to
Expand Down Expand Up @@ -612,6 +615,8 @@ def _choose_image(self, *args):
side_panel.add_widget(first_button)
side_panel.add_widget(Button(text='Another\nbutton'))
navigationdrawer.add_widget(side_panel)
navigationdrawer.side_panel_height = 400 # let the user choose the height of the side panel
# If he doesn't choose, it defaults to the full height

label_head = (
'[b]Example label filling main panel[/b]\n\n[color=ff0000](p'
Expand Down