Move image and text assets into justcheckers folder. \n Delete old Android main menu setup. \n Recreate main menu in PySide.

This commit is contained in:
Dorian 2014-07-30 08:33:43 -04:00
parent 1a23686e48
commit c51123767c
18 changed files with 25 additions and 124 deletions

View File

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/screen_root"
android:background="@drawable/backdrop"
android:gravity="center_horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ImageView android:id="@+id/app_logo"
android:background="#DDFFFFFF"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:src="@drawable/logo"/>
<TableLayout android:id="@+id/menu_table"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp">
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button android:id="@+id/game_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_play_checkers" />
<Button android:id="@+id/website_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_visit_us" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button android:id="@+id/about_us_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_about_us" />
<Button android:id="@+id/license_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_license" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button android:id="@+id/settings_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_settings" />
<Button android:id="@+id/quit_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caption_quit" />
</TableRow>
</TableLayout>
</RelativeLayout>

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Application Settings">
<CheckBoxPreference
android:title="Start New Game on Startup"
android:defaultValue="false"
android:summary="Should the app automatically start a new game."
android:key="startGameAtStartup" />
<!-- CheckBoxPreference
android:title="Save Game on Exit"
android:defaultValue="true"
android:summary="Saves the game automatically when exiting the app."
android:key="saveGameAtExit" /-->
</PreferenceCategory>
<!-- PreferenceCategory
android:title="Game Settings">
<CheckBoxPreference
android:title="Ask What Variant to Play"
android:defaultValue="true"
android:summary="Asks what variant of checkers you want to play, for each new game."
android:key="askVariantToPlay" />
<ListPreference
android:title="Type of Checkers Game"
android:summary="Should the app automatically start a new game."
android:defaultValue="American/Standard"
android:entries="@array/checkers_variants"
android:entryValues="@array/checkers_variants"
android:key="checkersVariant" />
</PreferenceCategory -->
</PreferenceScreen>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="caption_about_us">About Us</string>
<string name="caption_license">License</string>
<string name="caption_play_checkers">Play Checkers</string>
<string name="caption_settings">Settings</string>
<string name="caption_visit_us">Visit Our Website</string>
<string name="caption_quit">Quit</string>
</resources>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="template_capture_amounts">x0</string>
<string name="template_current_player">Current Player</string>
<string name="template_opposing_player">Opposing Player</string>
</resources>

View File

@ -2,7 +2,7 @@ import os
import sys
from PySide.QtCore import QCoreApplication
from PySide.QtGui import QWidget, QApplication, QLabel, QPushButton, QDesktopWidget, QVBoxLayout
from PySide.QtGui import *
class MenuScreen(QWidget):
@ -13,17 +13,41 @@ class MenuScreen(QWidget):
super(MenuScreen, self).__init__()
self.setWindowTitle('justCheckers')
self.setGeometry(300, 300, 800, 600)
self.setWindowIcon(QIcon('images/icon.png'))
self.add_backdrop()
self.setup_components()
self.center()
def add_backdrop(self):
tile = QPixmap('images/backdrop.jpg')
palette = QPalette()
palette.setBrush(QPalette.Background, tile)
self.setPalette(palette)
def setup_components(self):
"""Setup the components that make up the widget."""
print(self.get_system_info())
self.new_game = QPushButton('&New Game', self)
self.open_game = QPushButton('&Open Game', self)
self.save_game = QPushButton('&Save Game', self)
# TODO Render buttons greyed out.
self.about_game = QPushButton('About Game', self)
# TODO Add links to site and display license inside about game widget.
self.settings = QPushButton('Settings', self)
self.exit_button = QPushButton('Exit', self)
self.exit_button.clicked.connect(self.exit_app)
widget_layout = QVBoxLayout(self)
widget_layout.addStretch()
widget_layout.addWidget(self.new_game)
widget_layout.addWidget(self.open_game)
widget_layout.addWidget(self.save_game)
widget_layout.addWidget(self.about_game)
widget_layout.addWidget(self.settings)
widget_layout.addWidget(self.exit_button)
widget_layout.addStretch()
self.setLayout(widget_layout)

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB