Closed Bug 951317 Opened 11 years ago Closed 11 years ago

Split Button API in ActionButton and ToggleButton

Categories

(Add-on SDK Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: zer0, Assigned: zer0)

References

Details

Attachments

(1 file)

As discussed, we decided to split the new Button API in two different classes, `ActionButton` and `ToggleButton`.
This bug is also intended to fixes some compatibility issues between the early stages of Australis, when the API were initially implemented, and the latest.
Assignee: nobody → zer0
Blocks: 936623
Blocks: 951921
Comment on attachment 8349415 [details] [review]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1327

Looks, good! Please just address the regexp comment before landing.
Attachment #8349415 - Flags: review?(rFobic) → review+
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/5045b0147f9a3f640f937b1cdaf9a2fe65a58822
Bug 951317 - Split Button API in ActionButton and ToggleButton

https://github.com/mozilla/addon-sdk/commit/bd84c85eb6edce42c7df129d6edcab90e200b0a3
Merge pull request #1327 from ZER0/button/951317

fix Bug 951317 - Split Button API in ActionButton and ToggleButton r=@gozala
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Hi,

I tried the ActionButton API with the latest SDK from Git. But how I can support HiDPI displays ("Retina")? I can define an Icon with 64x64px, it looks fine in the new Australis menu. The big problem is the main toolbar. An icon with 32x32px is too big in the main toolbar, and an icon with 16x16px is totally blurry. I think my question is related to bug #948582, but what is the *correct* approach for add-on developers to provide the best icon quality for users with HiDPI display? Thank you.
Hi Sören,

it seems a regression: the code works properly, and choose the right icon: the one that seems to big in fact, is "blurry" as well.
I can probably fix that and bug 948582 with the same approach. Please, refer to that bug in order to check the progress.

To answer to your question, the correct approach is basically what you have done. The quick way is define three icons as follows:

    icon: {
      "16": "./addon16.png",
      "32": "./addon32.png",
      "64": "./addon64.png"
    }

This will makes your button's icon looks fine both in the toolbar and in menu panel: for non retina, it will choose the 16px icon for the toolbar, and the 32px for the menu panel; where for retina will choose the 32px for navbar and 64px for menu panel. 

However, in Australis the toolbar icons are 18x18 (36x36 in retina). So, 16x16 will looks good, but if you want to use all the space available, you have to specify one more icon:

    icon: {
      "18": "./addon18.png", // toolbar icon non HiDPI
      "32": "./addon32.png", // menu panel icon non HiDPI
      "36": "./addon36.png", // toolbar icon HiDPI
      "64": "./addon64.png"  // menu panel icon HiDPI
    }

Thanks for the report!
I created a separate bug for HiDPI issue, bug 961613.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: