diff --git a/.gitignore b/.gitignore index 932c1cd..3a7a8d3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ bin *.pyc docs/_build - +justcheckers.ini diff --git a/justcheckers/images/frosted_logo.png b/justcheckers/images/frosted_logo.png deleted file mode 100644 index ecaeb08..0000000 Binary files a/justcheckers/images/frosted_logo.png and /dev/null differ diff --git a/justcheckers/justcheckers.kv b/justcheckers/justcheckers.kv index b3bd567..110a819 100644 --- a/justcheckers/justcheckers.kv +++ b/justcheckers/justcheckers.kv @@ -11,43 +11,58 @@ ScreenManager: source: 'images/backdrop.jpg' BoxLayout: orientation: "vertical" + Label: + size_hint_y: 0.1 Image: - source: 'images/frosted_logo.png' - size_hint_y: 0.5 + source: 'images/logo.png' + size_hint_y: 0.25 + allow_stretch: True + canvas.before: + Color: + rgba: 1, 1, 1, 0.5 + Rectangle: + pos: self.pos + size: self.size + Label: + size_hint_y: 0.1 + BoxLayout: + orientation: "vertical" + 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 - Button: - text: "New Game" - size_hint_x: 0.9 - 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() + pos_hint: {'center_x': 0.9} : diff --git a/justcheckers/ui/window.py b/justcheckers/ui/window.py deleted file mode 100644 index 7d16bb1..0000000 --- a/justcheckers/ui/window.py +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright (c) 2014 Dorian Pula -# -# justCheckers is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, -# or (at your option) any later version. -# -# justCheckers is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with justCheckers. If not, see . -# -# Please share and enjoy! -# - - -from PySide import QtGui - -from justcheckers.ui.game_view import GameView -from justcheckers.ui.info_view import InfoView -from justcheckers.ui.menu_view import MainMenuView -from justcheckers.ui import util - -class DesktopGameWindow(QtGui.QMainWindow): - """Main window for the game.""" - # TODO Setup functional testing with PySide.QtTest - - def __init__(self): - super(DesktopGameWindow, self).__init__() - self.setWindowTitle('justCheckers') - self.setGeometry(300, 300, 800, 600) - - self.setWindowIcon(QtGui.QIcon(util.path_to_asset('icon.png'))) - self.setup_components() - self.add_backdrop() - self.center() - - def add_backdrop(self): - """Adds a backdrop image to the game.""" - tile = QtGui.QPixmap(util.path_to_asset('backdrop.jpg')) - palette = QtGui.QPalette() - palette.setBrush(QtGui.QPalette.Background, tile) - self.setPalette(palette) - - def setup_components(self): - """Setup the components that make up the widget.""" - self.view_stack = QtGui.QStackedWidget() - self.view_stack.addWidget(MainMenuView()) - self.view_stack.addWidget(InfoView()) - self.view_stack.addWidget(GameView()) - self.setCentralWidget(self.view_stack) - - def center(self): - """Centers the widget in the middle of the screen.""" - widget_rectangle = self.frameGeometry() - center_point = QtGui.QDesktopWidget().availableGeometry().center() - widget_rectangle.moveCenter(center_point) - self.move(widget_rectangle.topLeft()) - -