Exemple #1
0
        public HairStylePicker()
        {
            var vBox = new VBoxContainer();

            AddChild(vBox);

            vBox.AddChild(_colorSliderR = new ColorSlider(NanoStyle.StyleClassSliderRed));
            vBox.AddChild(_colorSliderG = new ColorSlider(NanoStyle.StyleClassSliderGreen));
            vBox.AddChild(_colorSliderB = new ColorSlider(NanoStyle.StyleClassSliderBlue));

            Action colorValueChanged = ColorValueChanged;

            _colorSliderR.OnValueChanged += colorValueChanged;
            _colorSliderG.OnValueChanged += colorValueChanged;
            _colorSliderB.OnValueChanged += colorValueChanged;

            Items = new ItemList
            {
                SizeFlagsVertical = SizeFlags.FillExpand,
            };
            vBox.AddChild(Items);
            Items.OnItemSelected += ItemSelected;
        }
Exemple #2
0
        public HairStylePicker()
        {
            var vBox = new VBoxContainer();

            AddChild(vBox);

            vBox.AddChild(_colorSliderR = new ColorSlider(StyleNano.StyleClassSliderRed));
            vBox.AddChild(_colorSliderG = new ColorSlider(StyleNano.StyleClassSliderGreen));
            vBox.AddChild(_colorSliderB = new ColorSlider(StyleNano.StyleClassSliderBlue));

            Action colorValueChanged = ColorValueChanged;

            _colorSliderR.OnValueChanged += colorValueChanged;
            _colorSliderG.OnValueChanged += colorValueChanged;
            _colorSliderB.OnValueChanged += colorValueChanged;

            Items = new ItemList
            {
                VerticalExpand = true,
                MinSize        = (300, 250)
            };
            vBox.AddChild(Items);
            Items.OnItemSelected += ItemSelected;
        }