mirror of https://github.com/kivy/kivy.git
Page:
Scollable Options in Settings panel
Pages
A draggable scrollbar using a slider
AdBuddiz Android advertisements integration for Kivy apps
Advanced Graphics: In Progress
An example of background Twisted server running on Android
Android Background Services
Android SDK NDK Information
Android SDK NDK Informations
Android native embedded browser
Android style menu app skeleton
Background Service using P4A android.service
Batch installer for windows(KivyInstaller)
Breaking changes in Kivy
Building Portable Package
Button(s) in settings panel
Buttons in Settings panel
Community Guidelines
Connecting Kivy with Anaconda (OSX)
Contextual Menus
Contextual menus
Control alpha of all the children
Create source distribution release on PyPI
Creating a Release APK
Data driven variables with kivy properties
Debugging widget sizes
Deep Linking with iOS and Android
Delayed Work using Clock
Drag and Drop Widgets
Dragable Widget
Draggable Scalable Button
Editable ComboBox
Editable Label
Embedding a Carousel inside a TabbedPanel
GestureBox
Home
Implementing Android Adaptive Icons
KEP001: Instantiate things other than widgets from kv
Kivy 2.0 api breaks
Kivy Blogs and Blog Posts
Kivy Python 2 Support Timeline
Kivy Technical FAQ
Kv language preprocessing
Linking ScreenManager to a different Widget
List of Kivy Projects
Markup Summary
Menu on long touch
Migration guide from legacy garden packages
Moving kivy.garden.xxx to kivy_garden.xxx and kivy.deps.xxx to kivy_deps.xxx
On touch current widget
On touch on current widget
Packaging Kivy apps written in Python 3, targeting Windows using Nuitka
Pyjnius Vibrator Example
Release Checklist
Release notes for 1.10.0
Release notes for 1.11.0
Sample Gestures
Scaler for Retina screen
Scollable Options in Settings panel
Scrollable Label
Setting Up Kivy with various popular IDE's
Setting up Pycharm on OSX (older versions)
Setting up garden with Mac Ports
Setting up kivy with various popular IDE
Simple slider with value in label
Snippet template
Snippets awaiting moderation
Snippets
Starting Kivy App and Service on bootup on Android
Styling a Spinner and SpinnerOption in KV
Talks and tutorials
Theming Kivy
Tiled Maps & Tile Based Movement
Tiling the background of a widget with an image, pixel perfect
Ubuntu Touch
Updating widget content from a items list
User Snippets
Using Asynchronous programming inside a Kivy application
Using Buildozer on windows 10 using WSL
Viewport with fixed resolution autofit to window
Windows RT
Working with Python threads inside a Kivy application
rand0m app
wiki_proposed
3
Scollable Options in Settings panel
Brendan M. Sleight edited this page 2018-11-18 14:10:12 +00:00
Table of Contents
##Summary
- author: Thica
- kivy: >= 1.40
Hello all,
I would like to share a short snippet, if you need more options than fits on the screen. The original kivy options settings will scale outside screen dimensions, if you have a larger numeber of options:
Usage
- We need to have a new class based on SettingOptions
#!python
class SettingScrollOptions(SettingOptions):
def _create_popup(self, instance):
#global oORCA
# create the popup
content = GridLayout(cols=1, spacing='5dp')
scrollview = ScrollView( do_scroll_x=False)
scrollcontent = GridLayout(cols=1, spacing='5dp', size_hint=(None, None))
scrollcontent.bind(minimum_height=scrollcontent.setter('height'))
self.popup = popup = Popup(content=content, title=self.title, size_hint=(0.5, 0.9), auto_dismiss=False)
#we need to open the popup first to get the metrics
popup.open()
#Add some space on top
content.add_widget(Widget(size_hint_y=None, height=dp(2)))
# add all the options
uid = str(self.uid)
for option in self.options:
state = 'down' if option == self.value else 'normal'
btn = ToggleButton(text=option, state=state, group=uid, size=(popup.width, dp(55)), size_hint=(None, None))
btn.bind(on_release=self._set_option)
scrollcontent.add_widget(btn)
# finally, add a cancel button to return on the previous panel
scrollview.add_widget(scrollcontent)
content.add_widget(scrollview)
content.add_widget(SettingSpacer())
#btn = Button(text='Cancel', size=((oORCA.iAppWidth/2)-sp(25), dp(50)),size_hint=(None, None))
btn = Button(text='Cancel', size=(popup.width, dp(50)),size_hint=(0.9, None))
btn.bind(on_release=popup.dismiss)
content.add_widget(btn)
- Register new class to settings widget
#!python
from kivy.uix.settings import Settings
Setting = Settings()
settings.register_type('scrolloptions', SettingScrollOptions)
- Replace "type": "options", against "type": "scrolloptions",
Done!
##Comments ######## Add your comments here
Here are part of the required imports: from kivy.uix.settings import SettingOptions from kivy.uix.gridlayout import GridLayout from kivy.uix.scrollview import ScrollView from kivy.uix.widget import Widget from kivy.uix.togglebutton import ToggleButton from kivy.uix.settings import SettingSpacer from kivy.uix.button import Button from kivy.metrics import dp from kivy.uix.popup import Popup