debugger: Add horizontal scroll bars to variable list, memory view, and breakpoint list (#41594)
Closes #40360 This PR added heuristics to determine what variable/breakpoint list entry has the longest width when rendered. I added this in so the uniform list would correctly determine which item has the longest width and use that to calculate the scrollbar size. The heuristic can be off if a non-mono space font is used in the UI; in most cases, it's more than accurate enough though. Release Notes: - debugger: Add horizontal scroll bars to variable list, memory view, and breakpoint list --------- Co-authored-by: MrSubidubi <dev@bahn.sh>
This commit is contained in:
co-authored by
MrSubidubi
parent
3944234bab
commit
44e5a962e6
@@ -392,7 +392,7 @@ pub struct Scrollbars<T: ScrollableHandle = ScrollHandle> {
|
||||
|
||||
impl Scrollbars {
|
||||
pub fn new(show_along: ScrollAxes) -> Self {
|
||||
Self::new_with_setting(show_along, |_| ShowScrollbar::default())
|
||||
Self::new_with_setting(show_along, |_| ShowScrollbar::Always)
|
||||
}
|
||||
|
||||
pub fn for_settings<S: ScrollbarVisibility>() -> Scrollbars {
|
||||
|
||||
@@ -144,6 +144,19 @@ impl TextSize {
|
||||
Self::Editor => rems_from_px(theme_settings.buffer_font_size(cx)),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pixels(self, cx: &App) -> Pixels {
|
||||
let theme_settings = ThemeSettings::get_global(cx);
|
||||
|
||||
match self {
|
||||
Self::Large => px(16.),
|
||||
Self::Default => px(14.),
|
||||
Self::Small => px(12.),
|
||||
Self::XSmall => px(10.),
|
||||
Self::Ui => theme_settings.ui_font_size(cx),
|
||||
Self::Editor => theme_settings.buffer_font_size(cx),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The size of a [`Headline`] element
|
||||
|
||||
Reference in New Issue
Block a user