fix dark mode display bug

This commit is contained in:
qinyuhang
2016-09-09 15:09:22 +08:00
parent 2c1894e255
commit b6d86a1b07
17 changed files with 97 additions and 2 deletions
+9 -2
View File
@@ -512,13 +512,20 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
if isOn {
runningStatusMenuItem.title = "Shadowsocks: On".localized
toggleRunningMenuItem.title = "Turn Shadowsocks Off".localized
let image = NSImage(named: "menu_icon")
var image = NSImage(named: "menu_icon")
if SystemThemeChangeHelper.isCurrentDark() {
image = NSImage(named: "menu_icon_dark_mode")
}
statusItemView.setIcon(image!)
// statusItem!.image = image
} else {
runningStatusMenuItem.title = "Shadowsocks: Off".localized
toggleRunningMenuItem.title = "Turn Shadowsocks On".localized
let image = NSImage(named: "menu_icon_disabled")
var image = NSImage(named: "menu_icon_disabled")
if SystemThemeChangeHelper.isCurrentDark() {
image = NSImage(named: "menu_icon_disabled_dark_mode")
}
// statusItem.image = image
statusItemView.setIcon(image!)
}
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "menu_icon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "menu_icon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "menu_icon_dark_mode.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "menu_icon_dark_mode@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "menu_icon_disabled.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "menu_icon_disabled@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "menu_icon_disabled_dark_mode.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "menu_icon_disabled_dark_mode@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB