mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-11-10 06:54:45 +00:00
feat: gui with placeholders
This commit is contained in:
parent
e3bda8e656
commit
b1e0e377c9
179
design.kv
179
design.kv
@ -1,46 +1,135 @@
|
|||||||
<HomeScreen>:
|
BoxLayout:
|
||||||
GridLayout:
|
orientation: "vertical"
|
||||||
cols: 1
|
|
||||||
GridLayout:
|
NavigationLayout:
|
||||||
cols: 1
|
ScreenManager:
|
||||||
padding: 15, 15
|
id: screen_manager
|
||||||
spacing: 20, 20
|
HomeScreen:
|
||||||
Label:
|
name: "Home"
|
||||||
text: "User Login"
|
BoxLayout:
|
||||||
font_size: "20sp"
|
orientation: "vertical"
|
||||||
TextInput:
|
MDToolbar:
|
||||||
id: username
|
title: screen_manager.current
|
||||||
hint_text: "Username"
|
elevation: 10
|
||||||
TextInput:
|
left_action_items: [['menu', lambda x: nav_drawer.toggle_nav_drawer()]]
|
||||||
id: password
|
|
||||||
password: True
|
|
||||||
hint_text: "Password"
|
|
||||||
RelativeLayout:
|
|
||||||
Button:
|
|
||||||
text: "Login"
|
|
||||||
on_press: root.login(root.ids.username.text, root.ids.password.text)
|
|
||||||
size_hint: 0.3, 0.5
|
|
||||||
pos_hint: {"center_x": 0.5, "center_y": 0.6}
|
|
||||||
Label:
|
|
||||||
id: login_wrong
|
|
||||||
text: ""
|
|
||||||
GridLayout:
|
|
||||||
cols: 2
|
|
||||||
size_hint: 0.2, 0.2
|
|
||||||
padding: 10, 10
|
|
||||||
spacing: 10, 0
|
|
||||||
Button:
|
|
||||||
text: "Forgot Password?"
|
|
||||||
background_color: 1, 1, 1, 0
|
|
||||||
opacity: 1 if self.state == "normal" else 0.5
|
|
||||||
color: 0.1, 0.7, 1, 1
|
|
||||||
Button:
|
|
||||||
text: "Sign Up"
|
|
||||||
on_press: root.sign_up()
|
|
||||||
background_color: 1, 1, 1 , 0
|
|
||||||
opacity: 1 if self.state == "normal" else 0.5
|
|
||||||
color: 0.1, 0.7, 1, 1
|
|
||||||
|
|
||||||
<RootWidget>:
|
GridLayout:
|
||||||
HomeScreen:
|
cols: 1
|
||||||
name: "home_screen"
|
padding: 15, 15
|
||||||
|
spacing: 20, 20
|
||||||
|
MDTextFieldRect:
|
||||||
|
hint_text: "Console Log"
|
||||||
|
# size_hint: .8, None
|
||||||
|
# align: 'center'
|
||||||
|
# Widget:
|
||||||
|
SettingsScreen:
|
||||||
|
name: "Settings"
|
||||||
|
BoxLayout:
|
||||||
|
orientation: 'vertical'
|
||||||
|
MDToolbar:
|
||||||
|
title: screen_manager.current
|
||||||
|
elevation: 10
|
||||||
|
left_action_items: [['menu', lambda x: nav_drawer.toggle_nav_drawer()]]
|
||||||
|
Widget:
|
||||||
|
InfoScreen:
|
||||||
|
name: "Info"
|
||||||
|
BoxLayout:
|
||||||
|
orientation: 'vertical'
|
||||||
|
MDToolbar:
|
||||||
|
title: screen_manager.current
|
||||||
|
elevation: 10
|
||||||
|
left_action_items: [['menu', lambda x: nav_drawer.toggle_nav_drawer()]]
|
||||||
|
# GridLayout:
|
||||||
|
# cols: 2
|
||||||
|
# padding: 15, 15
|
||||||
|
# spacing: 20, 20
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "horizontal"
|
||||||
|
MDLabel:
|
||||||
|
text: "DB Key:"
|
||||||
|
halign: 'center'
|
||||||
|
MDTextField:
|
||||||
|
hint_text: "placeholder"
|
||||||
|
pos_hint: {"center_y": .5}
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "horizontal"
|
||||||
|
MDLabel:
|
||||||
|
text: "TBA Key:"
|
||||||
|
halign: 'center'
|
||||||
|
MDTextField:
|
||||||
|
hint_text: "placeholder"
|
||||||
|
pos_hint: {"center_y": .5}
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "horizontal"
|
||||||
|
MDLabel:
|
||||||
|
text: "CPU Use:"
|
||||||
|
halign: 'center'
|
||||||
|
MDLabel:
|
||||||
|
text: "placeholder"
|
||||||
|
halign: 'center'
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "horizontal"
|
||||||
|
MDLabel:
|
||||||
|
text: "Network:"
|
||||||
|
halign: 'center'
|
||||||
|
MDLabel:
|
||||||
|
text: "placeholder"
|
||||||
|
halign: 'center'
|
||||||
|
Widget:
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "horizontal"
|
||||||
|
MDLabel:
|
||||||
|
text: "Progress"
|
||||||
|
halign: 'center'
|
||||||
|
MDProgressBar:
|
||||||
|
id: progress
|
||||||
|
value: 50
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MDNavigationDrawer:
|
||||||
|
id: nav_drawer
|
||||||
|
BoxLayout:
|
||||||
|
orientation: "vertical"
|
||||||
|
padding: "8dp"
|
||||||
|
spacing: "8dp"
|
||||||
|
MDLabel:
|
||||||
|
text: "Titan Scouting"
|
||||||
|
font_style: "Button"
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
|
||||||
|
MDLabel:
|
||||||
|
text: "Data Analysis"
|
||||||
|
font_style: "Caption"
|
||||||
|
size_hint_y: None
|
||||||
|
height: self.texture_size[1]
|
||||||
|
ScrollView:
|
||||||
|
MDList:
|
||||||
|
OneLineAvatarListItem:
|
||||||
|
text: "Home"
|
||||||
|
on_press:
|
||||||
|
# nav_drawer.set_state("close")
|
||||||
|
# screen_manager.transition.direction = "left"
|
||||||
|
screen_manager.current = "Home"
|
||||||
|
IconLeftWidget:
|
||||||
|
icon: "home"
|
||||||
|
|
||||||
|
OneLineAvatarListItem:
|
||||||
|
text: "Settings"
|
||||||
|
on_press:
|
||||||
|
# nav_drawer.set_state("close")
|
||||||
|
# screen_manager.transition.direction = "right"
|
||||||
|
# screen_manager.fade
|
||||||
|
screen_manager.current = "Settings"
|
||||||
|
IconLeftWidget:
|
||||||
|
icon: "cog"
|
||||||
|
OneLineAvatarListItem:
|
||||||
|
text: "Info"
|
||||||
|
on_press:
|
||||||
|
# nav_drawer.set_state("close")
|
||||||
|
# screen_manager.transition.direction = "right"
|
||||||
|
# screen_manager.fade
|
||||||
|
screen_manager.current = "Info"
|
||||||
|
IconLeftWidget:
|
||||||
|
icon: "cog"
|
47
main.py
47
main.py
@ -1,41 +1,22 @@
|
|||||||
from kivy.app import App
|
|
||||||
from kivy.lang import Builder
|
from kivy.lang import Builder
|
||||||
from kivy.uix.screenmanager import ScreenManager , Screen
|
from kivy.uix.boxlayout import BoxLayout
|
||||||
from kivy.animation import Animation
|
from kivy.uix.screenmanager import ScreenManager, Screen
|
||||||
from hoverable import HoverBehavior
|
from kivymd.app import MDApp
|
||||||
from kivy.uix.image import Image
|
# import superscript as ss
|
||||||
from kivy.uix.behaviors import ButtonBehavior
|
|
||||||
import json
|
|
||||||
from datetime import datetime
|
|
||||||
import glob
|
|
||||||
from pathlib import Path
|
|
||||||
import random
|
|
||||||
|
|
||||||
import superscript as ss
|
|
||||||
|
|
||||||
Builder.load_file('design.kv')
|
|
||||||
|
|
||||||
class HomeScreen(Screen):
|
class HomeScreen(Screen):
|
||||||
# def sign_up(self):
|
pass
|
||||||
# self.manager.transition.direction = "left"
|
class SettingsScreen(Screen):
|
||||||
# self.manager.current = "sign_up_screen"
|
pass
|
||||||
|
class InfoScreen(Screen):
|
||||||
# def login(self, uname, pword):
|
|
||||||
# with open ("users.json") as file:
|
|
||||||
# users = json.load(file)
|
|
||||||
# if uname in users and users[uname]["password"] == pword:
|
|
||||||
# self.manager.transition.direction = "left"
|
|
||||||
# self.manager.current = "login_screen_success"
|
|
||||||
# else:
|
|
||||||
# self.ids.login_wrong.text = "Incorrect Username or Password"
|
|
||||||
|
|
||||||
|
|
||||||
class RootWidget(ScreenManager):
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class MainApp(App):
|
class MyApp(MDApp):
|
||||||
def build(self):
|
def build(self):
|
||||||
return RootWidget()
|
self.theme_cls.primary_palette = "Red"
|
||||||
|
return Builder.load_file("design.kv")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
MainApp().run()
|
MyApp().run()
|
Loading…
Reference in New Issue
Block a user