Closed
Bug 1472272
Opened 6 years ago
Closed 6 years ago
Allow apps like Thunderbird to define a dark theme to use when the system appearance changes to dark mode
Categories
(Firefox :: Theme, defect)
Firefox
Theme
Tracking
()
RESOLVED
FIXED
Firefox 63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: Paenglab, Assigned: spohl)
References
Details
Attachments
(1 file, 3 obsolete files)
(deleted),
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
FX uses "firefox-compact-dark@mozilla.org" as DARK_THEME_ID but TB uses "thunderbird-compact-dark@mozilla.org". So hard-coding it in https://hg.mozilla.org/mozilla-central/rev/24fe98c45aae#l3.12 makes it impossible to set the dark theme for TB. Renaming the TB to "firefox-compact-dark@mozilla.org" is also no real option as iut's a TB theme and not a FX one.
Stephen proposed to define DARK_THEME_ID during compile-time.
Reporter | ||
Comment 1•6 years ago
|
||
Stephen, unfortunately my programming skills aren't enough to implement this. Would you be so kind to implement this? Many thanks in advance.
Flags: needinfo?(spohl.mozilla.bugs)
Assignee | ||
Comment 2•6 years ago
|
||
This here looks like it would do the trick. Dao, is this the right way to achieve this in frontend code? Thank you!
Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED
Flags: needinfo?(spohl.mozilla.bugs)
Attachment #8988965 -
Flags: review?(dao+bmo)
Updated•6 years ago
|
Attachment #8988965 -
Flags: review?(dao+bmo) → review+
Assignee | ||
Comment 3•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/7cb1b45d690ff09afbc3a4bd0266dea0e86862bf
Bug 1472272: Allow apps like Thunderbird to switch to the dark theme as well when macOS 10.14+ switches to dark mode. r=dao
Assignee | ||
Updated•6 years ago
|
Summary: Define the DARK_THEME_ID during the compile time instead of hard-coding it in toolkit. → Make the definition of DARK_THEME_ID depend on Services.appinfo.name to support apps like Thunderbird
Backout by aciure@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/52c64cf3183a
Backed out 1 changesets for xpcshell failures test_TelemetrySession.js CLOSED TREE
Assignee | ||
Comment 5•6 years ago
|
||
Fixed telemetry test by adding null check.
Attachment #8988965 -
Attachment is obsolete: true
Attachment #8988997 -
Flags: review+
Assignee | ||
Comment 6•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/bd57c1549f755550a9f43ada35652178a2a41193
Bug 1472272: Allow apps like Thunderbird to switch to the dark theme as well when macOS 10.14+ switches to dark mode. r=dao
Comment 7•6 years ago
|
||
Backed out 1 changesets (bug 1472272) for xpcshell failures test_TelemetrySession.js
push that caused the backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/bd57c1549f755550a9f43ada35652178a2a41193
failure: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&group_state=expanded&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-classifiedState=unclassified&selectedJob=185764954&filter-searchStr=Linux+opt+Xpcshell+tests+test-linux32%2Fopt-xpcshell-8+X%28X8%29
log: https://treeherder.mozilla.org/logviewer.html#?job_id=185764954&repo=mozilla-inbound
backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/250aac27f0cbcbb3b72a93116bf5b33af2f84c30
Flags: needinfo?(spohl.mozilla.bugs)
Comment 8•6 years ago
|
||
How about we let nsBrowserGlue communicate to LightweightThemeManager that firefox-compact-dark@mozilla.org is the "dark" theme somewhere around here? https://searchfox.org/mozilla-central/rev/4074ba403219b7accdf00220b20dc492bfd4d83e/browser/components/nsBrowserGlue.js#755
Comment 9•6 years ago
|
||
Many thanks guys for all the trouble to help Thunderbird!
Assignee | ||
Comment 10•6 years ago
|
||
(In reply to Dão Gottwald [::dao] from comment #8)
> How about we let nsBrowserGlue communicate to LightweightThemeManager that
> firefox-compact-dark@mozilla.org is the "dark" theme somewhere around here?
> https://searchfox.org/mozilla-central/rev/
> 4074ba403219b7accdf00220b20dc492bfd4d83e/browser/components/nsBrowserGlue.
> js#755
Before we do this I'd like to look into this test. The problem with the first patch was that Services.appinfo.name was null. But now, the test fails because the telemetry ping reports a buildId of "undefined" instead of the expected "20160315". This seems to be due to the way we load the addons manager for this test[1], and how we generate the gAppInfo. Simply accessing Services.appinfo in LightweightThemeManager.jsm will cause this test to fail.
[1] https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/tests/unit/head.js#187
[2] https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/tests/unit/head.js#190,207-211
Flags: needinfo?(spohl.mozilla.bugs)
Comment 11•6 years ago
|
||
In my book doing this from nsBrowserGlue is preferable anyway. It would be a better separation of concerns without the need for LightweightThemeManager to pull clever tricks to know the id.
Assignee | ||
Comment 12•6 years ago
|
||
Assignee | ||
Comment 13•6 years ago
|
||
Attachment #8989029 -
Flags: review?(dao+bmo)
Assignee | ||
Comment 14•6 years ago
|
||
Comment on attachment 8989029 [details] [diff] [review]
Patch
Review of attachment 8989029 [details] [diff] [review]:
-----------------------------------------------------------------
Along these lines?
Assignee | ||
Updated•6 years ago
|
Attachment #8988997 -
Attachment is obsolete: true
Comment 15•6 years ago
|
||
Comment on attachment 8989029 [details] [diff] [review]
Patch
Looks good. I don't feel strongly about it but instead of a separate method I'd maybe extend addBuiltInTheme to support this directly. Something like this:
signature:
addBuiltInTheme(theme, { useInDarkMode } = {}) {
call site:
LightweightThemeManager.addBuiltInTheme({..}, { useInDarkMode: true });
Attachment #8989029 -
Flags: review?(dao+bmo) → review+
Assignee | ||
Comment 16•6 years ago
|
||
Attachment #8989029 -
Attachment is obsolete: true
Attachment #8989073 -
Flags: review?(dao+bmo)
Updated•6 years ago
|
Attachment #8989073 -
Flags: review?(dao+bmo) → review+
Assignee | ||
Comment 17•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/15c9eddbb3312d7fc2a852cb6d9ec5ec12700f7f
Bug 1472272: Allow apps like Thunderbird to switch to the dark theme as well when macOS 10.14+ switches to dark mode. r=dao
Assignee | ||
Updated•6 years ago
|
Summary: Make the definition of DARK_THEME_ID depend on Services.appinfo.name to support apps like Thunderbird → Allow apps like Thunderbird to define a dark theme to use when the system appearance changes to dark mode
Reporter | ||
Comment 18•6 years ago
|
||
Many thanks for helping Thunderbird.
Comment 19•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
You need to log in
before you can comment on or make changes to this bug.
Description
•