Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Photon-friendry icon #1326

Closed
piroor opened this issue Sep 1, 2017 · 6 comments
Closed

Photon-friendry icon #1326

piroor opened this issue Sep 1, 2017 · 6 comments

Comments

@piroor
Copy link
Owner

piroor commented Sep 1, 2017

Currently there is only a screenshot-based icon. It should be replaced to another one which is designed to match to the Photon's template.
http://design.firefox.com/photon/welcome.html

アイコンを、白黒のシンプルな物で用意する。

@asamuzaK
Copy link
Contributor

asamuzaK commented Sep 1, 2017

2つ方法があります。

アイコンをSVGで作って、色はfill="context-fill"にしておく。
(私が採用しているのはこの方法です)
ただし、ユーザーがabout:configでsvg.context-properties.content.enabledを有効化する必要があります。
ref 1377302 - Support fill="context-fill" for WebExtension icons

もう1つは、manifest.jsonでダークテーマ用のアイコンを指定する。
ただし、これはまだドキュメント化されていませんし(私は確認できていない)、いったんバックアウトされかけた経緯があるので先行き不透明です。
ref 1329242 - Ability to specify a different icon for browserActions in dark themes.

@piroor
Copy link
Owner Author

piroor commented Sep 1, 2017

なるほど、この設定を有効にするようにという説明があったのはそういう理由だったのですね。
そこまで考えだすと泥沼にはまりそうなので、浮いてるけど当面はこのままでいいかなという気がしてきました……

@piroor
Copy link
Owner Author

piroor commented Sep 7, 2017

とりあえず24ピクセル以下の物はそれらしい物を作って入れてみました。
theme_iconsもバリデーションエラーが出ない程度には正しい書き方をしているつもりですが、何が悪いのか実際の表示には反映されていないという状況です。

@piroor piroor closed this as completed Sep 7, 2017
@piroor
Copy link
Owner Author

piroor commented Sep 13, 2017

Changes to introduce theme_icons are backed out for now, because it blocks initialization of TST after install or startup.

@asamuzaK
Copy link
Contributor

参考まで

management API で適用されているテーマを抽出して、テーマと対になるアイコンを指定(path)し
browserAction.setIcon({path});
とすれば、ツールバーのアイコンを動的に変更することは可能です

https://github.com/asamuzaK/sidebarTabs/blob/master/src/js/sidebar.js#L322
https://github.com/asamuzaK/sidebarTabs/blob/master/src/js/sidebar.js#L383
https://github.com/asamuzaK/sidebarTabs/blob/master/src/js/sidebar.js#L403
https://github.com/asamuzaK/sidebarTabs/blob/master/src/js/sidebar.js#L2388
この例では、テーマに合わせてサイドバーの適用CSSを変更しています

ただし、今後、theme API が整って WebExtensions なテーマが増えてきたら、別途対応が必要になるかもしれません
個人的には
fill: context-fill
がその解決策だと思っていますが、デフォルトで有効化されるかは現時点では未知数

@piroor
Copy link
Owner Author

piroor commented Sep 13, 2017

こういうのは宣言的にできるようにしておかないと、些細なことのために要求するパーミッションを増やさざるを得ず、パーミッション確認の形骸化を加速する、ということの好例みたいな例ですね……

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants