Use gfx::Image instead of gfx::ImageSkia in API
The gfx::Image can use NSImage directly as underlying format, so we don't have to decode images ourselves on Mac, and we will also be able to make use of template images.
This commit is contained in:
parent
3d7da455bc
commit
ab83b21fa6
10 changed files with 35 additions and 40 deletions
|
@ -53,20 +53,14 @@ TrayIconCocoa::~TrayIconCocoa() {
|
|||
[[NSStatusBar systemStatusBar] removeStatusItem:item_];
|
||||
}
|
||||
|
||||
void TrayIconCocoa::SetImage(const gfx::ImageSkia& image) {
|
||||
if (!image.isNull()) {
|
||||
gfx::Image neutral(image);
|
||||
if (!neutral.IsEmpty())
|
||||
[item_ setImage:neutral.ToNSImage()];
|
||||
}
|
||||
void TrayIconCocoa::SetImage(const gfx::Image& image) {
|
||||
if (!image.IsEmpty())
|
||||
[item_ setImage:image.ToNSImage()];
|
||||
}
|
||||
|
||||
void TrayIconCocoa::SetPressedImage(const gfx::ImageSkia& image) {
|
||||
if (!image.isNull()) {
|
||||
gfx::Image neutral(image);
|
||||
if (!neutral.IsEmpty())
|
||||
[item_ setAlternateImage:neutral.ToNSImage()];
|
||||
}
|
||||
void TrayIconCocoa::SetPressedImage(const gfx::Image& image) {
|
||||
if (!image.IsEmpty())
|
||||
[item_ setAlternateImage:image.ToNSImage()];
|
||||
}
|
||||
|
||||
void TrayIconCocoa::SetToolTip(const std::string& tool_tip) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue