Change Details
| src/link.cpp |
| 33 | 33 | iconPath = gmenu2x->sc.getSkinFilePath("icons/generic.png"); |
| 34 | 34 | iconX = 0; |
| 35 | 35 | padding = 0; |
| 36 | |
| 37 | updateSurfaces(); |
| 36 | 38 | } |
| 37 | 39 | |
| 38 | 40 | void Link::run() {} |
| 39 | 41 | |
| 40 | 42 | void Link::paint() { |
| 41 | | gmenu2x->sc[getIconPath()]->blit(gmenu2x->s, iconX, rect.y+padding, 32,32); |
| 43 | iconSurface->blit(gmenu2x->s, iconX, rect.y+padding, 32,32); |
| 42 | 44 | gmenu2x->s->write( gmenu2x->font, getTitle(), iconX+16, rect.y+gmenu2x->skinConfInt["linkHeight"]-padding, SFontHAlignCenter, SFontVAlignBottom ); |
| 43 | 45 | } |
| 44 | 46 | |
| ... | ... | |
| 50 | 52 | return true; |
| 51 | 53 | } |
| 52 | 54 | |
| 55 | void Link::updateSurfaces() |
| 56 | { |
| 57 | iconSurface = gmenu2x->sc[getIconPath()]; |
| 58 | } |
| 59 | |
| 53 | 60 | string Link::getTitle() { |
| 54 | 61 | return title; |
| 55 | 62 | } |
| ... | ... | |
| 89 | 96 | |
| 90 | 97 | this->icon = icon; |
| 91 | 98 | edited = true; |
| 99 | updateSurfaces(); |
| 92 | 100 | } |
| 93 | 101 | |
| 94 | 102 | string Link::searchIcon() { |
| ... | ... | |
| 106 | 114 | iconPath = icon; |
| 107 | 115 | else |
| 108 | 116 | iconPath = gmenu2x->sc.getSkinFilePath("icons/generic.png"); |
| 117 | updateSurfaces(); |
| 109 | 118 | } |
| 110 | 119 | |
| 111 | 120 | void Link::setSize(int w, int h) { |
| src/link.h |
| 24 | 24 | #include <iostream> |
| 25 | 25 | |
| 26 | 26 | #include "button.h" |
| 27 | #include "surface.h" |
| 27 | 28 | |
| 28 | 29 | using std::string; |
| 29 | 30 | |
| ... | ... | |
| 42 | 43 | bool edited; |
| 43 | 44 | string title, description, icon, iconPath; |
| 44 | 45 | |
| 46 | Surface *iconSurface; |
| 47 | Surface *icon_hover; |
| 48 | |
| 45 | 49 | void recalcCoordinates(); |
| 50 | void updateSurfaces(); |
| 46 | 51 | |
| 47 | 52 | public: |
| 48 | 53 | Link(GMenu2X *gmenu2x); |
Download the corresponding diff file