1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Fix 'background_opacity' deprecation

During the deprecation of the 'background_opacity' field, it was
incorrectly renamed to 'window_opacity'. This changes that back to ensure
the old field still works and a warning is emitted accordingly.

See the original regression here:
c24d7dfd0d (diff-f92f0b1ad70a7b75b7266f3c9e569025e023d186814aa88c2b690800850ccb78L72-R73)

Fixes #5437.
This commit is contained in:
Christian Duerr 2021-08-23 15:47:34 +00:00 committed by GitHub
parent 62a1fad524
commit ed76efe9c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -70,7 +70,7 @@ pub struct UiConfig {
/// Background opacity from 0.0 to 1.0.
#[config(deprecated = "use window.opacity instead")]
window_opacity: Option<Percentage>,
background_opacity: Option<Percentage>,
}
impl Default for UiConfig {
@ -85,7 +85,7 @@ impl Default for UiConfig {
config_paths: Default::default(),
key_bindings: Default::default(),
mouse_bindings: Default::default(),
window_opacity: Default::default(),
background_opacity: Default::default(),
bell: Default::default(),
colors: Default::default(),
draw_bold_text_with_bright_colors: Default::default(),
@ -117,7 +117,7 @@ impl UiConfig {
#[inline]
pub fn window_opacity(&self) -> f32 {
self.window_opacity.unwrap_or(self.window.opacity).as_f32()
self.background_opacity.unwrap_or(self.window.opacity).as_f32()
}
#[inline]