Skip to content

Commit

Permalink
Add credits to header
Browse files Browse the repository at this point in the history
  • Loading branch information
DouglasHalse committed Feb 17, 2025
1 parent 5164bc9 commit c6cb6e6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
42 changes: 31 additions & 11 deletions GuiApp/kv/headerBodyLayout.kv
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,42 @@
id: leftContent
orientation: "lr-tb"
rows: 1
size_hint: 1, 1
Label:
id: welcomeTextLabel
text: 'WelcomeText'
halign: 'left'
valign: 'middle'
size_hint: 0.7, 1
GridLayout:
cols: 1
padding: ['20dp', 0, 0, 0]
size_hint: (1, 1)
text_size: self.size
color: 'black'
bold: True
spacing: 8
Widget: # Vertical Spacer
size_hint: (1, 1)
Label:
id: welcomeTextLabel
text: 'WelcomeText'
halign: 'left'
valign: 'middle'
size_hint: (1, None)
height: 20
font_size: 20
text_size: self.size
color: 'black'
bold: True
Label:
id: patronCreditsLabel
text: 'Your credits: 912.40'
halign: 'left'
valign: 'middle'
size_hint: (1, None)
height: 20
font_size: 20
text_size: self.size
color: 'black'
bold: True
Widget: # Vertical Spacer
size_hint: (1, 1)
GridLayout:
id: rightContent
orientation: "rl-tb"
rows: 1
size_hint: 1, 1
size_hint: 0.3, 1
GridLayout:
rows: 1
size_hint: None, 1
Expand Down
3 changes: 3 additions & 0 deletions GuiApp/widgets/headerBodyLayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def __init__(
self.screenManager: CustomScreenManager = screenManager
self.currentPatron = self.screenManager.getCurrentPatron()
self.ids["welcomeTextLabel"].text = f"Welcome {self.currentPatron.firstName}"
self.ids[
"patronCreditsLabel"
].text = f"Your credits: {self.currentPatron.totalCredits:.2f}"
if enableSettingsButton:
self.ids["rightContent"].add_widget(
SettingsButton(screenManager=self.screenManager)
Expand Down

0 comments on commit c6cb6e6

Please # to comment.