Skip to content

Commit

Permalink
Change profile icon drawing scheme. Fix #109. See also #107.
Browse files Browse the repository at this point in the history
  • Loading branch information
FelisCatus committed Dec 27, 2014
1 parent f42ae97 commit 811be91
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions omega-target-chromium-extension/background.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ actionForUrl = (url) ->
if result[0] == 'DIRECT'
details += chrome.i18n.getMessage('browserAction_directResult')
details += '\n'
direct = true
else
details += "#{result[0]}\n"
else if typeof result[1] == 'string'
Expand Down Expand Up @@ -106,13 +107,12 @@ actionForUrl = (url) ->
profileColor = current.color

icon = null
if profile.name == current.name and options.isCurrentProfileStatic()
if direct
resultColor = options.profile('direct').color
profileColor = profile.color
else
resultColor = profileColor = profile.color
icon = drawIcon(profile.color)
if direct
resultColor = options.profile('direct').color
profileColor = profile.color
else if profile.name == current.name and options.isCurrentProfileStatic()
resultColor = profileColor = profile.color
icon = drawIcon(profile.color)
else
resultColor = profile.color
profileColor = current.color
Expand Down Expand Up @@ -236,8 +236,13 @@ options.currentProfileChanged = (reason) ->
title = message + '\n' + title
options.setBadge()

if not current.name or not OmegaPac.Profiles.isInclusive(current)
icon = drawIcon(current.color)
else
icon = drawIcon(options.profile('direct').color, current.color)

tabs.resetAll(
icon: drawIcon(current.color)
icon: icon
title: title
)

Expand Down

0 comments on commit 811be91

Please sign in to comment.