Skip to content
This repository has been archived by the owner on Dec 3, 2017. It is now read-only.

Commit

Permalink
Adapt button size to user's icon size preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob--W committed Nov 8, 2013
1 parent 3d046c4 commit 696b456
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 11 additions & 0 deletions data/browserActionBadge.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#button-img {
width: 19px;
height: 19px;
max-width: 100%;
max-height: 100%;
position: absolute;
margin: auto;
top: 0;
Expand Down Expand Up @@ -79,6 +81,15 @@
#badgeText:empty {
display: none;
}
@media (max-height: 19px) {
#badgeText {
height: 11px;
padding: 0;
font-size: 8.2px;
border-left-width: 0.5px;
border-right-width: 0.5px;
}
}
</style>
</head>
<body>
Expand Down
6 changes: 2 additions & 4 deletions lib/browserAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,13 @@ function createBadge(browserAction, badgeState) {
label: name,
width: 32,
height: 32,
autoShrink: true,
aspectRatio: 1,
contentURL: selfData.url('browserActionBadge.html'),
contentScript: selfData.load('browserActionBadge.js'),
contentScriptWhen: 'ready',
onAttach: function(widgetView) {
popupRenderer.registerWidgetView(widgetView);
// Turn browserAction into a square shape
if (tbw.width != tbw.minHeight) {
tbw.width = tbw.minHeight;
}
// browserAction.js sends a single message when it's loaded
// When that happens, update the badge text.
widgetView.once('message', function() {
Expand Down

0 comments on commit 696b456

Please sign in to comment.