showcase: fixed dpi

This commit is contained in:
Mathieu Virbel 2012-11-01 04:06:27 +01:00
parent 7c4d4b8cba
commit 9d7779d0d2
2 changed files with 11 additions and 10 deletions

View File

@ -250,16 +250,16 @@ class ShowcaseApp(App):
return col
def show_popup(self):
btnclose = Button(text='Close this popup', size_hint_y=None, height=50)
btnclose = Button(text='Close this popup', size_hint_y=None, height='50dp')
content = BoxLayout(orientation='vertical')
content.add_widget(Label(text='Hello world'))
content.add_widget(btnclose)
popup = Popup(content=content, title='Modal popup example',
size_hint=(None, None), size=(300, 300),
size_hint=(None, None), size=('300dp', '300dp'),
auto_dismiss=False)
btnclose.bind(on_release=popup.dismiss)
button = Button(text='Open popup', size_hint=(None, None),
size=(150, 70))
size=('150dp', '70dp'))
button.bind(on_release=popup.open)
popup.open()
col = AnchorLayout()

View File

@ -14,17 +14,18 @@
orientation: 'vertical'
BoxLayout:
padding: 10
spacing: 10
padding: '10dp'
spacing: '10dp'
size_hint: 1, None
pos_hint: {'top': 1}
height: 44
height: '44dp'
Image:
size_hint: None, None
size: 24, 24
source: 'data/logo/kivy-icon-24.png'
size: '24dp', '24dp'
source: 'data/logo/kivy-icon-64.png'
mipmap: True
Label:
height: 24
height: '24dp'
text_size: self.width, None
color: (1, 1, 1, .8)
text: 'Kivy %s - Showcase' % kivy.__version__
@ -55,7 +56,7 @@
[Title@Label]
pos_hint: {'center_x': .5, 'y': .3}
text: ctx.text
font_size: 22
font_size: '29dp'
<AnchorLayoutShowcase>
Title: