mirror of https://github.com/kivy/kivy.git
showcase: fixed dpi
This commit is contained in:
parent
7c4d4b8cba
commit
9d7779d0d2
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue