icons.go 40 KB

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