Reapply "ui: Account for padding of parent container during scrollbar layout" (#30577)
This PR reapplies #27402 which was reverted in https://github.com/zed-industries/zed/pull/30544 due to the issue @ConradIrwin reported in https://github.com/zed-industries/zed/pull/27402#issuecomment-2871745132. The reported issue is already present on main but not visible, see https://github.com/zed-industries/zed/pull/27402#issuecomment-2872546903 for more context and reproduction steps. The fix here was to move the padding for the hover popover up to the parent container. This does not fix the underlying problem but serves as workaround without any disadvantages until a better solution is found. I would currently guess that the underlying issue might be related to some rem-size calculations for small font sizes or something similar (e.g. https://github.com/zed-industries/zed/pull/22732 could possibly be somewhat related). Notably, the fix here does not cause any difference in layouting (the following screenshots are actually distinct images), yet fixes the problem at hand. ### Default font size (`15px`) | `main` | This PR | | --- | --- | |  | | ### Smaller font size (`12px`) | `main` | This PR | | --- | --- | |  |  | Furthermore, for the second scenario, the popover would be scrollable on main. As there is no scrollbar in the second image for this PR, this no longer happens with this branch. Release Notes: - N/A
This commit is contained in:
parent
ea5b289459
commit
4280bff10a
5 changed files with 126 additions and 204 deletions
|
@ -2671,11 +2671,7 @@ impl Pane {
|
|||
}
|
||||
})
|
||||
.children(pinned_tabs.len().ne(&0).then(|| {
|
||||
let content_width = self
|
||||
.tab_bar_scroll_handle
|
||||
.content_size()
|
||||
.map(|content_size| content_size.size.width)
|
||||
.unwrap_or(px(0.));
|
||||
let content_width = self.tab_bar_scroll_handle.content_size().width;
|
||||
let viewport_width = self.tab_bar_scroll_handle.viewport().size.width;
|
||||
// We need to check both because offset returns delta values even when the scroll handle is not scrollable
|
||||
let is_scrollable = content_width > viewport_width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue