mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
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:
parent
c2a50c92fa
commit
eca66dba72
2 changed files with 9 additions and 9 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue