workspace: Fix read-only button tooltip for non-toggleable buffers (#48998)

Lukas Wirth created

Release Notes:

- Fixed an incorrect hover label for read-only file lock buttons

Change summary

crates/gpui/src/platform/windows/directx_renderer.rs |  2 +-
crates/workspace/src/pane.rs                         | 11 ++++++++++-
crates/worktree/src/worktree.rs                      |  2 +-
3 files changed, 12 insertions(+), 3 deletions(-)

Detailed changes

crates/gpui/src/platform/windows/directx_renderer.rs 🔗

@@ -1016,7 +1016,7 @@ impl<T> PipelineState<T> {
     ) -> Result<()> {
         if self.buffer_size < data.len() {
             let new_buffer_size = data.len().next_power_of_two();
-            log::info!(
+            log::debug!(
                 "Updating {} buffer size from {} to {}",
                 self.label,
                 self.buffer_size,

crates/workspace/src/pane.rs 🔗

@@ -2802,7 +2802,16 @@ impl Pane {
                 .icon_size(IconSize::Small)
                 .disabled(!toggleable)
                 .tooltip(move |_, cx| {
-                    Tooltip::with_meta("Unlock File", None, "This will make this file editable", cx)
+                    if toggleable {
+                        Tooltip::with_meta(
+                            "Unlock File",
+                            None,
+                            "This will make this file editable",
+                            cx,
+                        )
+                    } else {
+                        Tooltip::with_meta("Locked File", None, "This file is read-only", cx)
+                    }
                 })
                 .on_click(cx.listener(move |pane, _, window, cx| {
                     if let Some(item) = pane.item_for_index(ix) {

crates/worktree/src/worktree.rs 🔗

@@ -4469,7 +4469,7 @@ impl BackgroundScanner {
                 Ok(Some(metadata)) => metadata,
                 Ok(None) => continue,
                 Err(err) => {
-                    log::error!("error processing {child_abs_path:?}: {err:#}");
+                    log::error!("error processing {:?}: {err:#}", child_abs_path.display());
                     continue;
                 }
             };