14

Bug 1475608 - Dark theme followup: home panels, status bar by garvankeeley · Pul...

 6 years ago
source link: https://github.com/mozilla-mobile/firefox-ios/pull/4044
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
The first commit of Dark Theme left home panels in a partially complete state (I did quick theme support there to land the first patch).This PR refactors how home panels apply their colors. It is giant because home panels are a lot of code.This also has a minor commit to remove the theme for snack bar, it looks fine IMO in normal colors for now. (Although I could see wanting to change this later).All the HomePanels and their respective table views, and table view custom headers/footers/cell subclasses, need to have an applyTheme() function, where color assignments go.Steps needed:Move color assignment into applyTheme(). On-demand color assignment in cellForRowAt /cellForItemAt doesn't need any changes other than ensuring colors are theme colors in the form UIColor.theme.thecolor.Ensure applyTheme() is applied to children when called on a parent, or in the case of table views, call reloadData() on table views.Ensure table views that reuse header/footer/cells will update their colors when reload data is called.classes that were setting up their color scheme in init(), need to call applyTheme() in init().Commit 96ced90 is a cleanup commit to how we init panels, removing the var profile: Profile! and making it a let profile: Profile which is "better code"®, and easier for me to work with without breaking things.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK