mirror of
https://github.com/OMGeeky/Kivy-Shopping-List.git
synced 2026-02-23 15:38:26 +01:00
Add Main and Settings screen
Co-Authored-By: Jan <49588429+MapManagement@users.noreply.github.com> Co-Authored-By: fadam2104 <119661061+fadam2104@users.noreply.github.com> Co-Authored-By: tomw41 <118167823+tomw41@users.noreply.github.com>
This commit is contained in:
22
src/main.py
22
src/main.py
@@ -1,21 +1,27 @@
|
||||
import imp
|
||||
from kivy.app import App
|
||||
from kivy.uix.boxlayout import BoxLayout
|
||||
from kivy.uix.gridlayout import GridLayout
|
||||
from kivy.uix.tabbedpanel import TabbedPanel
|
||||
from kivy.uix.screenmanager import Screen
|
||||
|
||||
class MainGridLayout(GridLayout):
|
||||
from kivy.config import Config
|
||||
Config.set('graphics', 'resizable', '0')
|
||||
Config.set('graphics', 'height', '1000')
|
||||
Config.set('graphics', 'width', '620')
|
||||
|
||||
class MainScreen(Screen):
|
||||
pass
|
||||
|
||||
class EntryBoxLayout(BoxLayout):
|
||||
class SettingsScreen(Screen):
|
||||
pass
|
||||
|
||||
class PageTabPanel(TabbedPanel):
|
||||
class MainPage(BoxLayout):
|
||||
pass
|
||||
|
||||
class ShoppingListApp(App):
|
||||
def build(self):
|
||||
self.title = 'Shopping List App'
|
||||
return PageTabPanel()
|
||||
|
||||
return MainPage()
|
||||
|
||||
if __name__ == "__main__":
|
||||
ShoppingListApp().run()
|
||||
app = ShoppingListApp()
|
||||
app.run()
|
||||
|
||||
@@ -1,15 +1,45 @@
|
||||
<PageTabPanel>:
|
||||
size_hint: 1, .1
|
||||
tab_width: root.width / 2
|
||||
pos_hint: {'center_x': .5, 'center_y': .9}
|
||||
do_default_tab: False
|
||||
|
||||
# Eintraege-Tab
|
||||
TabbedPanelItem:
|
||||
text: 'Einträge'
|
||||
|
||||
# Einstellungen-Tab
|
||||
TabbedPanelItem:
|
||||
text: 'Einstellungen'
|
||||
# Sortier-Knopf einbauen
|
||||
BoxLayout:
|
||||
<MainScreen>:
|
||||
name: 'main'
|
||||
MainTitleBar:
|
||||
Label:
|
||||
text: 'hi'
|
||||
|
||||
<SettingsScreen>:
|
||||
name: 'settings'
|
||||
SettingsTitleBar:
|
||||
Label:
|
||||
text: 'hi settings'
|
||||
|
||||
|
||||
<MainTitleBar@ActionBar>:
|
||||
pos_hint: {'top':1}
|
||||
ActionView:
|
||||
ActionPrevious:
|
||||
title: 'Shopping Liste'
|
||||
app_icon: 'res/shopping_bag.png'
|
||||
with_previous: False
|
||||
ActionButton:
|
||||
text: 'Sort'
|
||||
icon: 'res/filter_list.png'
|
||||
ActionButton:
|
||||
text: 'Settings'
|
||||
icon: 'res/settings.png'
|
||||
on_release:
|
||||
app.root.ids.sm.current = 'settings'
|
||||
app.root.ids.sm.transition.direction = 'left'
|
||||
|
||||
<SettingsTitleBar@ActionBar>:
|
||||
pos_hint: {'top':1}
|
||||
ActionView:
|
||||
ActionPrevious:
|
||||
title: 'Einstellungen'
|
||||
app_icon: 'res/settings.png'
|
||||
on_release:
|
||||
app.root.ids.sm.current = 'main'
|
||||
app.root.ids.sm.transition.direction = 'right'
|
||||
|
||||
<MainPage>:
|
||||
ScreenManager:
|
||||
id: sm
|
||||
MainScreen:
|
||||
SettingsScreen
|
||||
|
||||
Reference in New Issue
Block a user