Search in sources :

Example 1 with VisImageTextButton

use of com.kotcrab.vis.ui.widget.VisImageTextButton in project vis-ui by kotcrab.

the class TestGenerateDisabledImage method addVisWidgets.

private void addVisWidgets() {
    Drawable icon = VisUI.getSkin().getDrawable("icon-folder");
    VisImageButton normal = new VisImageButton(icon);
    VisImageButton disabled = new VisImageButton(icon);
    disabled.setGenerateDisabledImage(true);
    disabled.setDisabled(true);
    add(new VisLabel("VisImageButton normal"));
    add(normal).row();
    add(new VisLabel("VisImageButton disabled"));
    add(disabled).row();
    VisImageTextButton normalText = new VisImageTextButton("text", icon);
    VisImageTextButton disabledText = new VisImageTextButton("text", icon);
    disabledText.setGenerateDisabledImage(true);
    disabledText.setDisabled(true);
    add(new VisLabel("VisImageTextButton normal"));
    add(normalText).row();
    add(new VisLabel("VisImageTextButton disabled"));
    add(disabledText).padBottom(3f).row();
}
Also used : VisImageButton(com.kotcrab.vis.ui.widget.VisImageButton) VisImageTextButton(com.kotcrab.vis.ui.widget.VisImageTextButton) Drawable(com.badlogic.gdx.scenes.scene2d.utils.Drawable) VisLabel(com.kotcrab.vis.ui.widget.VisLabel)

Example 2 with VisImageTextButton

use of com.kotcrab.vis.ui.widget.VisImageTextButton in project HyperLap2D by rednblackgames.

the class UICompositeHierarchy method addItem.

public void addItem(String name, Integer id, boolean isRoot) {
    String classType = "hierarchy-item";
    if (isRoot)
        classType += "-root";
    VisImageTextButton button = StandardWidgetsFactory.createImageTextButton(name, classType);
    button.getLabelCell().padLeft(3);
    button.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            facade.sendNotification(SWITCH_VIEW_COMPOSITE_CLICKED, id);
        }
    });
    button.padLeft(5).padRight(3);
    if (!isRoot)
        mainGroup.addActor(new Image(VisUI.getSkin(), "hierarchy-separator"));
    else
        button.padLeft(10);
    mainGroup.addActor(button);
}
Also used : VisImageTextButton(com.kotcrab.vis.ui.widget.VisImageTextButton) InputEvent(com.badlogic.gdx.scenes.scene2d.InputEvent) Image(com.badlogic.gdx.scenes.scene2d.ui.Image) ClickListener(com.badlogic.gdx.scenes.scene2d.utils.ClickListener)

Aggregations

VisImageTextButton (com.kotcrab.vis.ui.widget.VisImageTextButton)2 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 Drawable (com.badlogic.gdx.scenes.scene2d.utils.Drawable)1 VisImageButton (com.kotcrab.vis.ui.widget.VisImageButton)1 VisLabel (com.kotcrab.vis.ui.widget.VisLabel)1