Пример #1
0
 void ChangeColor(Gtk.Widget w)
 {
     w.Realized += delegate {
         var textColor = Styles.BreadcrumbTextColor.ToGdkColor();
         if (Core.Platform.IsMac && w is CheckButton)
         {
             // the Gtk.CheckButton Text color is the color of the check mark
             // and the Fg color is used for the label.
             w.ModifyFg(StateType.Prelight, textColor);
             w.ModifyFg(StateType.Active, textColor);
         }
         else
         {
             w.ModifyText(StateType.Normal, textColor);
         }
         w.ModifyFg(StateType.Normal, textColor);
     };
     if (w is Gtk.Container)
     {
         foreach (var c in ((Gtk.Container)w).Children)
         {
             ChangeColor(c);
         }
     }
 }
Пример #2
0
		void ChangeColor (Gtk.Widget w)
		{
			w.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (69, 69, 94));
			w.ModifyBg (Gtk.StateType.Active, new Gdk.Color (69, 69, 94));
			w.ModifyFg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 255));
			w.ModifyFg (Gtk.StateType.Active, new Gdk.Color (255, 255, 255));
			w.ModifyFg (Gtk.StateType.Prelight, new Gdk.Color (255, 255, 255));

			Gtk.Container c = w as Gtk.Container;

			if (c != null) {
				foreach (Widget cw in c.Children)
					ChangeColor (cw);
			}
		}
Пример #3
0
 void ChangeColor(Gtk.Widget w)
 {
     w.Realized += delegate {
         w.ModifyText(StateType.Normal, Styles.BreadcrumbTextColor);
         w.ModifyFg(StateType.Normal, Styles.BreadcrumbTextColor);
     };
     if (w is Gtk.Container)
     {
         foreach (var c in ((Gtk.Container)w).Children)
         {
             ChangeColor(c);
         }
     }
 }
Пример #4
0
        /// <summary>Adds a new page at the specified position.</summary>
        /// <param name="Child">The widget to use as the content of the page.</param>
        /// <param name="Label">The widget to use as the tab.</param>
        /// <param name="Position">The index (starting at 0) at which the page must be inserted, or -1 to insert the page after all existing pages.</param>
        public void InsertPage(Widget Child, Widget Label, int Position)
        {
            RibbonPage p = new RibbonPage (this, Child, Label);

            if(Position == -1)
            {
                pages.Add (p);
            }
            else
            {
                pages.Insert (Position, p);

                if(curPageIndex != -1)
                {
                    if(Position <= curPageIndex)
                        ++curPageIndex;
                }
            }

            if(pages.Count == 1)
            {
                CurrentPageIndex = 0;
            }
            else
            {
                Label.ModifyFg (StateType.Normal, theme.GetForecolorForRibbonTabs (false));
            }

            Label.ButtonPressEvent += delegate (object sender, ButtonPressEventArgs evnt)
            {
                this.SelectRibbonPage (p);
            };

            Label.EnterNotifyEvent += delegate (object sender, EnterNotifyEventArgs evnt)
            {

            };

            Label.LeaveNotifyEvent += delegate (object sender, LeaveNotifyEventArgs evnt)
            {

            };

            OnPageAdded (new PageEventArgs (p));
            for(int idx = Position + 1 ; idx < pages.Count ; ++idx)
            {
                OnPageSelected (new PageEventArgs (pages[idx]));
            }
        }