@@ -182,26 +182,32 @@ def _create_coded_icon(icon_type, size=24, color="#ffffff"):
182182 margin = size // 5 # Larger margin for clearer shapes
183183
184184 if icon_type == "previous" :
185- # Clear left-pointing triangle (kept for backward compatibility)
186- points = [
187- QPoint (center + margin , margin ),
188- QPoint (center + margin , size - margin ),
189- QPoint (margin , center )
190- ]
191- painter .setBrush (brush )
192- painter .setPen (Qt .NoPen )
193- painter .drawPolygon (QPolygon (points ))
185+ # Chevron pointing left (matches SVG)
186+ painter .setBrush (Qt .NoBrush )
187+ painter .setPen (pen )
188+
189+ # Left-pointing chevron: two lines forming <
190+ x1 , y1 = center + margin // 2 , margin + 2
191+ x2 , y2 = margin + 2 , center
192+ x3 , y3 = center + margin // 2 , size - margin - 2
193+
194+ # Draw the two lines of the chevron
195+ painter .drawLine (x1 , y1 , x2 , y2 )
196+ painter .drawLine (x2 , y2 , x3 , y3 )
194197
195198 elif icon_type == "next" :
196- # Clear right-pointing triangle (kept for backward compatibility)
197- points = [
198- QPoint (center - margin , margin ),
199- QPoint (center - margin , size - margin ),
200- QPoint (size - margin , center )
201- ]
202- painter .setBrush (brush )
203- painter .setPen (Qt .NoPen )
204- painter .drawPolygon (QPolygon (points ))
199+ # Chevron pointing right (matches SVG)
200+ painter .setBrush (Qt .NoBrush )
201+ painter .setPen (pen )
202+
203+ # Right-pointing chevron: two lines forming >
204+ x1 , y1 = center - margin // 2 , margin + 2
205+ x2 , y2 = size - margin - 2 , center
206+ x3 , y3 = center - margin // 2 , size - margin - 2
207+
208+ # Draw the two lines of the chevron
209+ painter .drawLine (x1 , y1 , x2 , y2 )
210+ painter .drawLine (x2 , y2 , x3 , y3 )
205211
206212 elif icon_type == "pause" :
207213 # Two thick vertical bars with proper spacing
@@ -401,31 +407,29 @@ def _create_coded_icon(icon_type, size=24, color="#ffffff"):
401407 painter .drawLine (check_x + check_size // 2 , check_y + check_size // 2 , check_x + check_size * 2 , check_y - check_size )
402408
403409 elif icon_type == "shuffle" :
404- # Shuffle icon (crossed arrows)
410+ # Shuffle icon - diagonal crossing arrows (matches SVG design )
405411 painter .setBrush (Qt .NoBrush )
406412 painter .setPen (pen )
407413
408- # Arrow sizes
409- arrow_len = (size - 2 * margin ) // 3
414+ # Arrow head size
410415 head_size = size // 8
411416
412- # Top arrow (left to right)
413- top_y = margin + arrow_len
414- painter .drawLine (margin + arrow_len // 2 , top_y , size - margin - arrow_len // 2 , top_y )
415- # Arrow head
416- painter .drawLine (size - margin - arrow_len // 2 , top_y ,
417- size - margin - arrow_len // 2 - head_size , top_y - head_size // 2 )
418- painter .drawLine (size - margin - arrow_len // 2 , top_y ,
419- size - margin - arrow_len // 2 - head_size , top_y + head_size // 2 )
420-
421- # Bottom arrow (right to left)
422- bottom_y = size - margin - arrow_len
423- painter .drawLine (size - margin - arrow_len // 2 , bottom_y , margin + arrow_len // 2 , bottom_y )
424- # Arrow head
425- painter .drawLine (margin + arrow_len // 2 , bottom_y ,
426- margin + arrow_len // 2 + head_size , bottom_y - head_size // 2 )
427- painter .drawLine (margin + arrow_len // 2 , bottom_y ,
428- margin + arrow_len // 2 + head_size , bottom_y + head_size // 2 )
417+ # Main diagonal crossing line (bottom-left to top-right)
418+ painter .drawLine (margin + 2 , size - margin - 2 , size - margin - 2 , margin + 2 )
419+
420+ # Top-right arrow components
421+ # Top horizontal line with arrow
422+ painter .drawLine (size - margin - size // 3 , margin + 2 , size - margin - 2 , margin + 2 )
423+ painter .drawLine (size - margin - 2 , margin + 2 , size - margin - head_size , margin + 2 + head_size // 2 )
424+ # Right vertical line with arrow
425+ painter .drawLine (size - margin - 2 , margin + 2 , size - margin - 2 , margin + size // 3 )
426+ painter .drawLine (size - margin - 2 , margin + size // 3 , size - margin - 2 - head_size // 2 , margin + size // 3 - head_size )
427+
428+ # Bottom-left arrow components
429+ painter .drawLine (margin + 2 , size - margin - size // 3 , margin + 2 , size - margin - 2 )
430+ painter .drawLine (margin + 2 , size - margin - 2 , margin + 2 + head_size // 2 , size - margin - 2 - head_size )
431+ painter .drawLine (margin + 2 , size - margin - 2 , margin + size // 3 , size - margin - 2 )
432+ painter .drawLine (margin + size // 3 , size - margin - 2 , margin + size // 3 - head_size , size - margin - 2 - head_size // 2 )
429433
430434 painter .end ()
431435 return QIcon (pixmap )
0 commit comments