Nez.Portable/UI/Skin.cs
/// <summary>
/// creates a default Skin that can be used for quick mockups. Includes button, textu button, checkbox, progress bar and slider styles.
/// </summary>
/// <returns>The default skin.</returns>
creates a default Skin that can be used for quick mockups. Includes button, textu button, checkbox, progress bar and slider styles.
creates a default Skin that can be used for quick mockups . Includes button textu button checkbox progress bar and slider styles .
public static Skin createDefaultSkin()
        {
            var skin = new Skin();
            var buttonColor = new Color(78, 91, 98);
            var buttonOver = new Color(168, 207, 115);
            var buttonDown = new Color(244, 23, 135);
            var overFontColor = new Color(85, 127, 27);
            var downFontColor = new Color(255, 255, 255);
            var checkedOverFontColor = new Color(247, 217, 222);
            var checkboxOn = new Color(168, 207, 115);
            var checkboxOff = new Color(63, 63, 63);
            var checkboxOver = new Color(130, 130, 130);
            var checkboxOverFontColor = new Color(220, 220, 220);
            var barBg = new Color(78, 91, 98);
            var barKnob = new Color(25, 144, 188);
            var barKnobOver = new Color(168, 207, 115);
            var barKnobDown = new Color(244, 23, 135);
            var windowColor = new Color(17, 17, 17);
            var textFieldFontColor = new Color(220, 220, 220);
            var textFieldCursorColor = new Color(83, 170, 116);
            var textFieldSelectionColor = new Color(180, 52, 166);
            var textFieldBackgroundColor = new Color(22, 22, 22);
            var scrollPaneScrollBarColor = new Color(44, 44, 44);
            var scrollPaneKnobColor = new Color(241, 156, 0);
            var listBoxBackgroundColor = new Color(20, 20, 20);
            var listBoxSelectionColor = new Color(241, 156, 0);
            var listBoxHoverSelectionColor = new Color(120, 78, 0);
            var selectBoxBackgroundColor = new Color(10, 10, 10);
            var buttonStyle = new ButtonStyle
                                  {
                                      up = new PrimitiveDrawable(buttonColor, 10),
                                      over = new PrimitiveDrawable(buttonOver),
                                      down = new PrimitiveDrawable(buttonDown)
                                  };
            skin.add("default", buttonStyle);
            var textButtonStyle = new TextButtonStyle
                                      {
                                          up = new PrimitiveDrawable(buttonColor, 6, 2),
                                          over = new PrimitiveDrawable(buttonOver),
                                          down = new PrimitiveDrawable(buttonDown),
                                          overFontColor = overFontColor,
                                          downFontColor = downFontColor,
                                          pressedOffsetX = 1,
                                          pressedOffsetY = 1
                                      };
            skin.add("default", textButtonStyle);
            var toggleButtonStyle = new TextButtonStyle
                                        {
                                            up = new PrimitiveDrawable(buttonColor, 10, 5),
                                            over = new PrimitiveDrawable(buttonOver),
                                            down = new PrimitiveDrawable(buttonDown),
                                            checkked = new PrimitiveDrawable(new Color(255, 0, 0, 255)),
                                            checkedOverFontColor = checkedOverFontColor,
                                            overFontColor = overFontColor,
                                            downFontColor = downFontColor,
                                            pressedOffsetX = 1,
                                            pressedOffsetY = 1
                                        };
            skin.add("toggle", toggleButtonStyle);
            var checkboxStyle = new CheckBoxStyle
                                    {
                                        checkboxOn = new PrimitiveDrawable(30, checkboxOn),
                                        checkboxOff = new PrimitiveDrawable(30, checkboxOff),
                                        checkboxOver = new PrimitiveDrawable(30, checkboxOver),
                                        overFontColor = checkboxOverFontColor,
                                        downFontColor = downFontColor,
                                        pressedOffsetX = 1,
                                        pressedOffsetY = 1
                                    };
            skin.add("default", checkboxStyle);
            var progressBarStyle = new ProgressBarStyle
                                       {
                                           background = new PrimitiveDrawable(14, barBg),
                                           knobBefore = new PrimitiveDrawable(14, barKnobOver)
                                       };
            skin.add("default", progressBarStyle);
            var sliderStyle = new SliderStyle
                                  {
                                      background = new PrimitiveDrawable(6, barBg),
                                      knob = new PrimitiveDrawable(14, barKnob),
                                      knobOver = new PrimitiveDrawable(14, barKnobOver),
                                      knobDown = new PrimitiveDrawable(14, barKnobDown)
                                  };
            skin.add("default", sliderStyle);
            var windowStyle = new WindowStyle { background = new PrimitiveDrawable(windowColor) };
            skin.add("default", windowStyle);
            var textFieldStyle = TextFieldStyle.create(
                textFieldFontColor,
                textFieldCursorColor,
                textFieldSelectionColor,
                textFieldBackgroundColor);
            skin.add("default", textFieldStyle);
            var labelStyle = new LabelStyle();
            skin.add("default", labelStyle);
            var scrollPaneStyle = new ScrollPaneStyle
                                      {
                                          vScroll =
                                              new PrimitiveDrawable(6, 0, scrollPaneScrollBarColor),
                                          vScrollKnob =
                                              new PrimitiveDrawable(6, 50, scrollPaneKnobColor),
                                          hScroll = new PrimitiveDrawable(
                                              0,
                                              6,
                                              scrollPaneScrollBarColor),
                                          hScrollKnob = new PrimitiveDrawable(
                                              50,
                                              6,
                                              scrollPaneKnobColor)
                                      };
            skin.add("default", scrollPaneStyle);
            var listBoxStyle = new ListBoxStyle
                                   {
                                       fontColorHovered = new Color(255, 255, 255),
                                       selection = new PrimitiveDrawable(listBoxSelectionColor, 5, 5),
                                       hoverSelection =
                                           new PrimitiveDrawable(listBoxHoverSelectionColor, 5, 5),
                                       background = new PrimitiveDrawable(listBoxBackgroundColor)
                                   };
            skin.add("default", listBoxStyle);
            var selectBoxStyle = new SelectBoxStyle
                                     {
                                         listStyle = listBoxStyle,
                                         scrollStyle = scrollPaneStyle,
                                         background = new PrimitiveDrawable(
                                             selectBoxBackgroundColor,
                                             4,
                                             4)
                                     };
            skin.add("default", selectBoxStyle);
            var textTooltipStyle = new TextTooltipStyle
                                       {
                                           labelStyle = new LabelStyle(listBoxBackgroundColor),
                                           background = new PrimitiveDrawable(checkboxOn, 4, 2)
                                       };
            skin.add("default", textTooltipStyle);
            return skin;
        }
