Commit f9a8f3a88083e005f03275683e446fa239755a64
1 parent
e87afa6d
add icon22 and implement to_HTML for icon16, icon22, icon32 and icon
Showing
2 changed files
with
13 additions
and
4 deletions
Show diff stats
web/widgets/icon.anubis
| ... | ... | @@ -17,6 +17,9 @@ public type Icon: |
| 17 | 17 | icon16( |
| 18 | 18 | String name |
| 19 | 19 | ), |
| 20 | + icon22( | |
| 21 | + String name | |
| 22 | + ), | |
| 20 | 23 | icon32( |
| 21 | 24 | String name |
| 22 | 25 | ), |
| ... | ... | @@ -34,8 +37,9 @@ public define HTML_Off_Form |
| 34 | 37 | { |
| 35 | 38 | no_icon then empty, |
| 36 | 39 | font_awesome(code) then to_HTML(code), |
| 37 | - icon16(name) then todo "handle case 'icon16'", | |
| 38 | - icon32(name) then todo "handle case 'icon32'", | |
| 39 | - icon(name) then todo "handle case 'icon'" | |
| 40 | + icon16(name) then img("/icons/16x16/"+name+".png"), | |
| 41 | + icon22(name) then img("/icons/22x22/"+name+".png"), | |
| 42 | + icon32(name) then img("/icons/32x32/"+name+".png"), | |
| 43 | + icon(name) then img("/icons/"+name+".png") | |
| 40 | 44 | } |
| 41 | 45 | . | ... | ... |
web/widgets/icons_set.anubis
| ... | ... | @@ -6,6 +6,8 @@ |
| 6 | 6 | * © Calexium |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | +read web/mime.anubis | |
| 10 | + | |
| 9 | 11 | public define String icn16_add = "icons/16x16/add.png". |
| 10 | 12 | public define String icn16_edit = "icons/16x16/edit.png". |
| 11 | 13 | public define String icn16_calendar = "icons/16x16/calendar.png". |
| ... | ... | @@ -38,6 +40,9 @@ public define String icn16_mime_txt = "icons/16x16/mimetypes/txt.png". |
| 38 | 40 | public define String icn16_mime_csv = "icons/16x16/mimetypes/csv.png". |
| 39 | 41 | public define String icn16_mime_unknown = "icons/16x16/mimetypes/unknown.png". |
| 40 | 42 | |
| 41 | -public define String icn16_mime(String mimetype) = "icons/16x16/mimetypes/"+mimetype+".png". | |
| 43 | +public define String icn16_mime(String mimetype) = "icons/16x16/mimetypes/"+mimetype+".png". | |
| 44 | +public define String icn16_mime(MIME mimetype) = "icons/16x16/mimetypes/"+mimetype.type+"-"+mimetype.subtype+".png". | |
| 45 | +public define String icn22_mime(String mimetype) = "icons/22x22/mimetypes/"+mimetype+".png". | |
| 46 | +public define String icn22_mime(MIME mimetype) = "icons/22x22/mimetypes/"+mimetype.type+"-"+mimetype.subtype+".png". | |
| 42 | 47 | |
| 43 | 48 | public define String to_Icon (Bool value)= if value then icn16_true else icn16_false. | ... | ... |