SondreNL

progressbars.kv

Apr 1st, 2022
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1. #:kivy 2.0.0
  2. #:import get_color_from_hex kivy.utils.get_color_from_hex
  3.  
  4.  
  5. <TimerCard>
  6.  
  7. background_color: 38/255, 38/255, 53/255, 1
  8. accent_color: 130/255, 135/255, 156/255, 1
  9. text_color: 243/255, 243/255, 249/255, 1
  10.  
  11. size_hint: .8, .2
  12. pos_hint: {"center_x": .5, "center_y": .3}
  13. #size: "100dp", "80dp"
  14. radius: [45]
  15.  
  16. canvas.before:
  17. Color:
  18. rgba: root.accent_color
  19.  
  20. RoundedRectangle:
  21. size: root.size
  22. pos: root.pos
  23. radius: [45]
  24.  
  25. Color:
  26. rgba: root.background_color
  27. RoundedRectangle:
  28. size: root.width - 9, root.height - 9
  29. pos: root.x + 5, root.y + 5
  30. radius: [45]
  31.  
  32. MDRelativeLayout:
  33. # pos_hint: {"center_x": .5, "center_y": .5}
  34.  
  35. MDProgressBar:
  36. opacity: root.progressbaropacity
  37. min: 0
  38. max: root.targettime - 1
  39. value: root.currenttime
  40. pos_hint: {"center_x": .5, "center_y": .6}
  41. size_hint: .9, .5
  42.  
  43. Label:
  44. text: str(int(root.targettime - root.currenttime)) + "s"
  45. opacity: root.progressbaropacity
  46. pos_hint: {"center_x": .5, "center_y": .9}
  47. font_size: 40
  48.  
  49. MDFillRoundFlatButton:
  50. text: "Start"
  51. on_press: root.start_update()
  52. opacity: root.startbuttonopacity
  53. pos_hint: {"center_x": .5, "center_y": .6}
  54. color: root.accent_color
  55.  
  56. MDFillRoundFlatButton:
  57. id: plusone
  58. text: "+1"
  59. pos_hint: {"center_x": .7, "center_y": .2}
  60. size: "60dp", "30dp"
  61. on_press: root.change_targettime(1)
  62.  
  63. MDFillRoundFlatButton:
  64. id: plusten
  65. text: "+10"
  66. pos_hint: {"center_x": .85, "center_y": .2}
  67. on_press: root.change_targettime(10)
  68.  
  69. MDFillRoundFlatButton:
  70. id: minusone
  71. text: "-1"
  72. pos_hint: {"center_x": .3, "center_y": .2}
  73. on_press: root.change_targettime(-1)
  74.  
  75. MDFillRoundFlatButton:
  76. id: minusten
  77. text: "-10"
  78. pos_hint: {"center_x": .15, "center_y": .2}
  79. on_press: root.change_targettime(-10)
  80. rounded_button: True
  81.  
  82. MDFillRoundFlatButton:
  83. text: str(int(root.targettime))
  84. pos_hint: {"center_x": .5, "center_y": .2}
  85.  
  86.  
  87. MDScreen:
  88.  
  89. background_color: 38/255, 38/255, 53/255, 1
  90. accent_color: 130/255, 135/255, 156/255, 1
  91. text_color: 243/255, 243/255, 249/255, 1
  92.  
  93. canvas.before:
  94. Color:
  95. rgba: root.background_color
  96. Rectangle:
  97. pos: self.pos
  98. size: self.size
  99.  
  100. ScrollView:
  101. do_scroll_x: False
  102. do_scroll_y: True
  103.  
  104. MDBoxLayout:
  105. id: box
  106. orientation: 'vertical'
  107. spacing: 15
  108. size_hint_y: None
  109. height: self.minimum_height
  110.  
  111. Label:
  112. font_size: 50
  113. text_color: root.text_color
  114. text:str(int(app.score))
  115. #text: if app.score < 10: str(round(float(app.score), 1)) + " points" else: str(app.score)
  116. pos_hint: {"center_x": .5, "top": .2}
  117. # line_color: 0, 0, 1, 1
  118.  
  119. MDFillRoundFlatIconButton:
  120. icon: "plus-circle-outline"
  121. text: "Buy Another Slot"
  122. size_hint: .8, .05
  123. pos_hint: {"center_y": .8, "center_x": .5}
  124. text_color: root.text_color
  125. md_bg_color: root.background_color
  126. line_color: 130/255, 135/255, 156/255, 1
  127. line_width: 2
  128. icon_color: root.text_color
  129. set_radius: 45
  130. on_press: app.make_card()
  131.  
Advertisement
Add Comment
Please, Sign In to add comment