Icon.qml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import QtQuick 2.15
  2. import "." as Components
  3. // Material Icons Round glyph by name (font bundled in fonts/, loaded in
  4. // main.py). Codepoints from MaterialIconsRound-Regular.codepoints - add
  5. // entries here as needed; names match the Material set.
  6. Text {
  7. id: icon
  8. property string name: ""
  9. property real size: 22
  10. readonly property var _glyphs: ({
  11. "add": "\ue145",
  12. "adjust": "\ue39e",
  13. "arrow_back": "\ue2ea",
  14. "brightness": "\ue3ab",
  15. "check": "\ue5ca",
  16. "circle": "\uef4a",
  17. "close": "\ue5cd",
  18. "delete": "\ue872",
  19. "expand_more": "\ue5cf",
  20. "home": "\ue88a",
  21. "light_mode": "\ue518",
  22. "lightbulb": "\ue0f0",
  23. "music_note": "\ue405",
  24. "pause": "\ue034",
  25. "play_arrow": "\ue037",
  26. "play_circle": "\ue1c4",
  27. "playlist_play": "\ue05f",
  28. "power": "\ue8ac",
  29. "queue_music": "\ue03d",
  30. "radio_unchecked": "\ue836",
  31. "refresh": "\ue5d5",
  32. "restart": "\uf053",
  33. "search": "\ue8b6",
  34. "shuffle": "\ue043",
  35. "skip_next": "\ue044",
  36. "stop": "\ue047",
  37. "tune": "\ue429",
  38. "wifi": "\ue63e"
  39. })
  40. text: _glyphs[name] || ""
  41. font.family: Components.ThemeManager.fontIcon
  42. font.pixelSize: size
  43. color: Components.ThemeManager.textPrimary
  44. verticalAlignment: Text.AlignVCenter
  45. horizontalAlignment: Text.AlignHCenter
  46. }