Esempio n. 1
0
        /// <summary>
        /// Perform rendering before child elements are rendered.
        /// </summary>
        /// <param name="context">Rendering context.</param>
        public override void RenderBefore(RenderContext context)
        {
            if (Draw)
            {
                RectangleF rectF = new(ClientLocation.X, ClientLocation.Y - 0.5f, ClientWidth, ClientHeight + 1);
                using LinearGradientBrush sepBrush = new(rectF, Color.Transparent, _palette.GetRibbonTabSeparatorColor(PaletteState.Normal), 90f);
                sepBrush.Blend = _fadeBlend;

                switch (_palette.GetRibbonShape())
                {
                default:
                case PaletteRibbonShape.Office2007:
                case PaletteRibbonShape.Office2013:
                    context.Graphics.FillRectangle(sepBrush, ClientLocation.X + 2, ClientLocation.Y, 1, ClientHeight - 1);
                    break;

                case PaletteRibbonShape.Office365:
                    context.Graphics.FillRectangle(sepBrush, ClientLocation.X + 2, ClientLocation.Y, 1, ClientHeight - 1);
                    break;

                case PaletteRibbonShape.Office2010:
                    context.Graphics.FillRectangle(sepBrush, ClientLocation.X + 1, ClientLocation.Y, 1, ClientHeight - 1);

                    using (LinearGradientBrush sepLightBrush = new(rectF, Color.Transparent, _lighten1, 90f))
                    {
                        context.Graphics.FillRectangle(sepLightBrush, ClientLocation.X + 2, ClientLocation.Y, 1, ClientHeight - 1);
                    }
                    break;
                }
            }
        }
 /// <summary>
 /// Gets the color for the tab separator.
 /// </summary>
 /// <param name="state">Palette value should be applicable to this state.</param>
 /// <returns>Color value.</returns>
 public Color GetRibbonTabSeparatorColor(PaletteState state)
 {
     if (TabSeparatorColor != Color.Empty)
     {
         return(TabSeparatorColor);
     }
     else
     {
         return(_inherit.GetRibbonTabSeparatorColor(state));
     }
 }
        /// <summary>
        /// Gets the color for the tab separator.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public override Color GetRibbonTabSeparatorColor(PaletteState state)
        {
            IPaletteRibbonGeneral inherit = GetInherit(state);

            if (inherit != null)
            {
                return(inherit.GetRibbonTabSeparatorColor(state));
            }
            else
            {
                return(Target.GetRibbonTabSeparatorColor(state));
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Gets the color for the tab separator.
        /// </summary>
        /// <param name="state">Palette value should be applicable to this state.</param>
        /// <returns>Color value.</returns>
        public override Color GetRibbonTabSeparatorColor(PaletteState state)
        {
            IPaletteRibbonGeneral inherit = GetInherit(state);

            return(inherit?.GetRibbonTabSeparatorColor(state) ?? Target.GetRibbonTabSeparatorColor(state));
        }