Shorten the menu title on mobile.

This commit is contained in:
FelisCatus 2017-08-03 22:39:23 -04:00
parent b40ff3d36c
commit d8684c6d24
2 changed files with 13 additions and 1 deletions

View File

@ -255,12 +255,15 @@ options.currentProfileChanged = (reason) ->
if currentName
title = chrome.i18n.getMessage('browserAction_titleWithResult', [
currentName, '', details])
shortTitle = 'Omega: ' + currentName # TODO: I18n.
else
title = details
shortTitle = 'Omega: ' + details # TODO: I18n.
if external and current.profileType != 'SystemProfile'
message = chrome.i18n.getMessage('browserAction_titleExternalProxy')
title = message + '\n' + title
shortTitle = 'Omega-Extern: ' + details # TODO: I18n.
options.setBadge()
if not current.name or not OmegaPac.Profiles.isInclusive(current)
@ -271,6 +274,7 @@ options.currentProfileChanged = (reason) ->
tabs.resetAll(
icon: icon
title: title
shortTitle: shortTitle
)
encodeError = (obj) ->

View File

@ -25,7 +25,10 @@ class ChromeTabs
tabs.forEach (tab) =>
@_dirtyTabs[tab.id] = tab.id
@onUpdated tab.id, {}, tab if tab.active
chrome.browserAction.setTitle({title: action.title})
if chrome.browserAction.setPopup?
chrome.browserAction.setTitle({title: action.title})
else
chrome.browserAction.setTitle({title: action.shortTitle})
@setIcon(action.icon)
onUpdated: (tabId, changeInfo, tab) ->
@ -41,6 +44,11 @@ class ChromeTabs
for own id of @_badgeTab
try chrome.browserAction.setBadgeText?(text: '', tabId: id)
@_badgeTab = null
if not chrome.browserAction.setPopup?
# TODO: Is there a way to show current proxy for page? Is there even
# enough space?
return
if not tab.url? or tab.url.indexOf("chrome") == 0
if @_defaultAction
chrome.browserAction.setTitle({