icons.go 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231
  1. package theme
  2. import (
  3. "fyne.io/fyne/v2"
  4. "fyne.io/fyne/v2/internal/svg"
  5. )
  6. const (
  7. // IconNameCancel is the name of theme lookup for cancel icon.
  8. //
  9. // Since: 2.0
  10. IconNameCancel fyne.ThemeIconName = "cancel"
  11. // IconNameConfirm is the name of theme lookup for confirm icon.
  12. //
  13. // Since: 2.0
  14. IconNameConfirm fyne.ThemeIconName = "confirm"
  15. // IconNameDelete is the name of theme lookup for delete icon.
  16. //
  17. // Since: 2.0
  18. IconNameDelete fyne.ThemeIconName = "delete"
  19. // IconNameSearch is the name of theme lookup for search icon.
  20. //
  21. // Since: 2.0
  22. IconNameSearch fyne.ThemeIconName = "search"
  23. // IconNameSearchReplace is the name of theme lookup for search and replace icon.
  24. //
  25. // Since: 2.0
  26. IconNameSearchReplace fyne.ThemeIconName = "searchReplace"
  27. // IconNameMenu is the name of theme lookup for menu icon.
  28. //
  29. // Since: 2.0
  30. IconNameMenu fyne.ThemeIconName = "menu"
  31. // IconNameMenuExpand is the name of theme lookup for menu expansion icon.
  32. //
  33. // Since: 2.0
  34. IconNameMenuExpand fyne.ThemeIconName = "menuExpand"
  35. // IconNameCheckButtonChecked is the name of theme lookup for checked check button icon.
  36. //
  37. // Since: 2.0
  38. IconNameCheckButtonChecked fyne.ThemeIconName = "checked"
  39. // IconNameCheckButton is the name of theme lookup for unchecked check button icon.
  40. //
  41. // Since: 2.0
  42. IconNameCheckButton fyne.ThemeIconName = "unchecked"
  43. // IconNameRadioButton is the name of theme lookup for radio button unchecked icon.
  44. //
  45. // Since: 2.0
  46. IconNameRadioButton fyne.ThemeIconName = "radioButton"
  47. // IconNameRadioButtonChecked is the name of theme lookup for radio button checked icon.
  48. //
  49. // Since: 2.0
  50. IconNameRadioButtonChecked fyne.ThemeIconName = "radioButtonChecked"
  51. // IconNameColorAchromatic is the name of theme lookup for greyscale color icon.
  52. //
  53. // Since: 2.0
  54. IconNameColorAchromatic fyne.ThemeIconName = "colorAchromatic"
  55. // IconNameColorChromatic is the name of theme lookup for full color icon.
  56. //
  57. // Since: 2.0
  58. IconNameColorChromatic fyne.ThemeIconName = "colorChromatic"
  59. // IconNameColorPalette is the name of theme lookup for color palette icon.
  60. //
  61. // Since: 2.0
  62. IconNameColorPalette fyne.ThemeIconName = "colorPalette"
  63. // IconNameContentAdd is the name of theme lookup for content add icon.
  64. //
  65. // Since: 2.0
  66. IconNameContentAdd fyne.ThemeIconName = "contentAdd"
  67. // IconNameContentRemove is the name of theme lookup for content remove icon.
  68. //
  69. // Since: 2.0
  70. IconNameContentRemove fyne.ThemeIconName = "contentRemove"
  71. // IconNameContentCut is the name of theme lookup for content cut icon.
  72. //
  73. // Since: 2.0
  74. IconNameContentCut fyne.ThemeIconName = "contentCut"
  75. // IconNameContentCopy is the name of theme lookup for content copy icon.
  76. //
  77. // Since: 2.0
  78. IconNameContentCopy fyne.ThemeIconName = "contentCopy"
  79. // IconNameContentPaste is the name of theme lookup for content paste icon.
  80. //
  81. // Since: 2.0
  82. IconNameContentPaste fyne.ThemeIconName = "contentPaste"
  83. // IconNameContentClear is the name of theme lookup for content clear icon.
  84. //
  85. // Since: 2.0
  86. IconNameContentClear fyne.ThemeIconName = "contentClear"
  87. // IconNameContentRedo is the name of theme lookup for content redo icon.
  88. //
  89. // Since: 2.0
  90. IconNameContentRedo fyne.ThemeIconName = "contentRedo"
  91. // IconNameContentUndo is the name of theme lookup for content undo icon.
  92. //
  93. // Since: 2.0
  94. IconNameContentUndo fyne.ThemeIconName = "contentUndo"
  95. // IconNameInfo is the name of theme lookup for info icon.
  96. //
  97. // Since: 2.0
  98. IconNameInfo fyne.ThemeIconName = "info"
  99. // IconNameQuestion is the name of theme lookup for question icon.
  100. //
  101. // Since: 2.0
  102. IconNameQuestion fyne.ThemeIconName = "question"
  103. // IconNameWarning is the name of theme lookup for warning icon.
  104. //
  105. // Since: 2.0
  106. IconNameWarning fyne.ThemeIconName = "warning"
  107. // IconNameError is the name of theme lookup for error icon.
  108. //
  109. // Since: 2.0
  110. IconNameError fyne.ThemeIconName = "error"
  111. // IconNameBrokenImage is the name of the theme lookup for broken-image icon.
  112. //
  113. // Since: 2.4
  114. IconNameBrokenImage fyne.ThemeIconName = "broken-image"
  115. // IconNameDocument is the name of theme lookup for document icon.
  116. //
  117. // Since: 2.0
  118. IconNameDocument fyne.ThemeIconName = "document"
  119. // IconNameDocumentCreate is the name of theme lookup for document create icon.
  120. //
  121. // Since: 2.0
  122. IconNameDocumentCreate fyne.ThemeIconName = "documentCreate"
  123. // IconNameDocumentPrint is the name of theme lookup for document print icon.
  124. //
  125. // Since: 2.0
  126. IconNameDocumentPrint fyne.ThemeIconName = "documentPrint"
  127. // IconNameDocumentSave is the name of theme lookup for document save icon.
  128. //
  129. // Since: 2.0
  130. IconNameDocumentSave fyne.ThemeIconName = "documentSave"
  131. // IconNameMoreHorizontal is the name of theme lookup for horizontal more.
  132. //
  133. // Since 2.0
  134. IconNameMoreHorizontal fyne.ThemeIconName = "moreHorizontal"
  135. // IconNameMoreVertical is the name of theme lookup for vertical more.
  136. //
  137. // Since 2.0
  138. IconNameMoreVertical fyne.ThemeIconName = "moreVertical"
  139. // IconNameMailAttachment is the name of theme lookup for mail attachment icon.
  140. //
  141. // Since: 2.0
  142. IconNameMailAttachment fyne.ThemeIconName = "mailAttachment"
  143. // IconNameMailCompose is the name of theme lookup for mail compose icon.
  144. //
  145. // Since: 2.0
  146. IconNameMailCompose fyne.ThemeIconName = "mailCompose"
  147. // IconNameMailForward is the name of theme lookup for mail forward icon.
  148. //
  149. // Since: 2.0
  150. IconNameMailForward fyne.ThemeIconName = "mailForward"
  151. // IconNameMailReply is the name of theme lookup for mail reply icon.
  152. //
  153. // Since: 2.0
  154. IconNameMailReply fyne.ThemeIconName = "mailReply"
  155. // IconNameMailReplyAll is the name of theme lookup for mail reply-all icon.
  156. //
  157. // Since: 2.0
  158. IconNameMailReplyAll fyne.ThemeIconName = "mailReplyAll"
  159. // IconNameMailSend is the name of theme lookup for mail send icon.
  160. //
  161. // Since: 2.0
  162. IconNameMailSend fyne.ThemeIconName = "mailSend"
  163. // IconNameMediaMusic is the name of theme lookup for media music icon.
  164. //
  165. // Since: 2.1
  166. IconNameMediaMusic fyne.ThemeIconName = "mediaMusic"
  167. // IconNameMediaPhoto is the name of theme lookup for media photo icon.
  168. //
  169. // Since: 2.1
  170. IconNameMediaPhoto fyne.ThemeIconName = "mediaPhoto"
  171. // IconNameMediaVideo is the name of theme lookup for media video icon.
  172. //
  173. // Since: 2.1
  174. IconNameMediaVideo fyne.ThemeIconName = "mediaVideo"
  175. // IconNameMediaFastForward is the name of theme lookup for media fast-forward icon.
  176. //
  177. // Since: 2.0
  178. IconNameMediaFastForward fyne.ThemeIconName = "mediaFastForward"
  179. // IconNameMediaFastRewind is the name of theme lookup for media fast-rewind icon.
  180. //
  181. // Since: 2.0
  182. IconNameMediaFastRewind fyne.ThemeIconName = "mediaFastRewind"
  183. // IconNameMediaPause is the name of theme lookup for media pause icon.
  184. //
  185. // Since: 2.0
  186. IconNameMediaPause fyne.ThemeIconName = "mediaPause"
  187. // IconNameMediaPlay is the name of theme lookup for media play icon.
  188. //
  189. // Since: 2.0
  190. IconNameMediaPlay fyne.ThemeIconName = "mediaPlay"
  191. // IconNameMediaRecord is the name of theme lookup for media record icon.
  192. //
  193. // Since: 2.0
  194. IconNameMediaRecord fyne.ThemeIconName = "mediaRecord"
  195. // IconNameMediaReplay is the name of theme lookup for media replay icon.
  196. //
  197. // Since: 2.0
  198. IconNameMediaReplay fyne.ThemeIconName = "mediaReplay"
  199. // IconNameMediaSkipNext is the name of theme lookup for media skip next icon.
  200. //
  201. // Since: 2.0
  202. IconNameMediaSkipNext fyne.ThemeIconName = "mediaSkipNext"
  203. // IconNameMediaSkipPrevious is the name of theme lookup for media skip previous icon.
  204. //
  205. // Since: 2.0
  206. IconNameMediaSkipPrevious fyne.ThemeIconName = "mediaSkipPrevious"
  207. // IconNameMediaStop is the name of theme lookup for media stop icon.
  208. //
  209. // Since: 2.0
  210. IconNameMediaStop fyne.ThemeIconName = "mediaStop"
  211. // IconNameMoveDown is the name of theme lookup for move down icon.
  212. //
  213. // Since: 2.0
  214. IconNameMoveDown fyne.ThemeIconName = "arrowDown"
  215. // IconNameMoveUp is the name of theme lookup for move up icon.
  216. //
  217. // Since: 2.0
  218. IconNameMoveUp fyne.ThemeIconName = "arrowUp"
  219. // IconNameNavigateBack is the name of theme lookup for navigate back icon.
  220. //
  221. // Since: 2.0
  222. IconNameNavigateBack fyne.ThemeIconName = "arrowBack"
  223. // IconNameNavigateNext is the name of theme lookup for navigate next icon.
  224. //
  225. // Since: 2.0
  226. IconNameNavigateNext fyne.ThemeIconName = "arrowForward"
  227. // IconNameArrowDropDown is the name of theme lookup for drop-down arrow icon.
  228. //
  229. // Since: 2.0
  230. IconNameArrowDropDown fyne.ThemeIconName = "arrowDropDown"
  231. // IconNameArrowDropUp is the name of theme lookup for drop-up arrow icon.
  232. //
  233. // Since: 2.0
  234. IconNameArrowDropUp fyne.ThemeIconName = "arrowDropUp"
  235. // IconNameFile is the name of theme lookup for file icon.
  236. //
  237. // Since: 2.0
  238. IconNameFile fyne.ThemeIconName = "file"
  239. // IconNameFileApplication is the name of theme lookup for file application icon.
  240. //
  241. // Since: 2.0
  242. IconNameFileApplication fyne.ThemeIconName = "fileApplication"
  243. // IconNameFileAudio is the name of theme lookup for file audio icon.
  244. //
  245. // Since: 2.0
  246. IconNameFileAudio fyne.ThemeIconName = "fileAudio"
  247. // IconNameFileImage is the name of theme lookup for file image icon.
  248. //
  249. // Since: 2.0
  250. IconNameFileImage fyne.ThemeIconName = "fileImage"
  251. // IconNameFileText is the name of theme lookup for file text icon.
  252. //
  253. // Since: 2.0
  254. IconNameFileText fyne.ThemeIconName = "fileText"
  255. // IconNameFileVideo is the name of theme lookup for file video icon.
  256. //
  257. // Since: 2.0
  258. IconNameFileVideo fyne.ThemeIconName = "fileVideo"
  259. // IconNameFolder is the name of theme lookup for folder icon.
  260. //
  261. // Since: 2.0
  262. IconNameFolder fyne.ThemeIconName = "folder"
  263. // IconNameFolderNew is the name of theme lookup for folder new icon.
  264. //
  265. // Since: 2.0
  266. IconNameFolderNew fyne.ThemeIconName = "folderNew"
  267. // IconNameFolderOpen is the name of theme lookup for folder open icon.
  268. //
  269. // Since: 2.0
  270. IconNameFolderOpen fyne.ThemeIconName = "folderOpen"
  271. // IconNameHelp is the name of theme lookup for help icon.
  272. //
  273. // Since: 2.0
  274. IconNameHelp fyne.ThemeIconName = "help"
  275. // IconNameHistory is the name of theme lookup for history icon.
  276. //
  277. // Since: 2.0
  278. IconNameHistory fyne.ThemeIconName = "history"
  279. // IconNameHome is the name of theme lookup for home icon.
  280. //
  281. // Since: 2.0
  282. IconNameHome fyne.ThemeIconName = "home"
  283. // IconNameSettings is the name of theme lookup for settings icon.
  284. //
  285. // Since: 2.0
  286. IconNameSettings fyne.ThemeIconName = "settings"
  287. // IconNameStorage is the name of theme lookup for storage icon.
  288. //
  289. // Since: 2.0
  290. IconNameStorage fyne.ThemeIconName = "storage"
  291. // IconNameUpload is the name of theme lookup for upload icon.
  292. //
  293. // Since: 2.0
  294. IconNameUpload fyne.ThemeIconName = "upload"
  295. // IconNameViewFullScreen is the name of theme lookup for view fullscreen icon.
  296. //
  297. // Since: 2.0
  298. IconNameViewFullScreen fyne.ThemeIconName = "viewFullScreen"
  299. // IconNameViewRefresh is the name of theme lookup for view refresh icon.
  300. //
  301. // Since: 2.0
  302. IconNameViewRefresh fyne.ThemeIconName = "viewRefresh"
  303. // IconNameViewZoomFit is the name of theme lookup for view zoom fit icon.
  304. //
  305. // Since: 2.0
  306. IconNameViewZoomFit fyne.ThemeIconName = "viewZoomFit"
  307. // IconNameViewZoomIn is the name of theme lookup for view zoom in icon.
  308. //
  309. // Since: 2.0
  310. IconNameViewZoomIn fyne.ThemeIconName = "viewZoomIn"
  311. // IconNameViewZoomOut is the name of theme lookup for view zoom out icon.
  312. //
  313. // Since: 2.0
  314. IconNameViewZoomOut fyne.ThemeIconName = "viewZoomOut"
  315. // IconNameViewRestore is the name of theme lookup for view restore icon.
  316. //
  317. // Since: 2.0
  318. IconNameViewRestore fyne.ThemeIconName = "viewRestore"
  319. // IconNameVisibility is the name of theme lookup for visibility icon.
  320. //
  321. // Since: 2.0
  322. IconNameVisibility fyne.ThemeIconName = "visibility"
  323. // IconNameVisibilityOff is the name of theme lookup for invisibility icon.
  324. //
  325. // Since: 2.0
  326. IconNameVisibilityOff fyne.ThemeIconName = "visibilityOff"
  327. // IconNameVolumeDown is the name of theme lookup for volume down icon.
  328. //
  329. // Since: 2.0
  330. IconNameVolumeDown fyne.ThemeIconName = "volumeDown"
  331. // IconNameVolumeMute is the name of theme lookup for volume mute icon.
  332. //
  333. // Since: 2.0
  334. IconNameVolumeMute fyne.ThemeIconName = "volumeMute"
  335. // IconNameVolumeUp is the name of theme lookup for volume up icon.
  336. //
  337. // Since: 2.0
  338. IconNameVolumeUp fyne.ThemeIconName = "volumeUp"
  339. // IconNameDownload is the name of theme lookup for download icon.
  340. //
  341. // Since: 2.0
  342. IconNameDownload fyne.ThemeIconName = "download"
  343. // IconNameComputer is the name of theme lookup for computer icon.
  344. //
  345. // Since: 2.0
  346. IconNameComputer fyne.ThemeIconName = "computer"
  347. // IconNameAccount is the name of theme lookup for account icon.
  348. //
  349. // Since: 2.1
  350. IconNameAccount fyne.ThemeIconName = "account"
  351. // IconNameLogin is the name of theme lookup for login icon.
  352. //
  353. // Since: 2.1
  354. IconNameLogin fyne.ThemeIconName = "login"
  355. // IconNameLogout is the name of theme lookup for logout icon.
  356. //
  357. // Since: 2.1
  358. IconNameLogout fyne.ThemeIconName = "logout"
  359. // IconNameList is the name of theme lookup for list icon.
  360. //
  361. // Since: 2.1
  362. IconNameList fyne.ThemeIconName = "list"
  363. // IconNameGrid is the name of theme lookup for grid icon.
  364. //
  365. // Since: 2.1
  366. IconNameGrid fyne.ThemeIconName = "grid"
  367. )
  368. var (
  369. icons = map[fyne.ThemeIconName]fyne.Resource{
  370. IconNameCancel: NewThemedResource(cancelIconRes),
  371. IconNameConfirm: NewThemedResource(checkIconRes),
  372. IconNameDelete: NewThemedResource(deleteIconRes),
  373. IconNameSearch: NewThemedResource(searchIconRes),
  374. IconNameSearchReplace: NewThemedResource(searchreplaceIconRes),
  375. IconNameMenu: NewThemedResource(menuIconRes),
  376. IconNameMenuExpand: NewThemedResource(menuexpandIconRes),
  377. IconNameCheckButton: NewThemedResource(checkboxIconRes),
  378. IconNameCheckButtonChecked: NewThemedResource(checkboxcheckedIconRes),
  379. "iconNameCheckButtonFill": NewThemedResource(checkboxfillIconRes),
  380. IconNameRadioButton: NewThemedResource(radiobuttonIconRes),
  381. IconNameRadioButtonChecked: NewThemedResource(radiobuttoncheckedIconRes),
  382. "iconNameRadioButtonFill": NewThemedResource(radiobuttonfillIconRes),
  383. IconNameContentAdd: NewThemedResource(contentaddIconRes),
  384. IconNameContentClear: NewThemedResource(cancelIconRes),
  385. IconNameContentRemove: NewThemedResource(contentremoveIconRes),
  386. IconNameContentCut: NewThemedResource(contentcutIconRes),
  387. IconNameContentCopy: NewThemedResource(contentcopyIconRes),
  388. IconNameContentPaste: NewThemedResource(contentpasteIconRes),
  389. IconNameContentRedo: NewThemedResource(contentredoIconRes),
  390. IconNameContentUndo: NewThemedResource(contentundoIconRes),
  391. IconNameColorAchromatic: NewThemedResource(colorachromaticIconRes),
  392. IconNameColorChromatic: NewThemedResource(colorchromaticIconRes),
  393. IconNameColorPalette: NewThemedResource(colorpaletteIconRes),
  394. IconNameDocument: NewThemedResource(documentIconRes),
  395. IconNameDocumentCreate: NewThemedResource(documentcreateIconRes),
  396. IconNameDocumentPrint: NewThemedResource(documentprintIconRes),
  397. IconNameDocumentSave: NewThemedResource(documentsaveIconRes),
  398. IconNameMoreHorizontal: NewThemedResource(morehorizontalIconRes),
  399. IconNameMoreVertical: NewThemedResource(moreverticalIconRes),
  400. IconNameInfo: NewThemedResource(infoIconRes),
  401. IconNameQuestion: NewThemedResource(questionIconRes),
  402. IconNameWarning: NewThemedResource(warningIconRes),
  403. IconNameError: NewThemedResource(errorIconRes),
  404. IconNameBrokenImage: NewThemedResource(brokenimageIconRes),
  405. IconNameMailAttachment: NewThemedResource(mailattachmentIconRes),
  406. IconNameMailCompose: NewThemedResource(mailcomposeIconRes),
  407. IconNameMailForward: NewThemedResource(mailforwardIconRes),
  408. IconNameMailReply: NewThemedResource(mailreplyIconRes),
  409. IconNameMailReplyAll: NewThemedResource(mailreplyallIconRes),
  410. IconNameMailSend: NewThemedResource(mailsendIconRes),
  411. IconNameMediaMusic: NewThemedResource(mediamusicIconRes),
  412. IconNameMediaPhoto: NewThemedResource(mediaphotoIconRes),
  413. IconNameMediaVideo: NewThemedResource(mediavideoIconRes),
  414. IconNameMediaFastForward: NewThemedResource(mediafastforwardIconRes),
  415. IconNameMediaFastRewind: NewThemedResource(mediafastrewindIconRes),
  416. IconNameMediaPause: NewThemedResource(mediapauseIconRes),
  417. IconNameMediaPlay: NewThemedResource(mediaplayIconRes),
  418. IconNameMediaRecord: NewThemedResource(mediarecordIconRes),
  419. IconNameMediaReplay: NewThemedResource(mediareplayIconRes),
  420. IconNameMediaSkipNext: NewThemedResource(mediaskipnextIconRes),
  421. IconNameMediaSkipPrevious: NewThemedResource(mediaskippreviousIconRes),
  422. IconNameMediaStop: NewThemedResource(mediastopIconRes),
  423. IconNameNavigateBack: NewThemedResource(arrowbackIconRes),
  424. IconNameMoveDown: NewThemedResource(arrowdownIconRes),
  425. IconNameNavigateNext: NewThemedResource(arrowforwardIconRes),
  426. IconNameMoveUp: NewThemedResource(arrowupIconRes),
  427. IconNameArrowDropDown: NewThemedResource(arrowdropdownIconRes),
  428. IconNameArrowDropUp: NewThemedResource(arrowdropupIconRes),
  429. IconNameFile: NewThemedResource(fileIconRes),
  430. IconNameFileApplication: NewThemedResource(fileapplicationIconRes),
  431. IconNameFileAudio: NewThemedResource(fileaudioIconRes),
  432. IconNameFileImage: NewThemedResource(fileimageIconRes),
  433. IconNameFileText: NewThemedResource(filetextIconRes),
  434. IconNameFileVideo: NewThemedResource(filevideoIconRes),
  435. IconNameFolder: NewThemedResource(folderIconRes),
  436. IconNameFolderNew: NewThemedResource(foldernewIconRes),
  437. IconNameFolderOpen: NewThemedResource(folderopenIconRes),
  438. IconNameHelp: NewThemedResource(helpIconRes),
  439. IconNameHistory: NewThemedResource(historyIconRes),
  440. IconNameHome: NewThemedResource(homeIconRes),
  441. IconNameSettings: NewThemedResource(settingsIconRes),
  442. IconNameViewFullScreen: NewThemedResource(viewfullscreenIconRes),
  443. IconNameViewRefresh: NewThemedResource(viewrefreshIconRes),
  444. IconNameViewRestore: NewThemedResource(viewzoomfitIconRes),
  445. IconNameViewZoomFit: NewThemedResource(viewzoomfitIconRes),
  446. IconNameViewZoomIn: NewThemedResource(viewzoominIconRes),
  447. IconNameViewZoomOut: NewThemedResource(viewzoomoutIconRes),
  448. IconNameVisibility: NewThemedResource(visibilityIconRes),
  449. IconNameVisibilityOff: NewThemedResource(visibilityoffIconRes),
  450. IconNameVolumeDown: NewThemedResource(volumedownIconRes),
  451. IconNameVolumeMute: NewThemedResource(volumemuteIconRes),
  452. IconNameVolumeUp: NewThemedResource(volumeupIconRes),
  453. IconNameDownload: NewThemedResource(downloadIconRes),
  454. IconNameComputer: NewThemedResource(computerIconRes),
  455. IconNameStorage: NewThemedResource(storageIconRes),
  456. IconNameUpload: NewThemedResource(uploadIconRes),
  457. IconNameAccount: NewThemedResource(accountIconRes),
  458. IconNameLogin: NewThemedResource(loginIconRes),
  459. IconNameLogout: NewThemedResource(logoutIconRes),
  460. IconNameList: NewThemedResource(listIconRes),
  461. IconNameGrid: NewThemedResource(gridIconRes),
  462. }
  463. )
  464. func (t *builtinTheme) Icon(n fyne.ThemeIconName) fyne.Resource {
  465. return icons[n]
  466. }
  467. // ThemedResource is a resource wrapper that will return a version of the resource with the main color changed
  468. // for the currently selected theme.
  469. type ThemedResource struct {
  470. source fyne.Resource
  471. // ColorName specifies which theme colour should be used to theme the resource
  472. //
  473. // Since: 2.3
  474. ColorName fyne.ThemeColorName
  475. }
  476. // NewColoredResource creates a resource that adapts to the current theme setting using
  477. // the color named in the constructor.
  478. //
  479. // Since: 2.4
  480. func NewColoredResource(src fyne.Resource, name fyne.ThemeColorName) *ThemedResource {
  481. return &ThemedResource{
  482. source: src,
  483. ColorName: name,
  484. }
  485. }
  486. // NewSuccessThemedResource creates a resource that adapts to the current theme success color.
  487. //
  488. // Since: 2.4
  489. func NewSuccessThemedResource(src fyne.Resource) *ThemedResource {
  490. return &ThemedResource{
  491. source: src,
  492. ColorName: ColorNameSuccess,
  493. }
  494. }
  495. // NewThemedResource creates a resource that adapts to the current theme setting.
  496. // By default this will match the foreground color, but it can be changed using the `ColorName` field.
  497. func NewThemedResource(src fyne.Resource) *ThemedResource {
  498. return &ThemedResource{
  499. source: src,
  500. }
  501. }
  502. // NewWarningThemedResource creates a resource that adapts to the current theme warning color.
  503. //
  504. // Since: 2.4
  505. func NewWarningThemedResource(src fyne.Resource) *ThemedResource {
  506. return &ThemedResource{
  507. source: src,
  508. ColorName: ColorNameWarning,
  509. }
  510. }
  511. // Name returns the underlying resource name (used for caching).
  512. func (res *ThemedResource) Name() string {
  513. prefix := res.ColorName
  514. if prefix == "" {
  515. prefix = "foreground_"
  516. } else {
  517. prefix += "_"
  518. }
  519. return string(prefix) + res.source.Name()
  520. }
  521. // Content returns the underlying content of the resource adapted to the current text color.
  522. func (res *ThemedResource) Content() []byte {
  523. name := res.ColorName
  524. if name == "" {
  525. name = ColorNameForeground
  526. }
  527. return svg.Colorize(res.source.Content(), safeColorLookup(name, currentVariant()))
  528. }
  529. // Error returns a different resource for indicating an error.
  530. func (res *ThemedResource) Error() *ErrorThemedResource {
  531. return NewErrorThemedResource(res)
  532. }
  533. // InvertedThemedResource is a resource wrapper that will return a version of the resource with the main color changed
  534. // for use over highlighted elements.
  535. type InvertedThemedResource struct {
  536. source fyne.Resource
  537. }
  538. // NewInvertedThemedResource creates a resource that adapts to the current theme for use over highlighted elements.
  539. func NewInvertedThemedResource(orig fyne.Resource) *InvertedThemedResource {
  540. res := &InvertedThemedResource{source: orig}
  541. return res
  542. }
  543. // Name returns the underlying resource name (used for caching).
  544. func (res *InvertedThemedResource) Name() string {
  545. return "inverted_" + res.source.Name()
  546. }
  547. // Content returns the underlying content of the resource adapted to the current background color.
  548. func (res *InvertedThemedResource) Content() []byte {
  549. clr := BackgroundColor()
  550. return svg.Colorize(res.source.Content(), clr)
  551. }
  552. // Original returns the underlying resource that this inverted themed resource was adapted from
  553. func (res *InvertedThemedResource) Original() fyne.Resource {
  554. return res.source
  555. }
  556. // ErrorThemedResource is a resource wrapper that will return a version of the resource with the main color changed
  557. // to indicate an error.
  558. type ErrorThemedResource struct {
  559. source fyne.Resource
  560. }
  561. // NewErrorThemedResource creates a resource that adapts to the error color for the current theme.
  562. func NewErrorThemedResource(orig fyne.Resource) *ErrorThemedResource {
  563. res := &ErrorThemedResource{source: orig}
  564. return res
  565. }
  566. // Name returns the underlying resource name (used for caching).
  567. func (res *ErrorThemedResource) Name() string {
  568. return "error_" + res.source.Name()
  569. }
  570. // Content returns the underlying content of the resource adapted to the current background color.
  571. func (res *ErrorThemedResource) Content() []byte {
  572. return svg.Colorize(res.source.Content(), ErrorColor())
  573. }
  574. // Original returns the underlying resource that this error themed resource was adapted from
  575. func (res *ErrorThemedResource) Original() fyne.Resource {
  576. return res.source
  577. }
  578. // PrimaryThemedResource is a resource wrapper that will return a version of the resource with the main color changed
  579. // to the theme primary color.
  580. type PrimaryThemedResource struct {
  581. source fyne.Resource
  582. }
  583. // NewPrimaryThemedResource creates a resource that adapts to the primary color for the current theme.
  584. func NewPrimaryThemedResource(orig fyne.Resource) *PrimaryThemedResource {
  585. res := &PrimaryThemedResource{source: orig}
  586. return res
  587. }
  588. // Name returns the underlying resource name (used for caching).
  589. func (res *PrimaryThemedResource) Name() string {
  590. return "primary_" + res.source.Name()
  591. }
  592. // Content returns the underlying content of the resource adapted to the current background color.
  593. func (res *PrimaryThemedResource) Content() []byte {
  594. return svg.Colorize(res.source.Content(), PrimaryColor())
  595. }
  596. // Original returns the underlying resource that this primary themed resource was adapted from
  597. func (res *PrimaryThemedResource) Original() fyne.Resource {
  598. return res.source
  599. }
  600. // DisabledResource is a resource wrapper that will return an appropriate resource colorized by
  601. // the current theme's `DisabledColor` color.
  602. type DisabledResource struct {
  603. source fyne.Resource
  604. }
  605. // Name returns the resource source name prefixed with `disabled_` (used for caching)
  606. func (res *DisabledResource) Name() string {
  607. return "disabled_" + res.source.Name()
  608. }
  609. // Content returns the disabled style content of the correct resource for the current theme
  610. func (res *DisabledResource) Content() []byte {
  611. return svg.Colorize(res.source.Content(), DisabledColor())
  612. }
  613. // NewDisabledResource creates a resource that adapts to the current theme's DisabledColor setting.
  614. func NewDisabledResource(res fyne.Resource) *DisabledResource {
  615. return &DisabledResource{
  616. source: res,
  617. }
  618. }
  619. // FyneLogo returns a resource containing the Fyne logo.
  620. //
  621. // Deprecated: Applications should use their own icon in most cases.
  622. func FyneLogo() fyne.Resource {
  623. return fynelogo
  624. }
  625. // CancelIcon returns a resource containing the standard cancel icon for the current theme
  626. func CancelIcon() fyne.Resource {
  627. return safeIconLookup(IconNameCancel)
  628. }
  629. // ConfirmIcon returns a resource containing the standard confirm icon for the current theme
  630. func ConfirmIcon() fyne.Resource {
  631. return safeIconLookup(IconNameConfirm)
  632. }
  633. // DeleteIcon returns a resource containing the standard delete icon for the current theme
  634. func DeleteIcon() fyne.Resource {
  635. return safeIconLookup(IconNameDelete)
  636. }
  637. // SearchIcon returns a resource containing the standard search icon for the current theme
  638. func SearchIcon() fyne.Resource {
  639. return safeIconLookup(IconNameSearch)
  640. }
  641. // SearchReplaceIcon returns a resource containing the standard search and replace icon for the current theme
  642. func SearchReplaceIcon() fyne.Resource {
  643. return safeIconLookup(IconNameSearchReplace)
  644. }
  645. // MenuIcon returns a resource containing the standard (mobile) menu icon for the current theme
  646. func MenuIcon() fyne.Resource {
  647. return safeIconLookup(IconNameMenu)
  648. }
  649. // MenuExpandIcon returns a resource containing the standard (mobile) expand "submenu icon for the current theme
  650. func MenuExpandIcon() fyne.Resource {
  651. return safeIconLookup(IconNameMenuExpand)
  652. }
  653. // CheckButtonIcon returns a resource containing the standard checkbox icon for the current theme
  654. func CheckButtonIcon() fyne.Resource {
  655. return safeIconLookup(IconNameCheckButton)
  656. }
  657. // CheckButtonCheckedIcon returns a resource containing the standard checkbox checked icon for the current theme
  658. func CheckButtonCheckedIcon() fyne.Resource {
  659. return safeIconLookup(IconNameCheckButtonChecked)
  660. }
  661. // RadioButtonIcon returns a resource containing the standard radio button icon for the current theme
  662. func RadioButtonIcon() fyne.Resource {
  663. return safeIconLookup(IconNameRadioButton)
  664. }
  665. // RadioButtonCheckedIcon returns a resource containing the standard radio button checked icon for the current theme
  666. func RadioButtonCheckedIcon() fyne.Resource {
  667. return safeIconLookup(IconNameRadioButtonChecked)
  668. }
  669. // ContentAddIcon returns a resource containing the standard content add icon for the current theme
  670. func ContentAddIcon() fyne.Resource {
  671. return safeIconLookup(IconNameContentAdd)
  672. }
  673. // ContentRemoveIcon returns a resource containing the standard content remove icon for the current theme
  674. func ContentRemoveIcon() fyne.Resource {
  675. return safeIconLookup(IconNameContentRemove)
  676. }
  677. // ContentClearIcon returns a resource containing the standard content clear icon for the current theme
  678. func ContentClearIcon() fyne.Resource {
  679. return safeIconLookup(IconNameContentClear)
  680. }
  681. // ContentCutIcon returns a resource containing the standard content cut icon for the current theme
  682. func ContentCutIcon() fyne.Resource {
  683. return safeIconLookup(IconNameContentCut)
  684. }
  685. // ContentCopyIcon returns a resource containing the standard content copy icon for the current theme
  686. func ContentCopyIcon() fyne.Resource {
  687. return safeIconLookup(IconNameContentCopy)
  688. }
  689. // ContentPasteIcon returns a resource containing the standard content paste icon for the current theme
  690. func ContentPasteIcon() fyne.Resource {
  691. return safeIconLookup(IconNameContentPaste)
  692. }
  693. // ContentRedoIcon returns a resource containing the standard content redo icon for the current theme
  694. func ContentRedoIcon() fyne.Resource {
  695. return safeIconLookup(IconNameContentRedo)
  696. }
  697. // ContentUndoIcon returns a resource containing the standard content undo icon for the current theme
  698. func ContentUndoIcon() fyne.Resource {
  699. return safeIconLookup(IconNameContentUndo)
  700. }
  701. // ColorAchromaticIcon returns a resource containing the standard achromatic color icon for the current theme
  702. func ColorAchromaticIcon() fyne.Resource {
  703. return safeIconLookup(IconNameColorAchromatic)
  704. }
  705. // ColorChromaticIcon returns a resource containing the standard chromatic color icon for the current theme
  706. func ColorChromaticIcon() fyne.Resource {
  707. return safeIconLookup(IconNameColorChromatic)
  708. }
  709. // ColorPaletteIcon returns a resource containing the standard color palette icon for the current theme
  710. func ColorPaletteIcon() fyne.Resource {
  711. return safeIconLookup(IconNameColorPalette)
  712. }
  713. // DocumentIcon returns a resource containing the standard document icon for the current theme
  714. func DocumentIcon() fyne.Resource {
  715. return safeIconLookup(IconNameDocument)
  716. }
  717. // DocumentCreateIcon returns a resource containing the standard document create icon for the current theme
  718. func DocumentCreateIcon() fyne.Resource {
  719. return safeIconLookup(IconNameDocumentCreate)
  720. }
  721. // DocumentPrintIcon returns a resource containing the standard document print icon for the current theme
  722. func DocumentPrintIcon() fyne.Resource {
  723. return safeIconLookup(IconNameDocumentPrint)
  724. }
  725. // DocumentSaveIcon returns a resource containing the standard document save icon for the current theme
  726. func DocumentSaveIcon() fyne.Resource {
  727. return safeIconLookup(IconNameDocumentSave)
  728. }
  729. // MoreHorizontalIcon returns a resource containing the standard horizontal more icon for the current theme
  730. func MoreHorizontalIcon() fyne.Resource {
  731. return current().Icon(IconNameMoreHorizontal)
  732. }
  733. // MoreVerticalIcon returns a resource containing the standard vertical more icon for the current theme
  734. func MoreVerticalIcon() fyne.Resource {
  735. return current().Icon(IconNameMoreVertical)
  736. }
  737. // InfoIcon returns a resource containing the standard dialog info icon for the current theme
  738. func InfoIcon() fyne.Resource {
  739. return safeIconLookup(IconNameInfo)
  740. }
  741. // QuestionIcon returns a resource containing the standard dialog question icon for the current theme
  742. func QuestionIcon() fyne.Resource {
  743. return safeIconLookup(IconNameQuestion)
  744. }
  745. // WarningIcon returns a resource containing the standard dialog warning icon for the current theme
  746. func WarningIcon() fyne.Resource {
  747. return safeIconLookup(IconNameWarning)
  748. }
  749. // ErrorIcon returns a resource containing the standard dialog error icon for the current theme
  750. func ErrorIcon() fyne.Resource {
  751. return safeIconLookup(IconNameError)
  752. }
  753. // BrokenImageIcon returns a resource containing an icon to specify a broken or missing image
  754. //
  755. // Since: 2.4
  756. func BrokenImageIcon() fyne.Resource {
  757. return safeIconLookup(IconNameBrokenImage)
  758. }
  759. // FileIcon returns a resource containing the appropriate file icon for the current theme
  760. func FileIcon() fyne.Resource {
  761. return safeIconLookup(IconNameFile)
  762. }
  763. // FileApplicationIcon returns a resource containing the file icon representing application files for the current theme
  764. func FileApplicationIcon() fyne.Resource {
  765. return safeIconLookup(IconNameFileApplication)
  766. }
  767. // FileAudioIcon returns a resource containing the file icon representing audio files for the current theme
  768. func FileAudioIcon() fyne.Resource {
  769. return safeIconLookup(IconNameFileAudio)
  770. }
  771. // FileImageIcon returns a resource containing the file icon representing image files for the current theme
  772. func FileImageIcon() fyne.Resource {
  773. return safeIconLookup(IconNameFileImage)
  774. }
  775. // FileTextIcon returns a resource containing the file icon representing text files for the current theme
  776. func FileTextIcon() fyne.Resource {
  777. return safeIconLookup(IconNameFileText)
  778. }
  779. // FileVideoIcon returns a resource containing the file icon representing video files for the current theme
  780. func FileVideoIcon() fyne.Resource {
  781. return safeIconLookup(IconNameFileVideo)
  782. }
  783. // FolderIcon returns a resource containing the standard folder icon for the current theme
  784. func FolderIcon() fyne.Resource {
  785. return safeIconLookup(IconNameFolder)
  786. }
  787. // FolderNewIcon returns a resource containing the standard folder creation icon for the current theme
  788. func FolderNewIcon() fyne.Resource {
  789. return safeIconLookup(IconNameFolderNew)
  790. }
  791. // FolderOpenIcon returns a resource containing the standard folder open icon for the current theme
  792. func FolderOpenIcon() fyne.Resource {
  793. return safeIconLookup(IconNameFolderOpen)
  794. }
  795. // HelpIcon returns a resource containing the standard help icon for the current theme
  796. func HelpIcon() fyne.Resource {
  797. return safeIconLookup(IconNameHelp)
  798. }
  799. // HistoryIcon returns a resource containing the standard history icon for the current theme
  800. func HistoryIcon() fyne.Resource {
  801. return safeIconLookup(IconNameHistory)
  802. }
  803. // HomeIcon returns a resource containing the standard home folder icon for the current theme
  804. func HomeIcon() fyne.Resource {
  805. return safeIconLookup(IconNameHome)
  806. }
  807. // SettingsIcon returns a resource containing the standard settings icon for the current theme
  808. func SettingsIcon() fyne.Resource {
  809. return safeIconLookup(IconNameSettings)
  810. }
  811. // MailAttachmentIcon returns a resource containing the standard mail attachment icon for the current theme
  812. func MailAttachmentIcon() fyne.Resource {
  813. return safeIconLookup(IconNameMailAttachment)
  814. }
  815. // MailComposeIcon returns a resource containing the standard mail compose icon for the current theme
  816. func MailComposeIcon() fyne.Resource {
  817. return safeIconLookup(IconNameMailCompose)
  818. }
  819. // MailForwardIcon returns a resource containing the standard mail forward icon for the current theme
  820. func MailForwardIcon() fyne.Resource {
  821. return safeIconLookup(IconNameMailForward)
  822. }
  823. // MailReplyIcon returns a resource containing the standard mail reply icon for the current theme
  824. func MailReplyIcon() fyne.Resource {
  825. return safeIconLookup(IconNameMailReply)
  826. }
  827. // MailReplyAllIcon returns a resource containing the standard mail reply all icon for the current theme
  828. func MailReplyAllIcon() fyne.Resource {
  829. return safeIconLookup(IconNameMailReplyAll)
  830. }
  831. // MailSendIcon returns a resource containing the standard mail send icon for the current theme
  832. func MailSendIcon() fyne.Resource {
  833. return safeIconLookup(IconNameMailSend)
  834. }
  835. // MediaMusicIcon returns a resource containing the standard media music icon for the current theme
  836. //
  837. // Since: 2.1
  838. func MediaMusicIcon() fyne.Resource {
  839. return safeIconLookup(IconNameMediaMusic)
  840. }
  841. // MediaPhotoIcon returns a resource containing the standard media photo icon for the current theme
  842. //
  843. // Since: 2.1
  844. func MediaPhotoIcon() fyne.Resource {
  845. return safeIconLookup(IconNameMediaPhoto)
  846. }
  847. // MediaVideoIcon returns a resource containing the standard media video icon for the current theme
  848. //
  849. // Since: 2.1
  850. func MediaVideoIcon() fyne.Resource {
  851. return safeIconLookup(IconNameMediaVideo)
  852. }
  853. // MediaFastForwardIcon returns a resource containing the standard media fast-forward icon for the current theme
  854. func MediaFastForwardIcon() fyne.Resource {
  855. return safeIconLookup(IconNameMediaFastForward)
  856. }
  857. // MediaFastRewindIcon returns a resource containing the standard media fast-rewind icon for the current theme
  858. func MediaFastRewindIcon() fyne.Resource {
  859. return safeIconLookup(IconNameMediaFastRewind)
  860. }
  861. // MediaPauseIcon returns a resource containing the standard media pause icon for the current theme
  862. func MediaPauseIcon() fyne.Resource {
  863. return safeIconLookup(IconNameMediaPause)
  864. }
  865. // MediaPlayIcon returns a resource containing the standard media play icon for the current theme
  866. func MediaPlayIcon() fyne.Resource {
  867. return safeIconLookup(IconNameMediaPlay)
  868. }
  869. // MediaRecordIcon returns a resource containing the standard media record icon for the current theme
  870. func MediaRecordIcon() fyne.Resource {
  871. return safeIconLookup(IconNameMediaRecord)
  872. }
  873. // MediaReplayIcon returns a resource containing the standard media replay icon for the current theme
  874. func MediaReplayIcon() fyne.Resource {
  875. return safeIconLookup(IconNameMediaReplay)
  876. }
  877. // MediaSkipNextIcon returns a resource containing the standard media skip next icon for the current theme
  878. func MediaSkipNextIcon() fyne.Resource {
  879. return safeIconLookup(IconNameMediaSkipNext)
  880. }
  881. // MediaSkipPreviousIcon returns a resource containing the standard media skip previous icon for the current theme
  882. func MediaSkipPreviousIcon() fyne.Resource {
  883. return safeIconLookup(IconNameMediaSkipPrevious)
  884. }
  885. // MediaStopIcon returns a resource containing the standard media stop icon for the current theme
  886. func MediaStopIcon() fyne.Resource {
  887. return safeIconLookup(IconNameMediaStop)
  888. }
  889. // MoveDownIcon returns a resource containing the standard down arrow icon for the current theme
  890. func MoveDownIcon() fyne.Resource {
  891. return safeIconLookup(IconNameMoveDown)
  892. }
  893. // MoveUpIcon returns a resource containing the standard up arrow icon for the current theme
  894. func MoveUpIcon() fyne.Resource {
  895. return safeIconLookup(IconNameMoveUp)
  896. }
  897. // NavigateBackIcon returns a resource containing the standard backward navigation icon for the current theme
  898. func NavigateBackIcon() fyne.Resource {
  899. return safeIconLookup(IconNameNavigateBack)
  900. }
  901. // NavigateNextIcon returns a resource containing the standard forward navigation icon for the current theme
  902. func NavigateNextIcon() fyne.Resource {
  903. return safeIconLookup(IconNameNavigateNext)
  904. }
  905. // MenuDropDownIcon returns a resource containing the standard menu drop down icon for the current theme
  906. func MenuDropDownIcon() fyne.Resource {
  907. return safeIconLookup(IconNameArrowDropDown)
  908. }
  909. // MenuDropUpIcon returns a resource containing the standard menu drop up icon for the current theme
  910. func MenuDropUpIcon() fyne.Resource {
  911. return safeIconLookup(IconNameArrowDropUp)
  912. }
  913. // ViewFullScreenIcon returns a resource containing the standard fullscreen icon for the current theme
  914. func ViewFullScreenIcon() fyne.Resource {
  915. return safeIconLookup(IconNameViewFullScreen)
  916. }
  917. // ViewRestoreIcon returns a resource containing the standard exit fullscreen icon for the current theme
  918. func ViewRestoreIcon() fyne.Resource {
  919. return safeIconLookup(IconNameViewRestore)
  920. }
  921. // ViewRefreshIcon returns a resource containing the standard refresh icon for the current theme
  922. func ViewRefreshIcon() fyne.Resource {
  923. return safeIconLookup(IconNameViewRefresh)
  924. }
  925. // ZoomFitIcon returns a resource containing the standard zoom fit icon for the current theme
  926. func ZoomFitIcon() fyne.Resource {
  927. return safeIconLookup(IconNameViewZoomFit)
  928. }
  929. // ZoomInIcon returns a resource containing the standard zoom in icon for the current theme
  930. func ZoomInIcon() fyne.Resource {
  931. return safeIconLookup(IconNameViewZoomIn)
  932. }
  933. // ZoomOutIcon returns a resource containing the standard zoom out icon for the current theme
  934. func ZoomOutIcon() fyne.Resource {
  935. return safeIconLookup(IconNameViewZoomOut)
  936. }
  937. // VisibilityIcon returns a resource containing the standard visibility icon for the current theme
  938. func VisibilityIcon() fyne.Resource {
  939. return safeIconLookup(IconNameVisibility)
  940. }
  941. // VisibilityOffIcon returns a resource containing the standard visibility off icon for the current theme
  942. func VisibilityOffIcon() fyne.Resource {
  943. return safeIconLookup(IconNameVisibilityOff)
  944. }
  945. // VolumeDownIcon returns a resource containing the standard volume down icon for the current theme
  946. func VolumeDownIcon() fyne.Resource {
  947. return safeIconLookup(IconNameVolumeDown)
  948. }
  949. // VolumeMuteIcon returns a resource containing the standard volume mute icon for the current theme
  950. func VolumeMuteIcon() fyne.Resource {
  951. return safeIconLookup(IconNameVolumeMute)
  952. }
  953. // VolumeUpIcon returns a resource containing the standard volume up icon for the current theme
  954. func VolumeUpIcon() fyne.Resource {
  955. return safeIconLookup(IconNameVolumeUp)
  956. }
  957. // ComputerIcon returns a resource containing the standard computer icon for the current theme
  958. func ComputerIcon() fyne.Resource {
  959. return safeIconLookup(IconNameComputer)
  960. }
  961. // DownloadIcon returns a resource containing the standard download icon for the current theme
  962. func DownloadIcon() fyne.Resource {
  963. return safeIconLookup(IconNameDownload)
  964. }
  965. // StorageIcon returns a resource containing the standard storage icon for the current theme
  966. func StorageIcon() fyne.Resource {
  967. return safeIconLookup(IconNameStorage)
  968. }
  969. // UploadIcon returns a resource containing the standard upload icon for the current theme
  970. func UploadIcon() fyne.Resource {
  971. return safeIconLookup(IconNameUpload)
  972. }
  973. // AccountIcon returns a resource containing the standard account icon for the current theme
  974. func AccountIcon() fyne.Resource {
  975. return safeIconLookup(IconNameAccount)
  976. }
  977. // LoginIcon returns a resource containing the standard login icon for the current theme
  978. func LoginIcon() fyne.Resource {
  979. return safeIconLookup(IconNameLogin)
  980. }
  981. // LogoutIcon returns a resource containing the standard logout icon for the current theme
  982. func LogoutIcon() fyne.Resource {
  983. return safeIconLookup(IconNameLogout)
  984. }
  985. // ListIcon returns a resource containing the standard list icon for the current theme
  986. func ListIcon() fyne.Resource {
  987. return safeIconLookup(IconNameList)
  988. }
  989. // GridIcon returns a resource containing the standard grid icon for the current theme
  990. func GridIcon() fyne.Resource {
  991. return safeIconLookup(IconNameGrid)
  992. }
  993. func safeIconLookup(n fyne.ThemeIconName) fyne.Resource {
  994. icon := current().Icon(n)
  995. if icon == nil {
  996. fyne.LogError("Loaded theme returned nil icon", nil)
  997. return fallbackIcon
  998. }
  999. return icon
  1000. }