From c6598891aeac2c90298bf82e9c053eba49794b11 Mon Sep 17 00:00:00 2001 From: Brady James Garvin <bgarvin@cse.unl.edu> Date: Fri, 18 Jan 2019 13:46:32 -0600 Subject: [PATCH] Updated code for new Python 3 support in Kivy and improved code style. --- quizzer.kv | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/quizzer.kv b/quizzer.kv index 2cb3f9d..cdbbf80 100644 --- a/quizzer.kv +++ b/quizzer.kv @@ -5,7 +5,7 @@ ScreenManager: orientation: 'vertical' Label: text: 'Choose a topic:' - font_size: '24sp' + font_size: sp(24) BoxLayout: orientation: 'horizontal' Widget: @@ -19,7 +19,7 @@ ScreenManager: Label: id: gui_label text: 'Graphical User Interfaces' - size_hint: (None, 1) + size_hint: (None, 1.0) size: self.texture_size Widget: BoxLayout: @@ -35,7 +35,7 @@ ScreenManager: Label: id: color_label text: 'RGBA Quadruples' - size_hint: (None, 1) + size_hint: (None, 1.0) size: self.texture_size Widget: BoxLayout: @@ -51,7 +51,7 @@ ScreenManager: Label: id: tree_label text: 'Containment Hierarchies' - size_hint: (None, 1) + size_hint: (None, 1.0) size: self.texture_size Widget: BoxLayout: @@ -65,7 +65,7 @@ ScreenManager: root.current = 'quiz' Widget: Widget: - size_hint: (1, 0.5) + size_hint: (1.0, 0.5) Screen: name: 'quiz' BoxLayout: @@ -79,12 +79,12 @@ ScreenManager: root.current = 'settings' Label: text: 'Do you know…' - font_size: '24sp' + font_size: sp(24) size_hint: (1, None) size: (self.texture_size[0] + 64, self.texture_size[1] + 64) Label: text: (app.questions[-1] if len(app.questions) > 0 else app.DEFAULT_QUESTION)[0] if not app.paused else ('Correct!' if app.correct else 'Incorrect!') - color: (0, 0, 0.75, 1) if not app.paused else ((0, 1, 0, 1) if app.correct else (0.5, 0, 0, 1)) + color: (0.0, 0.0, 0.75, 1.0) if not app.paused else ((0.0, 1.0, 0.0, 1.0) if app.correct else (0.5, 0.0, 0.0, 1.0)) GridLayout: rows: 2 Button: @@ -108,25 +108,25 @@ ScreenManager: <Screen>: canvas.before: Color: - rgba: (1, 1, 1, 1) + rgba: (1.0, 1.0, 1.0, 1.0) Rectangle: pos: self.pos size: self.size # All labels are blue. <Label>: - color: (0, 0, 0.75, 1) + color: (0.0, 0.0, 0.75, 1.0) # All checkboxes are blue. <CheckBox>: canvas: Color: - rgba: (0, 0, 0.75, 1) + rgba: (0.0, 0.0, 0.75, 1.0) Rectangle: - source: 'atlas://data/images/defaulttheme/checkbox{radio}{disabled}{on}'.format(radio=('_radio' if self.group else ''), disabled=('_disabled' if self.disabled else ''), on=('_on' if self.active else '_off')) + source: f'atlas://data/images/defaulttheme/checkbox{"_radio" if self.group else ""}{"_disabled" if self.disabled else ""}{"_on" if self.active else "_off"}' size: sp(32), sp(32) pos: int(self.center_x - sp(16)), int(self.center_y - sp(16)) # All buttons have white text. <Button>: - color: (1, 1, 1, 1) + color: (1.0, 1.0, 1.0, 1.0) -- GitLab