IQ.Pilot Release Commit @ bec7652
This commit is contained in:
3
iqpilot/system/ui/iqwidgets/widgets/__init__.py
Normal file
3
iqpilot/system/ui/iqwidgets/widgets/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
30
iqpilot/system/ui/iqwidgets/widgets/helpers/glyphs.py
Normal file
30
iqpilot/system/ui/iqwidgets/widgets/helpers/glyphs.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""
|
||||
Copyright © IQ.Lvbs, apart of Project Teal Lvbs, All Rights Reserved, licensed under https://konn3kt.com/tos
|
||||
"""
|
||||
import math
|
||||
|
||||
import pyray as rl
|
||||
|
||||
# Unit pentagram vertices, spike up, alternating outer/inner radius, clockwise
|
||||
# from the top. Inner radius 0.5 keeps the classic star proportions.
|
||||
_STAR_RING: list[tuple[float, float]] = []
|
||||
for _k in range(10):
|
||||
_theta = math.radians(-90.0 + _k * 36.0)
|
||||
_r = 1.0 if _k % 2 == 0 else 0.5
|
||||
_STAR_RING.append((_r * math.cos(_theta), _r * math.sin(_theta)))
|
||||
|
||||
|
||||
def draw_star(center_x: float, center_y: float, radius: float, is_filled: bool, color: rl.Color) -> None:
|
||||
pts = [rl.Vector2(center_x + ux * radius, center_y + uy * radius) for ux, uy in _STAR_RING]
|
||||
|
||||
if is_filled:
|
||||
inner = [pts[k] for k in range(1, 10, 2)]
|
||||
# five spikes, each flanked by its two inner neighbours...
|
||||
for i in range(5):
|
||||
rl.draw_triangle(inner[i - 1], pts[2 * i], inner[i], color)
|
||||
# ...plus the inner pentagon, fanned from one vertex
|
||||
for i in range(1, 4):
|
||||
rl.draw_triangle(inner[0], inner[i], inner[i + 1], color)
|
||||
|
||||
for k in range(10):
|
||||
rl.draw_line_ex(pts[k], pts[(k + 1) % 10], 2, color)
|
||||
1354
iqpilot/system/ui/iqwidgets/widgets/list_view.py
Normal file
1354
iqpilot/system/ui/iqwidgets/widgets/list_view.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user