public PrinterSelectViewBase getButtonWidgetNormal() { RGBA_Bytes fillColor = ActiveTheme.Instance.PrimaryBackgroundColor; RGBA_Bytes borderColor; if (ActiveTheme.Instance.IsDarkTheme) { borderColor = new RGBA_Bytes(77, 77, 77); } else { borderColor = new RGBA_Bytes(190, 190, 190); } RGBA_Bytes textColor = ActiveTheme.Instance.PrimaryTextColor; PrinterSelectViewBase widget = new PrinterSelectViewBase( this.width, this.height, this.fontSize, this.borderWidth, this.borderRadius, this.padding, textColor, fillColor, borderColor); return(widget); }
public PrinterSelectButton() { this.HAnchor = HAnchor.ParentLeftRight; //Widgets to show during the four button states PrinterSelectViewBase buttonWidgetPressed = getButtonWidgetNormal(); PrinterSelectViewBase buttonWidgetHover = getButtonWidgetHover(); PrinterSelectViewBase buttonWidgetNormal = getButtonWidgetNormal(); PrinterSelectViewBase buttonWidgetDisabled = getButtonWidgetNormal(); //Create container for the three state widgets for the button ButtonViewStates buttonView = new ButtonViewStates(buttonWidgetNormal, buttonWidgetHover, buttonWidgetPressed, buttonWidgetDisabled); buttonView.HAnchor = HAnchor.ParentLeftRight; this.ToolTipText = "Select a printer".Localize(); this.Name = "Select a Printer Button"; Margin = DefaultMargin; OriginRelativeParent = new Vector2(0, 0); if (buttonView != null) { buttonView.Selectable = false; AddChild(buttonView); HAnchor = HAnchor.FitToChildren; VAnchor = VAnchor.FitToChildren; if (LocalBounds.Left != 0 || LocalBounds.Bottom != 0) { // let's make sure that a button has 0, 0 at the lower left // move the children so they will fit with 0, 0 at the lower left foreach (GuiWidget child in Children) { child.OriginRelativeParent = child.OriginRelativeParent + new Vector2(-LocalBounds.Left, -LocalBounds.Bottom); } HAnchor = HAnchor.FitToChildren; VAnchor = VAnchor.FitToChildren; } MinimumSize = new Vector2(Width, Height); } }
private PrinterSelectViewBase getButtonWidgetHover() { RGBA_Bytes fillColor = ActiveTheme.Instance.PrimaryBackgroundColor; RGBA_Bytes borderColor = new RGBA_Bytes(77, 77, 77); RGBA_Bytes textColor = ActiveTheme.Instance.PrimaryTextColor; PrinterSelectViewBase widget = new PrinterSelectViewBase( this.width, this.height, this.fontSize, this.borderWidth, this.borderRadius, this.padding, textColor, fillColor, borderColor); return(widget); }
public PrinterSelectViewBase getButtonWidgetNormal() { RGBA_Bytes fillColor = ActiveTheme.Instance.PrimaryBackgroundColor; RGBA_Bytes borderColor; if (ActiveTheme.Instance.IsDarkTheme) { borderColor = new RGBA_Bytes(77, 77, 77); } else { borderColor = new RGBA_Bytes(190, 190, 190); } RGBA_Bytes textColor = ActiveTheme.Instance.PrimaryTextColor; PrinterSelectViewBase widget = new PrinterSelectViewBase( this.width, this.height, this.fontSize, this.borderWidth, this.borderRadius, this.padding, textColor, fillColor, borderColor); return widget; }
private PrinterSelectViewBase getButtonWidgetHover() { RGBA_Bytes fillColor = ActiveTheme.Instance.PrimaryBackgroundColor; RGBA_Bytes borderColor = new RGBA_Bytes(77, 77, 77); RGBA_Bytes textColor = ActiveTheme.Instance.PrimaryTextColor; PrinterSelectViewBase widget = new PrinterSelectViewBase( this.width, this.height, this.fontSize, this.borderWidth, this.borderRadius, this.padding, textColor, fillColor, borderColor); return widget; }