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

@ -93,7 +93,7 @@ impl Device {
document,
default_values: ComputedValues::default_values(doc),
root_font_size: AtomicU32::new(FONT_MEDIUM_PX.to_bits()),
body_text_color: AtomicUsize::new(prefs.mDefaultColor as usize),
body_text_color: AtomicUsize::new(prefs.mColors.mDefault as usize),
used_root_font_size: AtomicBool::new(false),
used_font_metrics: AtomicBool::new(false),
used_viewport_size: AtomicBool::new(false),
@ -387,12 +387,12 @@ impl Device {
/// Returns the default background color.
pub fn default_background_color(&self) -> RGBA {
convert_nscolor_to_rgba(self.pref_sheet_prefs().mDefaultBackgroundColor)
convert_nscolor_to_rgba(self.pref_sheet_prefs().mColors.mDefaultBackground)
}
/// Returns the default foreground color.
pub fn default_color(&self) -> RGBA {
convert_nscolor_to_rgba(self.pref_sheet_prefs().mDefaultColor)
convert_nscolor_to_rgba(self.pref_sheet_prefs().mColors.mDefault)
}
/// Returns the current effective text zoom.