Compare commits

...
Sign in to create a new pull request.

6 commits

Author SHA1 Message Date
Joseph Lyons
176d576ecc v0.79.x stable 2023-03-29 14:12:35 -04:00
Mikayla Maki
aa5b89b55c zed 0.79.1 2023-03-23 13:37:24 -07:00
Mikayla Maki
0241e51fb2 Merge pull request #2318 from zed-industries/fix-unknown-in-non-editor-buffers
changed language status bar item to only show on editors
2023-03-23 13:34:40 -07:00
Mikayla Maki
1a277e97c1 Merge pull request #2317 from zed-industries/fix-titlebar-right-spacing
Fix misaligned UI in the right titlebar
2023-03-23 13:19:49 -07:00
Mikayla Maki
588926e16b Merge pull request #2315 from zed-industries/fix-fold-indicator-offsets
Fix fold indicator offsets
2023-03-23 13:19:39 -07:00
Joseph Lyons
63b9c5576a v0.79.x preview 2023-03-22 16:30:12 -04:00
7 changed files with 40 additions and 29 deletions

2
Cargo.lock generated
View file

@ -8436,7 +8436,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
[[package]]
name = "zed"
version = "0.79.0"
version = "0.79.1"
dependencies = [
"activity_indicator",
"anyhow",

View file

@ -89,7 +89,7 @@ impl View for CollabTitlebarItem {
let theme = cx.global::<Settings>().theme.clone();
let mut left_container = Flex::row();
let mut right_container = Flex::row();
let mut right_container = Flex::row().align_children_center();
left_container.add_child(
Label::new(project_title, theme.workspace.titlebar.title.clone())
@ -117,6 +117,7 @@ impl View for CollabTitlebarItem {
let status = workspace.read(cx).client().status();
let status = &*status.borrow();
if matches!(status, client::Status::Connected { .. }) {
right_container.add_child(self.render_toggle_contacts_button(&theme, cx));
right_container.add_child(self.render_user_menu_button(&theme, cx));

View file

@ -576,13 +576,16 @@ impl EditorElement {
for (ix, fold_indicator) in layout.fold_indicators.iter_mut().enumerate() {
if let Some(indicator) = fold_indicator.as_mut() {
let mut x = bounds.width() - layout.gutter_padding;
let mut y = ix as f32 * line_height - scroll_top;
let position = vec2f(
bounds.width() - layout.gutter_padding,
ix as f32 * line_height - (scroll_top % line_height),
);
let centering_offset = vec2f(
(layout.gutter_padding + layout.gutter_margin - indicator.size().x()) / 2.,
(line_height - indicator.size().y()) / 2.,
);
x += ((layout.gutter_padding + layout.gutter_margin) - indicator.size().x()) / 2.;
y += (line_height - indicator.size().y()) / 2.;
let indicator_origin = bounds.origin() + vec2f(x, y);
let indicator_origin = bounds.origin() + position + centering_offset;
indicator.paint(indicator_origin, visible_bounds, cx);
}

View file

@ -8,7 +8,7 @@ use std::sync::Arc;
use workspace::{item::ItemHandle, StatusItemView};
pub struct ActiveBufferLanguage {
active_language: Option<Arc<str>>,
active_language: Option<Option<Arc<str>>>,
_observe_active_editor: Option<Subscription>,
}
@ -27,12 +27,12 @@ impl ActiveBufferLanguage {
}
fn update_language(&mut self, editor: ViewHandle<Editor>, cx: &mut ViewContext<Self>) {
self.active_language.take();
self.active_language = Some(None);
let editor = editor.read(cx);
if let Some((_, buffer, _)) = editor.active_excerpt(cx) {
if let Some(language) = buffer.read(cx).language() {
self.active_language = Some(language.name());
self.active_language = Some(Some(language.name()));
}
}
@ -50,23 +50,27 @@ impl View for ActiveBufferLanguage {
}
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
let active_language = if let Some(active_language) = self.active_language.as_ref() {
active_language.to_string()
} else {
"Unknown".to_string()
};
if let Some(active_language) = self.active_language.as_ref() {
let active_language_text = if let Some(active_language_text) = active_language {
active_language_text.to_string()
} else {
"Unknown".to_string()
};
MouseEventHandler::<Self>::new(0, cx, |state, cx| {
let theme = &cx.global::<Settings>().theme.workspace.status_bar;
let style = theme.active_language.style_for(state, false);
Label::new(active_language, style.text.clone())
.contained()
.with_style(style.container)
.boxed()
})
.with_cursor_style(CursorStyle::PointingHand)
.on_click(MouseButton::Left, |_, cx| cx.dispatch_action(crate::Toggle))
.boxed()
MouseEventHandler::<Self>::new(0, cx, |state, cx| {
let theme = &cx.global::<Settings>().theme.workspace.status_bar;
let style = theme.active_language.style_for(state, false);
Label::new(active_language_text, style.text.clone())
.contained()
.with_style(style.container)
.boxed()
})
.with_cursor_style(CursorStyle::PointingHand)
.on_click(MouseButton::Left, |_, cx| cx.dispatch_action(crate::Toggle))
.boxed()
} else {
Empty::new().boxed()
}
}
}

View file

@ -3,7 +3,7 @@ authors = ["Nathan Sobo <nathansobo@gmail.com>"]
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.79.0"
version = "0.79.1"
publish = false
[lib]

View file

@ -1 +1 @@
dev
stable

View file

@ -174,6 +174,9 @@ export default function workspace(colorScheme: ColorScheme) {
// Sign in buttom
// FlatButton, Variant
signInPrompt: {
margin: {
left: itemSpacing
},
...titlebarButton,
},