Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-draggable? (Feature request) #31

Closed
CjPhoenix opened this issue Apr 19, 2022 · 1 comment
Closed

Non-draggable? (Feature request) #31

CjPhoenix opened this issue Apr 19, 2022 · 1 comment

Comments

@CjPhoenix
Copy link

I am not aware of any way to modify the panels so that they aren't draggable... any chance you could add this functionality? If not, how would I go about doing this myself?

@lukflug
Copy link
Owner

lukflug commented Apr 20, 2022

There is a way to make them not Draggable.
Which is through modifying the IComponentAdder instance.
I assume you're using the PanelAdder, in which case you can override a method:

@Override
public <S extends IComponent,T extends IComponent> void addComponent (S title, T content, ThemeTuple theme, Point position, int width, Supplier<Animation> animation) {
	AnimatedToggleable toggle=new AnimatedToggleable(new SimpleToggleable(open),animation.get());
	RendererTuple<Void> renderer=new RendererTuple<Void>(Void.class,theme);
	IResizable size=getResizable(width);
	ClosableComponent<S,ScrollBarComponent<Supplier<Void>,T>> panel=ClosableComponent.createScrollableComponent(title,content,()->null,toggle,renderer,getScrollSize(size),false);
	container.addComponent(new FixedComponent(panel,position,width,panel.getCollapsible().getToggle(),true,configName.apply(content.getTitle()));,isVisible);
}

I hope I didn't make any typing mistake

@lukflug lukflug closed this as completed Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants