uix: fix switch and checkbox for dpi

This commit is contained in:
Mathieu Virbel 2013-03-31 12:30:47 +02:00
parent 7ce2cdf590
commit c52a39c309
1 changed files with 7 additions and 7 deletions

View File

@ -407,18 +407,18 @@
# Switch widget
<Switch>:
active_norm_pos: max(0., min(1., (int(self.active) + self.touch_distance / 41)))
active_norm_pos: max(0., min(1., (int(self.active) + self.touch_distance / sp(41))))
canvas:
Color:
rgb: 1, 1, 1
Rectangle:
source: 'atlas://data/images/defaulttheme/switch-background'
size: 83, 32
pos: int(self.center_x - 41), int(self.center_y - 16)
size: sp(83), sp(32)
pos: int(self.center_x - sp(41)), int(self.center_y - sp(16))
Rectangle:
source: 'atlas://data/images/defaulttheme/switch-button'
size: 43, 32
pos: int(self.center_x - 41 + self.active_norm_pos * 41), int(self.center_y - 16)
size: sp(43), sp(32)
pos: int(self.center_x - sp(41) + self.active_norm_pos * sp(41)), int(self.center_y - sp(16))
# ModalView widget
@ -786,8 +786,8 @@
rgb: 1, 1, 1
Rectangle:
source: 'atlas://data/images/defaulttheme/checkbox%s_%s' % (('_radio' if self.group else ''), ('on' if self.active else 'off'))
size: 32, 32
pos: int(self.center_x - 16), int(self.center_y - 16)
size: sp(32), sp(32)
pos: int(self.center_x - sp(16)), int(self.center_y - sp(16))
# =============================================================================
# Relative Layout