public static TabStyleProvider CreateProvider(FXTabControl tabControl) { TabStyleProvider provider; // Depending on the display style of the tabControl generate an appropriate provider. switch (tabControl.DisplayStyle) { case TabStyle.None: provider = new TabStyleProvider(tabControl); break; case TabStyle.Default: provider = new TabStyleDefaultProvider(tabControl); break; case TabStyle.Rounded: provider = new TabStyleRoundedProvider(tabControl); break; case TabStyle.FX: provider = new FXTabStyleProvider(tabControl); break; default: provider = new TabStyleDefaultProvider(tabControl); break; } provider.style = tabControl.DisplayStyle; return(provider); }
public FXTabStyleProvider(FXTabControl tabControl) : base(tabControl) { radius = 1; showTabCloser = false; // Must set after the _Radius as this is used in the calculations of the actual padding Padding = new Drawing.Point(8, 3); }
protected TabStyleProvider(FXTabControl tabControl) { this.tabControl = tabControl; borderColor = Color.Empty; borderColorSelected = Color.Empty; focusColor = Color.Orange; imageAlign = tabControl.RightToLeftLayout ? ContentAlignment.MiddleRight : ContentAlignment.MiddleLeft; HotTrack = true; // Must set after the _Overlap as this is used // in the calculations of the actual padding Padding = new Drawing.Point(6 + (ShowTabCloser ? 6 : 0), 3); }
private static bool ApplyTo(FXTabControl c) { c.BackColor = BackColor; c.ForeColor = ForeColor; c.DisplayStyleProvider.BackColor = BackColor; c.DisplayStyleProvider.BackColorHot = WorkspaceHighlight; c.DisplayStyleProvider.BackColorSelected = Workspace; c.DisplayStyleProvider.CloserColorActive = Workspace; c.DisplayStyleProvider.CloserColor = ForeColor; c.DisplayStyleProvider.TextColor = ForeColor; c.DisplayStyleProvider.TextColorSelected = ForeColor; c.DisplayStyleProvider.TextColorDisabled = HighlightBackColor; c.DisplayStyleProvider.BorderColor = Color.Transparent; c.DisplayStyleProvider.BorderColorHot = HighlightBackColor; c.DisplayStyleProvider.BorderColorSelected = HighlightBackColor; return(true); }
public TabStyleRoundedProvider(FXTabControl tabControl) : base(tabControl) { radius = 10; // Must set after the _Radius as this is used in the calculations of the actual padding Padding = new Drawing.Point(6, 3); }
public TabStyleDefaultProvider(FXTabControl tabControl) : base(tabControl) { focusTrack = true; radius = 2; }