WIP: layout compiling
This commit is contained in:
parent
e99fa77bda
commit
39887be7d0
7 changed files with 990 additions and 978 deletions
|
@ -913,7 +913,7 @@ impl SearchableItem for Editor {
|
||||||
fn update_matches(&mut self, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<Self>) {
|
fn update_matches(&mut self, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<Self>) {
|
||||||
self.highlight_background::<BufferSearchHighlights>(
|
self.highlight_background::<BufferSearchHighlights>(
|
||||||
matches,
|
matches,
|
||||||
|theme| theme.title_bar_background, // todo: update theme
|
|theme| theme.search_match_background,
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,14 +315,11 @@ impl SelectionsCollection {
|
||||||
|
|
||||||
let line = display_map.layout_row(row, &text_layout_details);
|
let line = display_map.layout_row(row, &text_layout_details);
|
||||||
|
|
||||||
dbg!("****START COL****");
|
|
||||||
let start_col = line.closest_index_for_x(positions.start) as u32;
|
let start_col = line.closest_index_for_x(positions.start) as u32;
|
||||||
if start_col < line_len || (is_empty && positions.start == line.width) {
|
if start_col < line_len || (is_empty && positions.start == line.width) {
|
||||||
let start = DisplayPoint::new(row, start_col);
|
let start = DisplayPoint::new(row, start_col);
|
||||||
dbg!("****END COL****");
|
|
||||||
let end_col = line.closest_index_for_x(positions.end) as u32;
|
let end_col = line.closest_index_for_x(positions.end) as u32;
|
||||||
let end = DisplayPoint::new(row, end_col);
|
let end = DisplayPoint::new(row, end_col);
|
||||||
dbg!(start_col, end_col);
|
|
||||||
|
|
||||||
Some(Selection {
|
Some(Selection {
|
||||||
id: post_inc(&mut self.next_selection_id),
|
id: post_inc(&mut self.next_selection_id),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use gpui::{AppContext, FontFeatures, Pixels};
|
use gpui::{px, AbsoluteLength, AppContext, FontFeatures, Pixels};
|
||||||
use schemars::JsonSchema;
|
use schemars::JsonSchema;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use std::{collections::HashMap, path::PathBuf};
|
use std::{collections::HashMap, path::PathBuf};
|
||||||
|
@ -114,12 +114,13 @@ pub enum TerminalLineHeight {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TerminalLineHeight {
|
impl TerminalLineHeight {
|
||||||
pub fn value(&self) -> f32 {
|
pub fn value(&self) -> AbsoluteLength {
|
||||||
match self {
|
let value = match self {
|
||||||
TerminalLineHeight::Comfortable => 1.618,
|
TerminalLineHeight::Comfortable => 1.618,
|
||||||
TerminalLineHeight::Standard => 1.3,
|
TerminalLineHeight::Standard => 1.3,
|
||||||
TerminalLineHeight::Custom(line_height) => f32::max(*line_height, 1.),
|
TerminalLineHeight::Custom(line_height) => f32::max(*line_height, 1.),
|
||||||
}
|
};
|
||||||
|
px(value).into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -49,6 +49,8 @@ impl ThemeColors {
|
||||||
tab_bar_background: neutral().light().step_2(),
|
tab_bar_background: neutral().light().step_2(),
|
||||||
tab_active_background: neutral().light().step_1(),
|
tab_active_background: neutral().light().step_1(),
|
||||||
tab_inactive_background: neutral().light().step_2(),
|
tab_inactive_background: neutral().light().step_2(),
|
||||||
|
search_match_background: neutral().light().step_2(), // todo!(this was inserted by Mikayla)
|
||||||
|
|
||||||
editor_background: neutral().light().step_1(),
|
editor_background: neutral().light().step_1(),
|
||||||
editor_gutter_background: neutral().light().step_1(), // todo!("pick the right colors")
|
editor_gutter_background: neutral().light().step_1(), // todo!("pick the right colors")
|
||||||
editor_subheader_background: neutral().light().step_2(),
|
editor_subheader_background: neutral().light().step_2(),
|
||||||
|
@ -121,6 +123,8 @@ impl ThemeColors {
|
||||||
tab_bar_background: neutral().dark().step_2(),
|
tab_bar_background: neutral().dark().step_2(),
|
||||||
tab_active_background: neutral().dark().step_1(),
|
tab_active_background: neutral().dark().step_1(),
|
||||||
tab_inactive_background: neutral().dark().step_2(),
|
tab_inactive_background: neutral().dark().step_2(),
|
||||||
|
search_match_background: neutral().dark().step_2(), // todo!(this was inserted by Mikayla)
|
||||||
|
|
||||||
editor_background: neutral().dark().step_1(),
|
editor_background: neutral().dark().step_1(),
|
||||||
editor_gutter_background: neutral().dark().step_1(),
|
editor_gutter_background: neutral().dark().step_1(),
|
||||||
editor_subheader_background: neutral().dark().step_3(),
|
editor_subheader_background: neutral().dark().step_3(),
|
||||||
|
|
|
@ -75,6 +75,8 @@ pub(crate) fn one_dark() -> Theme {
|
||||||
tab_bar_background: bg,
|
tab_bar_background: bg,
|
||||||
tab_inactive_background: bg,
|
tab_inactive_background: bg,
|
||||||
tab_active_background: editor,
|
tab_active_background: editor,
|
||||||
|
search_match_background: bg, // todo!(this was inserted by Mikayla)
|
||||||
|
|
||||||
editor_background: editor,
|
editor_background: editor,
|
||||||
editor_gutter_background: editor,
|
editor_gutter_background: editor,
|
||||||
editor_subheader_background: bg,
|
editor_subheader_background: bg,
|
||||||
|
@ -92,6 +94,7 @@ pub(crate) fn one_dark() -> Theme {
|
||||||
0.2,
|
0.2,
|
||||||
),
|
),
|
||||||
editor_document_highlight_write_background: gpui::red(),
|
editor_document_highlight_write_background: gpui::red(),
|
||||||
|
|
||||||
terminal_background: bg,
|
terminal_background: bg,
|
||||||
// todo!("Use one colors for terminal")
|
// todo!("Use one colors for terminal")
|
||||||
terminal_ansi_black: crate::black().dark().step_12(),
|
terminal_ansi_black: crate::black().dark().step_12(),
|
||||||
|
|
|
@ -114,6 +114,7 @@ pub struct ThemeColors {
|
||||||
pub tab_bar_background: Hsla,
|
pub tab_bar_background: Hsla,
|
||||||
pub tab_inactive_background: Hsla,
|
pub tab_inactive_background: Hsla,
|
||||||
pub tab_active_background: Hsla,
|
pub tab_active_background: Hsla,
|
||||||
|
pub search_match_background: Hsla,
|
||||||
// pub panel_background: Hsla,
|
// pub panel_background: Hsla,
|
||||||
// pub pane_focused_border: Hsla,
|
// pub pane_focused_border: Hsla,
|
||||||
// /// The color of the scrollbar thumb.
|
// /// The color of the scrollbar thumb.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue