Skip to content

Commit

Permalink
2.0.0 - Material Design 3
Browse files Browse the repository at this point in the history
- Added supporting Material Design 3
- Added new color schemes and effects
  • Loading branch information
HeaTTheatR committed Jan 4, 2024
1 parent 84cc323 commit d895464
Show file tree
Hide file tree
Showing 3 changed files with 711 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kivymd/uix/progressindicator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .progressindicator import (
MDCircularProgressIndicator,
MDLinearProgressIndicator,
) # NOQA F401
64 changes: 64 additions & 0 deletions kivymd/uix/progressindicator/progressindicator.kv
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<MDCircularProgressIndicator>
canvas.before:
PushMatrix
Rotate:
angle: self._rotation_angle
origin: self.center
canvas:
Color:
rgba: self.color if self.color else self.theme_cls.primaryColor
a: self._alpha
SmoothLine:
cap: 'square'
width: root.line_width
circle:
self.center_x, self.center_y, self.width / 2, \
self._angle_start, self._angle_end
canvas.after:
PopMatrix


<MDLinearProgressIndicator>
canvas:
Clear
# Inactive track.
Color:
rgba:
self.theme_cls.surfaceContainerHighestColor \
if not self.track_color else \
self.track_color
SmoothRoundedRectangle:
radius: root.radius
size:
(self.width, self.height) \
if self.orientation == "horizontal" else \
(self.width, self.height)
pos:
(self.x, self.center_y - self.height / 2) \
if self.orientation == "horizontal" else \
(self.center_x - self.width / 2, self.y)
# Active track.
Color:
rgba:
self.theme_cls.primaryColor \
if not self.indicator_color else \
self.indicator_color
SmoothRoundedRectangle:
radius: root.radius
size:
( \
self.width * self.value_normalized, \
self.height if self.height else dp(4) \
) \
if self.orientation == "horizontal" else \
(self.width, self.height * self.value_normalized)
pos:
( \
self.width * (1 - self.value_normalized) + self.x \
if self.reversed else self.x + self._x, \
self.center_y - self.height / 2 \
) \
if self.orientation == "horizontal" \
else (self.center_x - self.width / 2, self.height \
* (1 - self.value_normalized) + self.y if self.reversed \
else self.y)
Loading

0 comments on commit d895464

Please sign in to comment.