style: Factor PreferenceSheet colors to its own struct

This will come handy in the next patch.

Depends on D120678

Differential Revision: https://phabricator.services.mozilla.com/D120679
This commit is contained in:
Emilio Cobos Álvarez 2023-05-22 10:11:48 +02:00 committed by Oriol Brufau
parent c2a50c92fa
commit eca66dba72
2 changed files with 9 additions and 9 deletions

View file

@ -408,14 +408,14 @@ impl SystemColor {
fn compute(&self, cx: &Context, scheme: SystemColorScheme) -> ComputedColor {
use crate::gecko_bindings::bindings;
let prefs = cx.device().pref_sheet_prefs();
let colors = &cx.device().pref_sheet_prefs().mColors;
convert_nscolor_to_computedcolor(match *self {
SystemColor::Canvastext => prefs.mDefaultColor,
SystemColor::Canvas => prefs.mDefaultBackgroundColor,
SystemColor::Linktext => prefs.mLinkColor,
SystemColor::Activetext => prefs.mActiveLinkColor,
SystemColor::Visitedtext => prefs.mVisitedLinkColor,
SystemColor::Canvastext => colors.mDefault,
SystemColor::Canvas => colors.mDefaultBackground,
SystemColor::Linktext => colors.mLink,
SystemColor::Activetext => colors.mActiveLink,
SystemColor::Visitedtext => colors.mVisitedLink,
_ => {
let color = unsafe {