2503{
2504 wxSize size = GetSize();
2505
2506 float center_mask_radius = FromDIP(52);
2507 float selected_radius = FromDIP(53);
2508
2510 float startAngle = 0.0;
2511 float endAngle = 0.0;
2512
2514
2516 std::string tray_name = iter->first;
2517 wxColour tray_color = iter->second;
2518
2519 dc.SetPen(*wxTRANSPARENT_PEN);
2520
2521 if (tray_color == *wxWHITE) dc.SetPen(wxPen(wxColour("#EEEEEE"), 2));
2522 dc.SetBrush(wxBrush(tray_color));
2523
2524 int x = size.x / 2;
2525 int y = size.y / 2;
2526 int radius;
2527 if (wxGetApp().dark_mode())
2528 radius = size.x / 2 - int(size.x * 0.02);
2529 else
2530 radius = size.x / 2;
2531 endAngle += ev_angle;
2532
2533
2534
2535 if (tray_color.Alpha() != 0) {
2536 dc.DrawEllipticArc(x - radius, y - radius, radius * 2, radius * 2, startAngle, endAngle);
2537 if (tray_color == *wxWHITE) dc.DrawEllipticArc(x - center_mask_radius, y - center_mask_radius, center_mask_radius * 2, center_mask_radius * 2, startAngle, endAngle);
2538 }
2539
2540
2542 dc.SetPen(wxPen(0xCECECE, 2));
2543 dc.SetBrush(*wxTRANSPARENT_BRUSH);
2544 dc.DrawEllipticArc(x - radius, y - radius, radius * 2, radius * 2, startAngle, endAngle);
2545 dc.DrawEllipticArc(x - selected_radius, y - selected_radius,selected_radius * 2, selected_radius * 2, startAngle, endAngle);
2546 }
2547
2548
2549 startAngle += ev_angle;
2550 }
2551
2552
2553 startAngle = 0.0;
2554 endAngle = 0.0;
2556 std::string tray_name = iter->first;
2557 wxColour tray_color = iter->second;
2558
2559 int x = size.x / 2;
2560 int y = size.y / 2;
2561 float radius = size.x / 2 - 15.0;
2562 endAngle += ev_angle;
2563
2564 float midAngle = (startAngle + endAngle) / 2;
2565 float x_center = size.x / 2 + radius * cos(midAngle *
M_PI / 180.0);
2566 float y_center = size.y / 2 + radius * sin(midAngle *
M_PI / 180.0);
2567
2568
2570 auto text_size = dc.GetTextExtent(tray_name);
2571 dc.SetTextForeground(tray_color.GetLuminance() < 0.6 ? *wxWHITE : wxColour("#262E30"));
2572 if (tray_color.Alpha() == 0) { dc.SetTextForeground(wxColour("#262E30")); }
2573
2574 dc.DrawText(tray_name, x_center - text_size.x / 2, size.y - y_center - text_size.y / 2);
2575
2576
2577 dc.SetPen(wxPen(*wxWHITE, 2));
2578 if (tray_color.Alpha() == 0) { dc.SetPen(wxPen(wxColour("#CECECE"), 2)); }
2579 dc.SetBrush(*wxTRANSPARENT_BRUSH);
2580 auto pos_sp_start =
CalculateEndpoint(wxPoint(x, y), (360 - startAngle), size.x / 2 - FromDIP(3));
2581 dc.DrawLine(wxPoint(x, y), pos_sp_start);
2582
2583
2584
2585
2586 startAngle += ev_angle;
2587 }
2588
2589
2590 dc.SetPen(*wxTRANSPARENT_PEN);
2591 dc.SetBrush(wxBrush(*wxWHITE));
2592
2593 int x = size.x / 2;
2594 int y = size.y / 2;
2595 dc.DrawEllipticArc(x - center_mask_radius, y - center_mask_radius, center_mask_radius * 2, center_mask_radius * 2, 0, 360);
2596
2597
2599
2600
2601
2602 dc.SetTextForeground(wxColour("#323A3D"));
2605 dc.DrawText(
m_material_name, (size.x - text_size.x) / 2,(size.y - text_size.y) / 2 - FromDIP(12));
2606
2609 dc.DrawText(
m_group_index, (size.x - text_size.x) / 2, (size.y - text_size.y) / 2 + FromDIP(10));
2610}
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_15
Definition Label.hpp:44
static wxFont Body_12
Definition Label.hpp:55
std::string m_selected_index
Definition AmsMappingPopup.hpp:533
wxPoint CalculateEndpoint(const wxPoint &startPoint, int angle, int length)
Definition AmsMappingPopup.cpp:2495