public void UpdateBarTextColor(Gdk.Color?barTextColor)
 {
     if (_titleContainer != null)
     {
         _titleContainer.UpdateTitleColor(barTextColor);
     }
 }
 public void UpdateBarBackgroundColor(Gdk.Color?barBackgroundColor)
 {
     if (_titleContainer != null)
     {
         _titleContainer.UpdateBackgroundColor(barBackgroundColor);
     }
 }
示例#3
0
 public void SetToolbarColor(Gdk.Color?backgroundColor)
 {
     if (backgroundColor.HasValue)
     {
         _headerContainer.ModifyBg(StateType.Normal, backgroundColor.Value);
     }
     else
     {
         _headerContainer.ModifyBg(StateType.Normal, _defaultBackgroundColor);
     }
 }
示例#4
0
 public void SetBackgroundColor(Gdk.Color?backgroundColor)
 {
     if (backgroundColor != null)
     {
         _contentContainerWrapper.VisibleWindow = true;
         _contentContainerWrapper.ModifyBg(StateType.Normal, backgroundColor.Value);
     }
     else
     {
         _contentContainerWrapper.VisibleWindow = false;
     }
 }
 public void UpdateTitleColor(Gdk.Color?titleColor)
 {
     if (_titleLabel != null)
     {
         if (titleColor.HasValue)
         {
             _titleLabel.ModifyFg(StateType.Normal, titleColor.Value);
         }
         else
         {
             _titleLabel.ModifyFg(StateType.Normal, _defaultTextColor);
         }
     }
 }
            public void UpdateBackgroundColor(Gdk.Color?backgroundColor)
            {
                if (_root == null)
                {
                    return;
                }

                if (backgroundColor.HasValue)
                {
                    ModifyBg(StateType.Normal, backgroundColor.Value);
                    _root.ModifyBg(StateType.Normal, backgroundColor.Value);
                }
                else
                {
                    ModifyBg(StateType.Normal, _defaultBackgroundColor);
                    _root.ModifyBg(StateType.Normal, _defaultBackgroundColor);
                }
            }
示例#7
0
 public void ResetBorderColor()
 {
     _borderColor = _defaultBorderColor;
     QueueDraw();
 }
示例#8
0
 public void SetBorderColor(Gdk.Color?color)
 {
     _borderColor = color;
     QueueDraw();
 }
示例#9
0
 public void ResetBackgroundColor()
 {
     _backgroundColor = _defaultBackgroundColor;
     QueueDraw();
 }
示例#10
0
 public void SetBackgroundColor(Gdk.Color?color)
 {
     _backgroundColor = color;
     QueueDraw();
 }
        protected virtual void SetContent(Xwt.ContentPosition position)
        {
            var label = this.Label;

            if (label != null && label.Length == 0)
            {
                label = null;
            }


            if (ButtonType == Xwt.ButtonType.Disclosure)
            {
                this.Label         = null;
                this.ContentWidget = new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.Out);
                this.ContentWidget.ShowAll();
                return;
            }

            Gtk.Widget contentWidget = null;

            if (label != null && Image == null)
            {
                contentWidget = new Gtk.Label(label)
                {
                    UseUnderline = this.UseUnderline
                };
            }
            else if (label == null && Image != null)
            {
                contentWidget = AllocEventBox(ImageWidget, true);
                contentWidget.AddEvents((int)Gdk.EventMask.ButtonPressMask);
                contentWidget.ButtonPressEvent -= this.ButtonPressed;
                contentWidget.ButtonPressEvent += this.ButtonPressed;
                Gdk.Color?background = null;
                contentWidget.FocusInEvent += (s, e) => {
                    var w = s as Gtk.Widget;
                };
                contentWidget.EnterNotifyEvent += (s, e) => {
                    var w = s as Gtk.Widget;
                    if (background == null)
                    {
                        background = w.Style.Background(Gtk.StateType.Normal);
                    }
                    w.ModifyBg(Gtk.StateType.Normal, Notifycolor);
                    w.QueueDraw();
                };
                contentWidget.LeaveNotifyEvent += (s, e) => {
                    var w = s as Gtk.Widget;
                    w.ModifyBg(Gtk.StateType.Normal, background.Value);
                    w.QueueDraw();
                };
            }
            else if (label != null && Image != null)
            {
                var box = position == Xwt.ContentPosition.Left || position == Xwt.ContentPosition.Right ? (Gtk.Box) new Gtk.HBox(false, 3) : (Gtk.Box) new Gtk.VBox(false, 3);
                var lab = new Gtk.Label(label)
                {
                    UseUnderline = this.UseUnderline
                };

                if (position == Xwt.ContentPosition.Left || position == Xwt.ContentPosition.Top)
                {
                    box.PackStart(ImageWidget, false, false, 0);
                    box.PackStart(lab, false, false, 0);
                }
                else
                {
                    box.PackStart(lab, false, false, 0);
                    box.PackStart(ImageWidget, false, false, 0);
                }

                contentWidget = box;
            }

            if (ButtonType == Xwt.ButtonType.DropDown)
            {
                Gtk.Widget dropDownArrow = new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.Out);
                dropDownArrow = AllocEventBox(dropDownArrow);
                dropDownArrow.AddEvents((int)Gdk.EventMask.ButtonPressMask);
                dropDownArrow.ButtonPressEvent += this.DropDownPressed;
                dropDownArrow.ModifyBg(Gtk.StateType.Normal, Widget.Style.Background(Gtk.StateType.Normal));
                if (contentWidget != null)
                {
                    var box = new Gtk.HBox(false, 3);
                    box.PackStart(contentWidget, true, true, 3);
                    //box.PackStart (new Gtk.VSeparator (), true, true, 0);
                    box.PackStart(dropDownArrow, false, false, 0);
                    contentWidget = box;
                }
                else
                {
                    contentWidget = dropDownArrow;
                }
            }

            if (contentWidget != null)
            {
                contentWidget.ShowAll();
                this.ContentWidget = contentWidget;
            }
            else
            {
                this.Label = null;
            }
        }