diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-08-13 14:59:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 14:59:35 +0300 |
commit | 0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd (patch) | |
tree | 2ce83fa033a32f7ed74fc666d300f8d7ec36e748 /alacritty/src/display.rs | |
parent | f2211080867f6053b11194819e6e1a9c48cc21ec (diff) | |
download | r-alacritty-0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd.tar.gz r-alacritty-0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd.tar.bz2 r-alacritty-0a1683e84dfa1d89e65e9b43ed5d586ece47c8dd.zip |
Use yellow/red from the config for message bar colors
This commit completes the effort to use config colors for
message bar content by picking red/yellow from user's
colors.normal.{red,yellow} for error/warning messages
instead of fixed colors.
It also removes alacritty_terminal::term::color::RED and
alacritty_terminal::term::color::YELLOW from the alacritty_terminal API,
bumping its version to 0.11.0-dev.
Fixes #4116.
Diffstat (limited to 'alacritty/src/display.rs')
-rw-r--r-- | alacritty/src/display.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/alacritty/src/display.rs b/alacritty/src/display.rs index db0eecd1..d9dd6323 100644 --- a/alacritty/src/display.rs +++ b/alacritty/src/display.rs @@ -25,8 +25,7 @@ use crossfont::set_font_smoothing; use crossfont::{self, Rasterize, Rasterizer}; use alacritty_terminal::event::{EventListener, OnResize}; -use alacritty_terminal::index::{Column, Point}; -use alacritty_terminal::index::{Direction, Line}; +use alacritty_terminal::index::{Column, Direction, Line, Point}; use alacritty_terminal::selection::Selection; use alacritty_terminal::term::{RenderableCell, SizeInfo, Term, TermMode}; @@ -34,7 +33,7 @@ use crate::config::font::Font; use crate::config::window::StartupMode; use crate::config::Config; use crate::event::{Mouse, SearchState}; -use crate::message_bar::MessageBuffer; +use crate::message_bar::{MessageBuffer, MessageType}; use crate::meter::Meter; use crate::renderer::rects::{RenderLines, RenderRect}; use crate::renderer::{self, GlyphCache, QuadRenderer}; @@ -545,8 +544,14 @@ impl Display { // Create a new rectangle for the background. let start_line = size_info.lines().0 - message_bar_lines; let y = size_info.cell_height.mul_add(start_line as f32, size_info.padding_y); + + let color = match message.ty() { + MessageType::Error => config.colors.normal().red, + MessageType::Warning => config.colors.normal().yellow, + }; + let message_bar_rect = - RenderRect::new(0., y, size_info.width, size_info.height - y, message.color(), 1.); + RenderRect::new(0., y, size_info.width, size_info.height - y, color, 1.); // Push message_bar in the end, so it'll be above all other content. rects.push(message_bar_rect); |