Skip to content

Commit

Permalink
Change the organisation of the profile menu
Browse files Browse the repository at this point in the history
  • Loading branch information
LupaDevStudio committed Dec 29, 2023
1 parent 559c863 commit fbc440c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
Binary file modified resources/images/badges/beginner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion screens/custom_widgets/circle_icon_button.kv
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#:kivy 2.2.1
#:set OUTLINE_RECTANGLE 6

<-CircleIconButton>:

fit_mode: "cover" # the image will be cropped at the right spot

canvas.before:
Color:
rgba: (0,0,0,1)
RoundedRectangle:
pos: (self.pos[0]-OUTLINE_RECTANGLE//2, self.pos[1]-OUTLINE_RECTANGLE//2)
size: (self.size[0]+OUTLINE_RECTANGLE, self.size[1]+OUTLINE_RECTANGLE)
radius: [100]

canvas:
Color:
rgba: self.color
Expand All @@ -22,4 +31,4 @@
pos: self.pos
size: self.size
radius: [100]
StencilPop
StencilPop
22 changes: 11 additions & 11 deletions screens/profile.kv
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
# Badge for the status
CircleIconButton:
source: PATH_BADGES + root.user_status + ".png"
pos_hint: {"center_x":0.25, "center_y":0.75}
size_hint: (0.2, None)
pos_hint: {"center_x":0.2, "center_y":0.75}
size_hint: (0.25, None)
height: self.width
disable_button: True

Expand All @@ -38,8 +38,8 @@
text: root.user_status
font_name: PATH_TITLE_FONT
font_size: 20 * root.font_ratio
pos_hint: {"center_x":0.7, "center_y":0.8}
size_hint: (0.4, 0.1)
pos_hint: {"x":0.4, "center_y":0.825}
size_hint: (0.25, 0.1)
text_size: self.size
outline_width: TITLE_OUTLINE_WIDTH
outline_color: TITLE_OUTLINE_COLOR
Expand All @@ -49,26 +49,26 @@
text: root.user_level
font_name: PATH_TITLE_FONT
font_size: 20 * root.font_ratio
pos_hint: {"center_x":0.7, "center_y":0.75}
size_hint: (0.4, 0.1)
pos_hint: {"x":0.675, "center_y":0.825}
size_hint: (0.25, 0.1)
text_size: self.size
outline_width: TITLE_OUTLINE_WIDTH
outline_color: TITLE_OUTLINE_COLOR
color: TEXT_FONT_COLOR
halign: "left"
halign: "right"

# Experience counter
ExperienceCounter:
size_hint: (0.4, 0.07)
pos_hint: {"center_x":0.25, "center_y":0.6}
size_hint: (0.525, 0.07)
pos_hint: {"x":0.4, "center_y":0.72}
font_ratio: root.font_ratio
experience_left: 10
percentage_experience: 0.7
theme_colors: root.theme_colors

# Coins counter
CoinsCounter:
size_hint: (0.45, 0.07)
pos_hint: {"center_x":0.725, "center_y":0.6}
size_hint: (0.6, 0.07)
pos_hint: {"center_x":0.5, "center_y":0.61}
font_ratio: root.font_ratio
coins_count: root.coins_count
2 changes: 1 addition & 1 deletion screens/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ProfileScreen(ImprovedScreen):
Class to manage the screen that contains the profile information.
"""

user_status = StringProperty()
user_status = StringProperty(USER_DATA.user_profile["status"])
user_level = StringProperty()
coins_count = NumericProperty()
theme_colors = StringProperty()
Expand Down

0 comments on commit fbc440c

Please sign in to comment.