Skip to content

fix plugin panel scroll bar#781

Merged
dzhou121 merged 1 commit intolapce:masterfrom
bbrabbitt:pluginscroll
Jul 16, 2022
Merged

fix plugin panel scroll bar#781
dzhou121 merged 1 commit intolapce:masterfrom
bbrabbitt:pluginscroll

Conversation

@bbrabbitt
Copy link
Copy Markdown
Contributor

@bbrabbitt bbrabbitt commented Jul 16, 2022

Try to fix #779

Use LapceScroll to wrap the original Plugin component.

@MinusGix MinusGix added the A-ui Area: UI rendering and interactions label Jul 16, 2022
@bbrabbitt
Copy link
Copy Markdown
Contributor Author

I've created a new commit to fix fmt and clippy warnings. Two commits are rebased for better git history.

@dzhou121
Copy link
Copy Markdown
Collaborator

You can simply wrap LapceScroll on Plugin itself I think.

@bbrabbitt
Copy link
Copy Markdown
Contributor Author

You can simply wrap LapceScroll on Plugin itself I think.

Theoretically yes but I don't know how to do it elegantly. So I imitate what file explorer did, using a wrapper to add LapceScroll to the plugin list.

@dzhou121
Copy link
Copy Markdown
Collaborator

Something like this

impl Plugin {
    pub fn new() -> Self {
        Self { line_height: 25.0 }
    }

    pub fn new_panel(data: &LapceTabData) -> LapcePanel {
        let split_id = WidgetId::next();
        LapcePanel::new(
            PanelKind::Plugin,
            data.plugin.widget_id,
            split_id,
            vec![(
                split_id,
                PanelHeaderKind::None,
                LapceScroll::new(Self::new()).boxed(),
                None,
            )],
        )
    }
}

@bbrabbitt
Copy link
Copy Markdown
Contributor Author

Thank you for your advice, I'll update the PR accordingly.

fix clippy and fmt warnings

code cleanup
@dzhou121
Copy link
Copy Markdown
Collaborator

Thanks!

@dzhou121 dzhou121 merged commit 81c4786 into lapce:master Jul 16, 2022
@bbrabbitt bbrabbitt deleted the pluginscroll branch July 16, 2022 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ui Area: UI rendering and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin panel doesn't scroll

3 participants