From 0505a10045578e31ad23e7aef7824e7c43f2f110 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Thu, 23 Feb 2017 09:15:38 -0500 Subject: [PATCH] Refactor main menu button group in kv file. --- justcheckers/justcheckers.kv | 66 +++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/justcheckers/justcheckers.kv b/justcheckers/justcheckers.kv index 110a819..75521a8 100644 --- a/justcheckers/justcheckers.kv +++ b/justcheckers/justcheckers.kv @@ -25,46 +25,48 @@ ScreenManager: size: self.size Label: size_hint_y: 0.1 - BoxLayout: - orientation: "vertical" + MainMenuButtonGroup: size_hint_x: 0.9 pos_hint: {'center_x': 0.5} - Button: - text: "New Game" - size_hint_y: 0.1 - on_press: - root.manager.transition.direction = 'left' - root.manager.current = 'game' - Button: - text: "Open Game" - disabled: True - size_hint_y: 0.1 - Button: - text: "Save Game" - disabled: True - size_hint_y: 0.1 - Button: - text: "About Game" - size_hint_y: 0.1 - on_press: - root.manager.transition.direction = 'left' - root.manager.current = 'info' - Button: - text: "Settings" - size_hint_y: 0.1 - on_press: - app.open_settings() - Button: - text: "Exit" - size_hint_y: 0.1 - on_press: - app.stop() Label: text: "Version {}".format(justcheckers.__version__) size_hint_y: 0.1 pos_hint: {'center_x': 0.9} +: + orientation: "vertical" + Button: + text: "New Game" + size_hint_y: 0.1 + on_press: + root.parent.parent.manager.transition.direction = 'left' + root.parent.parent.manager.current = 'game' + Button: + text: "Open Game" + disabled: True + size_hint_y: 0.1 + Button: + text: "Save Game" + disabled: True + size_hint_y: 0.1 + Button: + text: "About Game" + size_hint_y: 0.1 + on_press: + root.parent.parent.manager.transition.direction = 'left' + root.parent.parent.manager.current = 'info' + Button: + text: "Settings" + size_hint_y: 0.1 + on_press: + app.open_settings() + Button: + text: "Exit" + size_hint_y: 0.1 + on_press: + app.stop() + : name: 'game' Image: