<commit_before>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.ui;

/**
 * Provides a simple style sheet that is useful for development and testing.
 */
public class SimpleStyles
{
    /**
     * Creates and returns a simple default stylesheet.
     */
    public static Stylesheet newSheet () {
        return newSheetBuilder().create();
    }

    /**
     * Creates and returns a stylesheet builder configured with some useful default styles. The
     * caller can augment the sheet with additional styles and call {@code create}.
     */
    public static Stylesheet.Builder newSheetBuilder () {
        int bgColor = 0xFFCCCCCC, ulColor = 0xFFEEEEEE, brColor = 0xFFAAAAAA;
        Background butBg = Background.roundRect(bgColor, 5, ulColor, 2).inset(5, 6, 2, 6);
        Background butSelBg = Background.roundRect(bgColor, 5, brColor, 2).inset(6, 5, 1, 7);
        return Stylesheet.builder().
            add(Button.class,
                Style.BACKGROUND.is(butBg)).
            add(Button.class, Style.Mode.SELECTED,
                Style.BACKGROUND.is(butSelBg)).
            add(ToggleButton.class,
                Style.BACKGROUND.is(butBg)).
            add(ToggleButton.class, Style.Mode.SELECTED,
                Style.BACKGROUND.is(butSelBg)).
            add(CheckBox.class,
                Style.BACKGROUND.is(Background.roundRect(bgColor, 5, ulColor, 2).inset(3, 2, 0, 3))).
            add(CheckBox.class, Style.Mode.SELECTED,
                Style.BACKGROUND.is(Background.roundRect(bgColor, 5, brColor, 2).inset(3, 2, 0, 3))).
            // flip ul and br to make Field appear recessed
            add(Field.class,
                Style.BACKGROUND.is(Background.beveled(0xFFFFFFFF, brColor, ulColor).inset(5))).
            add(Field.class, Style.Mode.DISABLED,
                Style.BACKGROUND.is(Background.beveled(0xFFCCCCCC, brColor, ulColor).inset(5)));
    }
}
<commit_msg>Default Field alignment left in simple styles.<commit_after>//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.ui;

/**
 * Provides a simple style sheet that is useful for development and testing.
 */
public class SimpleStyles
{
    /**
     * Creates and returns a simple default stylesheet.
     */
    public static Stylesheet newSheet () {
        return newSheetBuilder().create();
    }

    /**
     * Creates and returns a stylesheet builder configured with some useful default styles. The
     * caller can augment the sheet with additional styles and call {@code create}.
     */
    public static Stylesheet.Builder newSheetBuilder () {
        int bgColor = 0xFFCCCCCC, ulColor = 0xFFEEEEEE, brColor = 0xFFAAAAAA;
        Background butBg = Background.roundRect(bgColor, 5, ulColor, 2).inset(5, 6, 2, 6);
        Background butSelBg = Background.roundRect(bgColor, 5, brColor, 2).inset(6, 5, 1, 7);
        return Stylesheet.builder().
            add(Button.class,
                Style.BACKGROUND.is(butBg)).
            add(Button.class, Style.Mode.SELECTED,
                Style.BACKGROUND.is(butSelBg)).
            add(ToggleButton.class,
                Style.BACKGROUND.is(butBg)).
            add(ToggleButton.class, Style.Mode.SELECTED,
                Style.BACKGROUND.is(butSelBg)).
            add(CheckBox.class,
                Style.BACKGROUND.is(Background.roundRect(bgColor, 5, ulColor, 2).inset(3, 2, 0, 3))).
            add(CheckBox.class, Style.Mode.SELECTED,
                Style.BACKGROUND.is(Background.roundRect(bgColor, 5, brColor, 2).inset(3, 2, 0, 3))).
            // flip ul and br to make Field appear recessed
            add(Field.class,
                Style.BACKGROUND.is(Background.beveled(0xFFFFFFFF, brColor, ulColor).inset(5)),
                Style.HALIGN.left).
            add(Field.class, Style.Mode.DISABLED,
                Style.BACKGROUND.is(Background.beveled(0xFFCCCCCC, brColor, ulColor).inset(5)));
    }
}

{'fraction_non_alphanumeric': 0.1142313184198001, 'fraction_numerical': 0.016658733936220846, 'mean_word_length': 2.431020408163265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3308062', 'n_tokens_mistral': 1328, 'n_tokens_neox': 1193, 'n_words': 309}