public static Skin createDefaultSkin ( ) { var skin = new Skin ( ) ; var buttonColor = new Color ( 78 , 91 , 98 ) ; var buttonOver = new Color ( 168 , 207 , 115 ) ; var buttonDown = new Color ( 244 , 23 , 135 ) ; var overFontColor = new Color ( 85 , 127 , 27 ) ; var downFontColor = new Color ( 255 , 255 , 255 ) ; var checkedOverFontColor = new Color ( 247 , 217 , 222 ) ; var checkboxOn = new Color ( 168 , 207 , 115 ) ; var checkboxOff = new Color ( 63 , 63 , 63 ) ; var checkboxOver = new Color ( 130 , 130 , 130 ) ; var checkboxOverFontColor = new Color ( 220 , 220 , 220 ) ; var barBg = new Color ( 78 , 91 , 98 ) ; var barKnob = new Color ( 25 , 144 , 188 ) ; var barKnobOver = new Color ( 168 , 207 , 115 ) ; var barKnobDown = new Color ( 244 , 23 , 135 ) ; var windowColor = new Color ( 17 , 17 , 17 ) ; var textFieldFontColor = new Color ( 220 , 220 , 220 ) ; var textFieldCursorColor = new Color ( 83 , 170 , 116 ) ; var textFieldSelectionColor = new Color ( 180 , 52 , 166 ) ; var textFieldBackgroundColor = new Color ( 22 , 22 , 22 ) ; var scrollPaneScrollBarColor = new Color ( 44 , 44 , 44 ) ; var scrollPaneKnobColor = new Color ( 241 , 156 , 0 ) ; var listBoxBackgroundColor = new Color ( 20 , 20 , 20 ) ; var listBoxSelectionColor = new Color ( 241 , 156 , 0 ) ; var listBoxHoverSelectionColor = new Color ( 120 , 78 , 0 ) ; var selectBoxBackgroundColor = new Color ( 10 , 10 , 10 ) ; var buttonStyle = new ButtonStyle { up = new PrimitiveDrawable ( buttonColor , 10 ) , over = new PrimitiveDrawable ( buttonOver ) , down = new PrimitiveDrawable ( buttonDown ) } ; skin . add ( " " , buttonStyle ) ; var textButtonStyle = new TextButtonStyle { up = new PrimitiveDrawable ( buttonColor , 6 , 2 ) , over = new PrimitiveDrawable ( buttonOver ) , down = new PrimitiveDrawable ( buttonDown ) , overFontColor = overFontColor , downFontColor = downFontColor , pressedOffsetX = 1 , pressedOffsetY = 1 } ; skin . add ( " " , textButtonStyle ) ; var toggleButtonStyle = new TextButtonStyle { up = new PrimitiveDrawable ( buttonColor , 10 , 5 ) , over = new PrimitiveDrawable ( buttonOver ) , down = new PrimitiveDrawable ( buttonDown ) , checkked = new PrimitiveDrawable ( new Color ( 255 , 0 , 0 , 255 ) ) , checkedOverFontColor = checkedOverFontColor , overFontColor = overFontColor , downFontColor = downFontColor , pressedOffsetX = 1 , pressedOffsetY = 1 } ; skin . add ( " " , toggleButtonStyle ) ; var checkboxStyle = new CheckBoxStyle { checkboxOn = new PrimitiveDrawable ( 30 , checkboxOn ) , checkboxOff = new PrimitiveDrawable ( 30 , checkboxOff ) , checkboxOver = new PrimitiveDrawable ( 30 , checkboxOver ) , overFontColor = checkboxOverFontColor , downFontColor = downFontColor , pressedOffsetX = 1 , pressedOffsetY = 1 } ; skin . add ( " " , checkboxStyle ) ; var progressBarStyle = new ProgressBarStyle { background = new PrimitiveDrawable ( 14 , barBg ) , knobBefore = new PrimitiveDrawable ( 14 , barKnobOver ) } ; skin . add ( " " , progressBarStyle ) ; var sliderStyle = new SliderStyle { background = new PrimitiveDrawable ( 6 , barBg ) , knob = new PrimitiveDrawable ( 14 , barKnob ) , knobOver = new PrimitiveDrawable ( 14 , barKnobOver ) , knobDown = new PrimitiveDrawable ( 14 , barKnobDown ) } ; skin . add ( " " , sliderStyle ) ; var windowStyle = new WindowStyle { background = new PrimitiveDrawable ( windowColor ) } ; skin . add ( " " , windowStyle ) ; var textFieldStyle = TextFieldStyle . create ( textFieldFontColor , textFieldCursorColor , textFieldSelectionColor , textFieldBackgroundColor ) ; skin . add ( " " , textFieldStyle ) ; var labelStyle = new LabelStyle ( ) ; skin . add ( " " , labelStyle ) ; var scrollPaneStyle = new ScrollPaneStyle { vScroll = new PrimitiveDrawable ( 6 , 0 , scrollPaneScrollBarColor ) , vScrollKnob = new PrimitiveDrawable ( 6 , 50 , scrollPaneKnobColor ) , hScroll = new PrimitiveDrawable ( 0 , 6 , scrollPaneScrollBarColor ) , hScrollKnob = new PrimitiveDrawable ( 50 , 6 , scrollPaneKnobColor ) } ; skin . add ( " " , scrollPaneStyle ) ; var listBoxStyle = new ListBoxStyle { fontColorHovered = new Color ( 255 , 255 , 255 ) , selection = new PrimitiveDrawable ( listBoxSelectionColor , 5 , 5 ) , hoverSelection = new PrimitiveDrawable ( listBoxHoverSelectionColor , 5 , 5 ) , background = new PrimitiveDrawable ( listBoxBackgroundColor ) } ; skin . add ( " " , listBoxStyle ) ; var selectBoxStyle = new SelectBoxStyle { listStyle = listBoxStyle , scrollStyle = scrollPaneStyle , background = new PrimitiveDrawable ( selectBoxBackgroundColor , 4 , 4 ) } ; skin . add ( " " , selectBoxStyle ) ; var textTooltipStyle = new TextTooltipStyle { labelStyle = new LabelStyle ( listBoxBackgroundColor ) , background = new PrimitiveDrawable ( checkboxOn , 4 , 2 ) } ; skin . add ( " " , textTooltipStyle ) ; return skin ; }
creates a default Skin that can be used for quick mockups.
creates a default Skin that can be used for quick mockups .
// define our colors // add all our styles
The default skin.
The default skin .