icons.tcl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # icons.tcl --
  2. #
  3. # A set of stock icons for use in Tk dialogs. The icons used here
  4. # were provided by the Vimix Icon Theme project, which provides a
  5. # unified set of high quality icons licensed under the
  6. # Creative Commons Attribution Share-Alike license
  7. # (https://creativecommons.org/licenses/by-sa/4.0/)
  8. #
  9. # See https://github.com/vinceliuice/vimix-icon-theme
  10. #
  11. # Copyright © 2009 Pat Thoyts <patthoyts@users.sourceforge.net>
  12. # Copyright © 2022 Harald Oehlmann <harald.oehlmann@elmicron.de>
  13. # Copyright © 2022 Csaba Nemethi <csaba.nemethi@t-online.de>
  14. namespace eval ::tk::icons {}
  15. variable ::tk::svgFmt [list svg -scale [expr {[::tk::ScalingPct] / 100.0}]]
  16. image create photo ::tk::icons::error -format $::tk::svgFmt -data {
  17. <?xml version="1.0" encoding="UTF-8"?>
  18. <svg width="32" height="32" version="1.1" xmlns="http://www.w3.org/2000/svg">
  19. <circle cx="16" cy="16" r="16" fill="#d32f2f"/>
  20. <g transform="rotate(45,16,16)" fill="#fff">
  21. <rect x="6" y="14" width="20" height="4"/>
  22. <rect x="14" y="6" width="4" height="20"/>
  23. </g>
  24. </svg>
  25. }
  26. image create photo ::tk::icons::warning -format $::tk::svgFmt -data {
  27. <?xml version="1.0" encoding="UTF-8"?>
  28. <svg width="32" height="32" version="1.1" xmlns="http://www.w3.org/2000/svg">
  29. <circle cx="16" cy="16" r="16" fill="#f67400"/>
  30. <circle cx="16" cy="24" r="2" fill="#fff"/>
  31. <path d="m14 20h4v-14h-4z" fill="#fff"/>
  32. </svg>
  33. }
  34. image create photo ::tk::icons::information -format $::tk::svgFmt -data {
  35. <?xml version="1.0" encoding="UTF-8"?>
  36. <svg width="32" height="32" version="1.1" xmlns="http://www.w3.org/2000/svg">
  37. <circle cx="16" cy="16" r="16" fill="#2091df"/>
  38. <circle cx="16" cy="8" r="2" fill="#fff"/>
  39. <path d="m14 12h4v14h-4z" fill="#fff"/>
  40. </svg>
  41. }
  42. image create photo ::tk::icons::question -format $::tk::svgFmt -data {
  43. <?xml version="1.0" encoding="UTF-8"?>
  44. <svg width="32" height="32" version="1.1" xmlns="http://www.w3.org/2000/svg">
  45. <circle cx="16" cy="16" r="16" fill="#5c6bc0"/>
  46. <path d="m17.6 27.2h-3.2v-3.2h3.2zm3.312-12.4-1.44 1.472c-1.152 1.168-1.872 2.128-1.872 4.528h-3.2v-0.8c0-1.76 0.72-3.36 1.872-4.528l1.984-2.016a3.128 3.128 0 0 0 0.944-2.256c0-1.76-1.44-3.2-3.2-3.2s-3.2 1.44-3.2 3.2h-3.2c0-3.536 2.864-6.4 6.4-6.4s6.4 2.864 6.4 6.4c0 1.408-0.576 2.688-1.488 3.6z" fill="#fff"/>
  47. </svg>
  48. }