Add image dimension and file size information (#21675)
Closes https://github.com/zed-industries/zed/issues/21281 @jansol, kindly take a look when you're free.  Release Notes: - Added dimensions and file size information for images. --------- Co-authored-by: tims <0xtimsb@gmail.com> Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
parent
a1ed1a00b3
commit
d6d0d7d3e4
10 changed files with 312 additions and 10 deletions
|
@ -26,6 +26,7 @@ use gpui::{
|
|||
Entity, Focusable, KeyBinding, MenuItem, ParentElement, PathPromptOptions, PromptLevel,
|
||||
ReadGlobal, SharedString, Styled, Task, TitlebarOptions, Window, WindowKind, WindowOptions,
|
||||
};
|
||||
use image_viewer::ImageInfo;
|
||||
pub use open_listener::*;
|
||||
use outline_panel::OutlinePanel;
|
||||
use paths::{local_settings_file_relative_path, local_tasks_file_relative_path};
|
||||
|
@ -201,6 +202,7 @@ pub fn initialize_workspace(
|
|||
let active_toolchain_language =
|
||||
cx.new(|cx| toolchain_selector::ActiveToolchain::new(workspace, window, cx));
|
||||
let vim_mode_indicator = cx.new(|cx| vim::ModeIndicator::new(window, cx));
|
||||
let image_info = cx.new(|_cx| ImageInfo::new(workspace));
|
||||
let cursor_position =
|
||||
cx.new(|_| go_to_line::cursor_position::CursorPosition::new(workspace));
|
||||
workspace.status_bar().update(cx, |status_bar, cx| {
|
||||
|
@ -211,6 +213,7 @@ pub fn initialize_workspace(
|
|||
status_bar.add_right_item(active_toolchain_language, window, cx);
|
||||
status_bar.add_right_item(vim_mode_indicator, window, cx);
|
||||
status_bar.add_right_item(cursor_position, window, cx);
|
||||
status_bar.add_right_item(image_info, window, cx);
|
||||
});
|
||||
|
||||
let handle = cx.entity().downgrade();
|
||||
|
@ -4053,6 +4056,7 @@ mod tests {
|
|||
app_state.client.http_client().clone(),
|
||||
cx,
|
||||
);
|
||||
image_viewer::init(cx);
|
||||
language_model::init(cx);
|
||||
language_models::init(
|
||||
app_state.user_store.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue