Exemplo n.º 1
0
        protected override void OnStyleSet(Gtk.Style previous_style)
        {
            if (this.layout != null)
            {
                this.layout.Dispose();
                this.layout = null;
            }
            if (this.headerLayout != null)
            {
                this.headerLayout.Dispose();
                this.headerLayout = null;
            }

            base.OnStyleSet(previous_style);

            layout       = new Pango.Layout(this.PangoContext);
            headerLayout = new Pango.Layout(this.PangoContext);

            if (desc != null)
            {
                layout.FontDescription       = desc;
                headerLayout.FontDescription = desc;
            }

            layout.Ellipsize = EllipsizeMode.End;

            headerLayout.Attributes = new AttrList();
            //			headerLayout.Attributes.Insert (new Pango.AttrWeight (Pango.Weight.Bold));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called when the window is realized (shown).
        /// </summary>
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;
            var attributes = new WindowAttr();

            attributes.WindowType = WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.Colormap   = Colormap;
            attributes.EventMask  = (int)(Events | EventMask.ExposureMask);
            attributes.Mask       = Events | EventMask.ExposureMask;

            const WindowAttributesType mask =
                WindowAttributesType.X | WindowAttributesType.Y
                | WindowAttributesType.Colormap | WindowAttributesType.Visual;

            GdkWindow          = new Window(ParentWindow, attributes, mask);
            GdkWindow.UserData = Raw;
            Style        = Style.Attach(GdkWindow);
            WidgetFlags &= ~WidgetFlags.NoWindow;
        }
Exemplo n.º 3
0
        protected override void OnStyleSet(Gtk.Style previous_style)
        {
            frame.FrameColor = frame.FillColor = BackgroundColor;
            resultsWindow.UpdateColors(BackgroundColor);

            base.OnStyleSet(previous_style);
        }
Exemplo n.º 4
0
		static NotificationMessage ()
		{
			Gtk.Window temp_win = new Gtk.Window (WindowType.Popup);
			temp_win.Name = "gtk-tooltips";
			temp_win.EnsureStyle ();

			style = temp_win.Style.Copy ();
		}
Exemplo n.º 5
0
 public override void UpdateFromGtkStyle(Gtk.Style style)
 {
     this.selectionStyle   = new ChunkStyle(style.Text(StateType.Selected), style.Base(StateType.Selected));
     this.defaultStyle     = new ChunkStyle(style.Text(StateType.Normal), style.Base(StateType.Normal));
     this.lineNumberStyle  = new ChunkStyle(new Gdk.Color(172, 168, 153), style.Base(StateType.Normal));
     this.iconBarBg        = ToCairoColor(style.Background(StateType.Normal));
     this.iconBarSeperator = ToCairoColor(style.Background(StateType.Active));
 }
Exemplo n.º 6
0
 protected override void OnStyleSet(Style style)
 {
     if (!changing_style) {
         changing_style = true;
         ModifyBg(StateType.Normal, Style.Background(StateType.Selected));
         changing_style = false;
     }
 }
Exemplo n.º 7
0
        static NotificationMessage()
        {
            Gtk.Window temp_win = new Gtk.Window(WindowType.Popup);
            temp_win.Name = "gtk-tooltips";
            temp_win.EnsureStyle();

            style = temp_win.Style.Copy();
        }
Exemplo n.º 8
0
 protected override void OnStyleSet(Gtk.Style previousStyle)
 {
     base.OnStyleSet(previousStyle);
     if (highlightStyle != null)
     {
         highlightStyle.UpdateFromGtkStyle(Style);
     }
 }
Exemplo n.º 9
0
 protected override void OnStyleSet(Gtk.Style previous_style)
 {
     if (GtkThemeChanged != null)
     {
         GtkThemeChanged(this, System.EventArgs.Empty);
     }
     Colors.RebuildColors(BackgroundColor);
     base.OnStyleSet(previous_style);
 }
Exemplo n.º 10
0
        /// <summary>
        /// This returns the current highlight color from the GTK theme
        /// </summary>
        /// <returns>
        /// An hexadecimal color string (ex #ffffff)
        /// </returns>
        private string GetHighlightColor()
        {
            Gdk.Color fgColor;

            using (Gtk.Style style = Gtk.Rc.GetStyle(this))
                fgColor = style.Backgrounds [(int)StateType.Selected];

            return(Utilities.ColorGetHex(fgColor));
        }
Exemplo n.º 11
0
 protected override void OnStyleSet(Gtk.Style style)
 {
     fill_color_a       = CairoExtensions.GdkColorToCairoColor(Style.Background(StateType.Selected));
     fill_color_b       = CairoExtensions.GdkColorToCairoColor(Style.Foreground(StateType.Selected));
     fill_color_c       = CairoExtensions.GdkColorToCairoColor(Style.Background(StateType.Normal));
     stroke_color       = CairoExtensions.GdkColorToCairoColor(Style.Foreground(StateType.Normal), 0.6);
     inner_stroke_color = CairoExtensions.GdkColorToCairoColor(Style.Foreground(StateType.Normal), 0.4);
     text_color         = CairoExtensions.GdkColorToCairoColor(Style.Foreground(StateType.Normal), 0.8);
     text_bg_color      = CairoExtensions.GdkColorToCairoColor(Style.Background(StateType.Normal), 0.6);
 }
Exemplo n.º 12
0
        protected override void OnStyleSet(Style previous_style)
        {
            if(changing_style) {
                return;
            }

            changing_style = true;
            LoadPixbufs();
            changing_style = false;
        }
Exemplo n.º 13
0
        protected override void OnStyleSet(Gtk.Style style)
        {
            base.OnStyleSet(style);

            fill_color_a = DrawingUtilities.GdkColorToCairoColor(Style.Background(StateType.Normal));

            var c = Meshwork.Client.GtkClient.GtkHelper.DarkenColor(Style.Background(StateType.Normal), 1);

            fill_color_b = DrawingUtilities.GdkColorToCairoColor(c);
        }
Exemplo n.º 14
0
        protected override void OnStyleSet (Style old_style)
        {
            base.OnStyleSet (old_style);

            if (first_style_set) {
                BuildLayouts ();
                UpdateLabel ();
            }

            first_style_set = true;
        }
Exemplo n.º 15
0
        Surface GetHighlightSource()
        {
            if (highlight_surface == null)
            {
                using (Context cr = Gdk.CairoHelper.Create(GdkWindow)) {
                    highlight_surface = cr.CreateSimilarToTarget(width, SurfaceHeight);

                    using (var cr2 = new Context(highlight_surface)) {
                        switch (style)
                        {
                        case HUDStyle.HUD:
                            using (var grad = new LinearGradient(0, 0, 0, SurfaceHeight)) {
                                grad.AddColorStop(0, new Cairo.Color(.85, .85, .85, .2));
                                grad.AddColorStop(1, new Cairo.Color(.95, .95, .95, .2));

                                cr2.SetSource(grad);
                                double radius = (SurfaceHeight - 2) / 2;
                                double x = 4.5, y = 1.5;
                                int    r_width  = width - 9;
                                int    r_height = SurfaceHeight - 3;

                                cr2.MoveTo(x, y + radius);
                                cr2.Arc(x + radius, y + radius, radius, Math.PI, -Math.PI / 2);
                                cr2.LineTo(x + r_width - radius, y);
                                cr2.Arc(x + r_width - radius, y + radius, radius, -Math.PI / 2, 0);
                                cr2.LineTo(x + r_width, y + r_height - radius);
                                cr2.Arc(x + r_width - radius, y + r_height - radius, radius, 0, Math.PI / 2);
                                cr2.LineTo(x + radius, y + r_height);
                                cr2.Arc(x + radius, y + r_height - radius, radius, Math.PI / 2, Math.PI);
                                cr2.ClosePath();

                                cr2.FillPreserve();
                            }

                            cr2.LineWidth = 1;
                            cr2.SetSourceRGBA(0.9, 0.9, 0.9, 1);
                            cr2.Stroke();
                            break;

                        case HUDStyle.Classic:
                            cr2.Rectangle(0, 0, width, SurfaceHeight);
                            Gdk.Color gdkColor;
                            using (Gtk.Style rcstyle = Gtk.Rc.GetStyle(this)) {
                                gdkColor = rcstyle.BaseColors [(int)StateType.Selected];
                            }
                            cr2.SetSourceRGBA(gdkColor.ConvertToCairo(.8));
                            cr2.Fill();
                            break;
                        }
                    }
                }
            }
            return(highlight_surface);
        }
Exemplo n.º 16
0
        protected override void OnStyleSet(Gtk.Style previousStyle)
        {
            if (changing_style)
            {
                return;
            }

            changing_style = true;
            Style          = win.Style;
            label.Style    = Style;
            changing_style = false;
        }
Exemplo n.º 17
0
        protected override void OnStyleSet (Style previous_style)
        {
            base.OnStyleSet (previous_style);

            CheckButton check = new CheckButton ();
            check.EnsureStyle ();

            interior_focus = GtkUtilities.StyleGetProperty<bool> (check, "interior-focus", false);
            focus_width = GtkUtilities.StyleGetProperty<int> (check, "focus-line-width", -1);
            focus_padding = GtkUtilities.StyleGetProperty<int> (check, "focus-padding", -1);
            padding = interior_focus ? focus_width + focus_padding : 0;
        }
Exemplo n.º 18
0
        public static void PaintFlatBox(Gtk.Style style, Gdk.Drawable window, Gtk.StateType state_type, Gtk.ShadowType shadow_type, Gdk.Rectangle?area, Gtk.Widget widget, string detail, int x, int y, int width, int height)
        {
            IntPtr native_area   = area == null ? IntPtr.Zero : GLib.Marshaller.StructureToPtrAlloc(area);
            IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup(detail);

            gtk_paint_flat_box(style == null ? IntPtr.Zero : style.Handle, window == null ? IntPtr.Zero : window.Handle, (int)state_type, (int)shadow_type, native_area, widget == null ? IntPtr.Zero : widget.Handle, native_detail, x, y, width, height);
            if (area != null)
            {
                area = Gdk.Rectangle.New(native_area);
                Marshal.FreeHGlobal(native_area);
            }
            GLib.Marshaller.Free(native_detail);
        }
		protected override void OnStyleSet (Style previous_style)
		{
			base.OnStyleSet (previous_style);
			if (Core.Platform.IsWindows) {
				using (var scrollstyle = Rc.GetStyleByPaths (Settings, null, null, VScrollbar.GType)) {
					var scrl = new VScrollbar (null);
					scrl.Style = scrollstyle;
					win81Slider = scrollstyle.Background (StateType.Normal).ToCairoColor ();
					win81SliderPrelight = scrollstyle.Background (StateType.Prelight).ToCairoColor ();
					win81ScrollbarWidth = (int)scrl.StyleGetProperty ("slider-width");
					scrl.Destroy ();
				}
			}
		}
Exemplo n.º 20
0
		// we can't override Initialize () or use the default constructor for this,
		// because a valid Gdk.Window is required for full Gtk.Style initialization
		static void InitializeStyle (Gtk.Widget container)
		{
			if (style == null && container.GdkWindow != null) {
				Gtk.CheckButton cb = new BooleanEditor (); // use the BooleanEditor style for the checks
				cb.GdkWindow = container.GdkWindow;
				cb.Parent = container;
				cb.Realize ();
				style = cb.Style;
				style.Attach (container.GdkWindow);
				indicatorSize = (int)cb.StyleGetProperty ("indicator-size");
				indicatorSpacing = (int)cb.StyleGetProperty ("indicator-spacing");
				style.Detach ();
				cb.Dispose ();
			}
		}
Exemplo n.º 21
0
        protected override void OnStyleSet(Gtk.Style previous_style)
        {
            if (changeStyle)
            {
                return;
            }
            changeStyle = true;
            var surrogate = new TooltipStyleSurrogate();

            surrogate.EnsureStyle();
            this.Style = surrogate.Style;
            surrogate.Destroy();
            base.OnStyleSet(previous_style);
            changeStyle = false;
        }
Exemplo n.º 22
0
 // we can't override Initialize () or use the default constructor for this,
 // because a valid Gdk.Window is required for full Gtk.Style initialization
 static void InitializeStyle(Gtk.Widget container)
 {
     if (style == null && container.GdkWindow != null)
     {
         Gtk.CheckButton cb = new BooleanEditor();                  // use the BooleanEditor style for the checks
         cb.GdkWindow = container.GdkWindow;
         cb.Parent    = container;
         cb.Realize();
         style = cb.Style;
         style.Attach(container.GdkWindow);
         indicatorSize    = (int)cb.StyleGetProperty("indicator-size");
         indicatorSpacing = (int)cb.StyleGetProperty("indicator-spacing");
         style.Detach();
         cb.Dispose();
     }
 }
Exemplo n.º 23
0
        public virtual void SetStyle(Gtk.Style style)
        {
            Style = style;
            try {
                OnStyleSet(style);
            } catch (Exception e) {
                Log <AbstractDockItem> .Error(e.Message);

                Log <AbstractDockItem> .Debug(e.StackTrace);
            }
            Gdk.Color gdkColor = Style.Backgrounds [(int)StateType.Selected];
            badgeColors [0] = new Cairo.Color((double)gdkColor.Red / ushort.MaxValue,
                                              (double)gdkColor.Green / ushort.MaxValue,
                                              (double)gdkColor.Blue / ushort.MaxValue,
                                              1.0).SetValue(1).SetSaturation(0.47);
            badgeColors [1] = badgeColors [0].SetValue(0.5).SetSaturation(0.51);
            QueueRedraw();
        }
Exemplo n.º 24
0
        protected override void OnStyleSet(Gtk.Style previous_style)
        {
            if (changeStyle)
            {
                return;
            }
            changeStyle = true;
            var surrogate = new TooltipStyleSurrogate();

            surrogate.EnsureStyle();
            this.Style = surrogate.Style;
            surrogate.Destroy();
            foreach (var label in MessageArea.Children)
            {
                label.Style = Style;
            }

            base.OnStyleSet(previous_style);
            changeStyle = false;
        }
Exemplo n.º 25
0
        protected override void OnStyleSet(Gtk.Style old_style)
        {
            base.OnStyleSet(old_style);

            // Normal Crumb Background
            this.m_NormalBgBegin = CrumbHelper.ToCairoColor(
                Style.Background(StateType.Normal), 1);
            this.m_NormalBgEnd = CrumbHelper.ToCairoColor(
                Style.Mid(StateType.Normal), 1);

            // Cursor Hover Crumb Background
            this.m_PrelightBgBegin = CrumbHelper.ToCairoColor(
                Style.Background(StateType.Prelight), 1);
            this.m_PrelightBgEnd = CrumbHelper.ToCairoColor(
                Style.Mid(StateType.Prelight), 1);

            // Selected Crumb Background
            this.m_SelectedBgBegin = CrumbHelper.ToCairoColor(
                Style.Light(StateType.Selected), 1);
            this.m_SelectedBgEnd = CrumbHelper.ToCairoColor(
                Style.Mid(StateType.Selected), 1);
        }
Exemplo n.º 26
0
 protected override void OnStyleSet(Style previous_style)
 {
     base.OnStyleSet (previous_style);
     header.Markup = GetHeaderMarkup (DisplayName);
 }
Exemplo n.º 27
0
 protected override void OnStyleSet (Style previous_style)
 {
     base.OnStyleSet (previous_style);
     similar_artists_view.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
 }
Exemplo n.º 28
0
		protected override void OnStyleSet (Style previous_style)
		{
			if (changing_styles) {
				return;
			}
			
			changing_styles = true;
			base.OnStyleSet (previous_style);
			Parent.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
			changing_styles = false;
		}
 protected override void OnStyleSet (Style old_style)
 {
     base.OnStyleSet (old_style);
     theme = Hyena.Gui.Theming.ThemeEngine.CreateTheme (this);
 }
Exemplo n.º 30
0
 protected override void OnStyleSet(Gtk.Style previousStyle)
 {
     base.OnStyleSet(previousStyle);
 }
Exemplo n.º 31
0
 protected override void OnStyleSet(Gtk.Style previous_style)
 {
     CreateLayout();
     UpdateLayout();
     base.OnStyleSet(previous_style);
 }
Exemplo n.º 32
0
 protected override void OnStyleSet(Style previous_style)
 {
     SetColors ();
 }
Exemplo n.º 33
0
	public Browser (string basedir, IEnumerable<string> sources, string engine)
	{
#if MACOS
		try {
			InitMacAppHandlers();
		} catch (Exception ex) {
			Console.Error.WriteLine ("Installing Mac AppleEvent handlers failed. Skipping.\n" + ex);
		}
#endif
	
		this.engine = engine;		
		ui = new Glade.XML (null, "browser.glade", "window1", null);
		ui.Autoconnect (this);

		MainWindow = (Gtk.Window) ui["window1"];
		MainWindow.DeleteEvent += new DeleteEventHandler (delete_event_cb);
                
		MainWindow.KeyPressEvent += new KeyPressEventHandler (keypress_event_cb);
		MainWindow.KeyReleaseEvent += new KeyReleaseEventHandler (keyrelease_event_cb);
                
		Stream icon = GetResourceImage ("monodoc.png");

		if (icon != null) {
			monodoc_pixbuf = new Gdk.Pixbuf (icon);
			MainWindow.Icon = monodoc_pixbuf;
		}

		//ellipsizing label for the title
		title_label = new ELabel ("");
		title_label.Xalign = 0;
		Pango.FontDescription fd = new Pango.FontDescription ();
		fd.Weight = Pango.Weight.Bold;
		title_label.ModifyFont (fd);
		title_label.Layout.FontDescription = fd;
		title_label_box.Add (title_label);
		title_label.Show ();
		
		//colour the bar according to the current style
		bar_style = bar_eb.Style.Copy ();
		bar_eb.Style = bar_style;
		MainWindow.StyleSet += new StyleSetHandler (BarStyleSet);
		BarStyleSet (null, null);

		help_tree = Driver.LoadTree (basedir, sources);
		tree_browser = new TreeBrowser (help_tree, reference_tree, this);
		
		// Bookmark Manager init;
		bookmark_manager = new BookmarkManager(this);
		
		//
		// Tab Notebook and first tab
		//
		tabs_nb = new Notebook(); //the Notebook that holds tabs
		tabs_nb.Scrollable = true;
		tabs_nb.SwitchPage += new SwitchPageHandler(ChangeTab);
		help_container.Add(tabs_nb);

		AddTab();
			
			
		if ((capabilities & Capabilities.Fonts) != 0) {
			// Add Menu entries for changing the font
			Menu aux = (Menu) view1.Submenu;
			MenuItem sep = new SeparatorMenuItem ();
			sep.Show ();
			aux.Append (sep);
			AccelGroup accel = new AccelGroup ();
			MainWindow.AddAccelGroup (accel);

			textLarger = new MenuItem ("_Larger text");
			textLarger.Activated += new EventHandler (TextLarger);
			textLarger.Show ();
			aux.Append (textLarger);
			AccelKey ak = new AccelKey (Gdk.Key.plus, Gdk.ModifierType.ControlMask, AccelFlags.Visible);
			textLarger.AddAccelerator ("activate", accel, ak);
		
			textSmaller = new MenuItem ("_Smaller text");
			textSmaller.Activated += new EventHandler (TextSmaller);
			textSmaller.Show ();
			aux.Append (textSmaller);
			ak = new AccelKey (Gdk.Key.minus, Gdk.ModifierType.ControlMask, AccelFlags.Visible);
			textSmaller.AddAccelerator ("activate", accel, ak);
	
			textNormal = new MenuItem ("_Original size");
			textNormal.Activated += new EventHandler (TextNormal);
			textNormal.Show ();
			aux.Append (textNormal);
			ak = new AccelKey (Gdk.Key.Key_0, Gdk.ModifierType.ControlMask, AccelFlags.Visible);
			textNormal.AddAccelerator ("activate", accel, ak);
		}

		// restore the editing setting
		editing1.Active = SettingsHandler.Settings.EnableEditing;

		comments1.Active = SettingsHandler.Settings.ShowComments;

		cut1.Sensitive = false;
		paste1.Sensitive = false;

		//
		// Other bits
		//
		search_index = help_tree.GetSearchIndex();
		if (search_index == null) {
			ppanel = new ProgressPanel ("<b>No Search index found</b>", "Generate", RootTree.MakeSearchIndex, CreateSearchPanel); 
			search_vbox.Add (ppanel);
			search_vbox.Show ();
		} else {
			CreateSearchPanel ();
		}
		bookList = new ArrayList ();

		index_browser = IndexBrowser.MakeIndexBrowser (this);
		MainWindow.ShowAll();
		
#if MACOS
		try {
			InstallMacMainMenu ();
			((MenuBar)ui["menubar1"]).Hide ();
		} catch (Exception ex) {
			Console.Error.WriteLine ("Installing Mac IGE Main Menu failed. Skipping.\n" + ex);
		}
#endif
	}
Exemplo n.º 34
0
 protected override void OnStyleSet(Style style)
 {
     if (IsRealized && !IsNoWindow) {
         Style.SetBackground (GdkWindow, State);
         if (IsDrawable)
             GdkWindow.Clear ();
     }
 }
Exemplo n.º 35
0
        protected override void OnStyleSet(Style previous)
        {
            base.OnStyleSet (previous);
            if (changing_style) {
                return;
            }

            changing_style = true;

            base_point_size = Style.FontDescription.Size;

            ModifyFg (StateType.Selected, Style.Text (StateType.Normal));
            ModifyFg (StateType.Normal, Hyena.Gui.Theming.GtkTheme.GetGdkTextMidColor (this));

            CreateLayout ();
            UpdateLayout ();

            changing_style = false;
        }
Exemplo n.º 36
0
 protected override void OnStyleSet (Style previous_style)
 {
     base.OnStyleSet (previous_style);
     name_renderer.CellBackgroundGdk = Style.Background (StateType.Normal);
 }
Exemplo n.º 37
0
		/// <summary>
		/// Returns a <see cref="DockySurface"/> containing a visual representation of the HoverText
		/// </summary>
		/// <param name="model">
		/// A <see cref="DockySurface"/>
		/// </param>
		/// <param name="style">
		/// A <see cref="Style"/>
		/// </param>
		/// <returns>
		/// A <see cref="DockySurface"/>
		/// </returns>
		public DockySurface HoverTextSurface (DockySurface model, Style style, bool isLight)
		{
			if (string.IsNullOrEmpty (HoverText))
				return null;
			
			if (text_buffer == null) {
				using (Pango.Layout layout = DockServices.Drawing.ThemedPangoLayout ()) {
					layout.FontDescription = style.FontDescription;
					layout.FontDescription.AbsoluteSize = Pango.Units.FromPixels (11);
					layout.FontDescription.Weight = Pango.Weight.Bold;
					layout.Ellipsize = Pango.EllipsizeMode.End;
					
					layout.SetText (HoverText);
					
					Pango.Rectangle inkRect, logicalRect;
					layout.GetPixelExtents (out inkRect, out logicalRect);
					if (logicalRect.Width > 0.8 * Gdk.Screen.Default.Width) {
						layout.Width = Pango.Units.FromPixels ((int) (0.8 * Gdk.Screen.Default.Width));
						layout.GetPixelExtents (out inkRect, out logicalRect);
					}
					
					int textWidth = logicalRect.Width;
					int textHeight = logicalRect.Height;
					int buffer = HoverTextHeight - textHeight;
					text_buffer = new DockySurface (Math.Max (HoverTextHeight, textWidth + buffer), HoverTextHeight, model);
					
					Cairo.Context cr = text_buffer.Context;
					
					cr.MoveTo (buffer / 2, buffer / 2);
					Pango.CairoHelper.LayoutPath (cr, layout);
					cr.Color = isLight ? new Cairo.Color (0.1, 0.1, 0.1) : new Cairo.Color (1, 1, 1);
					cr.Fill ();
					
					layout.Context.Dispose ();
				}
			}
			
			return text_buffer;
		}
Exemplo n.º 38
0
 protected virtual void OnStyleSet(Gtk.Style style)
 {
     // do nothing
 }
Exemplo n.º 39
0
//		public override Color WhitespaceMarker {
//			get {
//				return whitespaceMarker;
//			}
//		}
//
//		public override Color InvalidLineMarker {
//			get {
//				return invalidLineMarker;
//			}
//		}
//		public override Color FoldToggleMarker {
//			get {
//				return foldToggleMarker;
//			}
//		}

        public DefaultStyle(Gtk.Style widgetStyle)
        {
            this.PopulateDefaults();
            UpdateFromGtkStyle(widgetStyle ?? Gtk.Widget.DefaultStyle);
        }
Exemplo n.º 40
0
 protected override void OnStyleSet(Style previous)
 {
     base.OnStyleSet(previous);
     LoadIcons();
 }
Exemplo n.º 41
0
		protected override void OnStyleSet (Style previous_style)
		{
			base.OnStyleSet (previous_style);
			UpdateFont (Child as MonoDevelop.Components.FixedWidthWrapLabel);
		}
Exemplo n.º 42
0
		public virtual void SetStyle (Gtk.Style style)
		{
			Style = style;
			try {
				OnStyleSet (style);
			} catch (Exception e) {
				Log<AbstractDockItem>.Error (e.Message);
				Log<AbstractDockItem>.Debug (e.StackTrace);
			}
			Gdk.Color gdkColor = Style.Backgrounds [(int) StateType.Selected];
			badgeColors [0] = new Cairo.Color ((double) gdkColor.Red / ushort.MaxValue,
											(double) gdkColor.Green / ushort.MaxValue,
											(double) gdkColor.Blue / ushort.MaxValue,
											1.0).SetValue (1).SetSaturation (0.47);
			badgeColors [1] = badgeColors [0].SetValue (0.5).SetSaturation (0.51);
			QueueRedraw ();
		}
Exemplo n.º 43
0
 protected override void OnStyleSet(Gtk.Style previous_style)
 {
     base.OnStyleSet(previous_style);
     KillLayout();
 }
Exemplo n.º 44
0
        protected override void OnStyleSet (Style old_style)
        {
            base.OnStyleSet (old_style);
            theme = Hyena.Gui.Theming.ThemeEngine.CreateTheme (this);

            var light_text = Hyena.Gui.Theming.GtkTheme.GetCairoTextMidColor (this);
            header_renderer.Foreground = CairoExtensions.ColorGetHex (light_text, false);
        }
Exemplo n.º 45
0
        void Paint()
        {
            if (!IsDrawable)
            {
                return;
            }
            using (var cr2 = Gdk.CairoHelper.Create(GdkWindow)) {
                //Much kudos to Ian McIntosh
                if (surface == null)
                {
                    surface = cr2.CreateSimilarToTarget(WindowWidth, WindowHeight);
                }

                using (var cr = new Context(surface)) {
                    if (preview)
                    {
                        Gdk.Color bgColor;
                        using (Gtk.Style rcstyle = Gtk.Rc.GetStyle(this)) {
                            bgColor = rcstyle.Backgrounds [(int)StateType.Normal];
                        }
                        cr.SetSourceRGBA(bgColor.ConvertToCairo(1));
                    }
                    else
                    {
                        cr.SetSourceRGBA(0, 0, 0, 0);
                    }
                    cr.Operator = Cairo.Operator.Source;
                    cr.Paint();
                    cr.Operator = Cairo.Operator.Over;

                    BackgroundRenderer.RenderItem(cr, drawing_area);

                    RenderTitleBar(cr);
                    do
                    {
                        if (text_box_scale > 0)
                        {
                            RenderTextModeOverlay(cr);
                            if (text_box_scale == 1)
                            {
                                RenderTextModeText(cr);
                                continue;
                            }
                        }

                        if (BezelDefaults.RenderDescriptionText)
                        {
                            RenderDescriptionText(cr);
                        }
                        //--------------First Pane---------------
                        RenderPane(Pane.First, cr);
                        //------------Second Pane----------------
                        RenderPane(Pane.Second, cr);
                        //------------Third Pane-----------------
                        if (ThirdPaneVisible)
                        {
                            RenderPane(Pane.Third, cr);
                        }

                        if (text_box_scale > 0)
                        {
                            RenderTextModeOverlay(cr);
                        }
                    } while (false);

                    if (DrawShadow)
                    {
                        Util.Appearance.DrawShadow(cr, drawing_area.X, drawing_area.Y, drawing_area.Width,
                                                   drawing_area.Height, WindowRadius, new Util.ShadowParameters(.5, ShadowRadius));
                    }

                    if (window_scale != 1)                      //we are likely in preview mode, though this can be set on the fly
                    {
                        cr2.Scale(window_scale, window_scale);
                    }
                    cr2.SetSourceSurface(surface, 0, 0);
                    cr2.Operator = Operator.Source;
                    cr2.Paint();
                }
            }
        }
Exemplo n.º 46
0
	void StyleHandler (object obj, StyleSetArgs args)
	{
		if (Style == my_style)
			return;

		my_style = style_widget.Style.Copy ();
		Style = my_style;
		my_style.SetBackgroundGC (StateType.Normal, Style.BaseGC (StateType.Normal));
		Refresh ();
	}
Exemplo n.º 47
0
        protected override void OnStyleSet (Style previous)
        {
            base.OnStyleSet (previous);

            text_color = CairoExtensions.GdkColorToCairoColor (Style.Foreground (StateType.Normal));
            BackgroundColor = CairoExtensions.GdkColorToCairoColor (Style.Background (StateType.Normal));
            text_light_color = Hyena.Gui.Theming.GtkTheme.GetCairoTextMidColor (this);

            ResetMissingImages ();

            OnThemeChanged ();
        }
			protected override void OnStyleSet (Style previous_style)
			{
				CreateLayout ();
				base.OnStyleSet (previous_style);
			}
Exemplo n.º 49
0
 protected override void OnStyleSet (Style previous_style)
 {
     base.OnStyleSet (previous_style);
     results_tv.ModifyBg (StateType.Normal, Style.Base (StateType.Normal));
 }
Exemplo n.º 50
0
		protected override void OnStyleSet (Style previous)
		{
			base.OnStyleSet (previous);
			KillLayout ();
			EnsureLayout ();
		}
Exemplo n.º 51
0
 protected override void OnStyleSet (Style previous_style)
 {
     base.OnStyleSet (previous_style);
     InitTheme ();
 }
Exemplo n.º 52
0
 protected override void OnStyleSet(Style previous)
 {
     base.OnStyleSet (previous);
     SetColors ();
 }
Exemplo n.º 53
0
        protected override void OnStyleSet(Style old_style)
        {
            if (changing_style) {
                return;
            }

            changing_style = true;

            theme = new GtkTheme (this);
            if (canvas_child != null) {
                canvas_child.Theme = theme;
            }

            changing_style = false;

            base.OnStyleSet (old_style);
        }
Exemplo n.º 54
0
		protected override void OnStyleSet (Style previous_style)
		{
			base.OnStyleSet (previous_style);
			if (!borderColorSet)
				borderColor = Style.Dark (Gtk.StateType.Normal);
		}
Exemplo n.º 55
0
 static FlagsEditorCell()
 {
     // reinit style
     MonoDevelop.Ide.Gui.Styles.Changed += (sender, e) => style = null;
 }
Exemplo n.º 56
0
 protected override void OnStyleSet(Gtk.Style previous_style)
 {
     base.OnStyleSet(previous_style);
     Invalidate();
 }
Exemplo n.º 57
0
    public static Gdk.Color GetBackgroundColorSelected()
    {
        Gtk.Style regularLabel = Gtk.Rc.GetStyle(new Gtk.Label());

        return(regularLabel.Background(StateType.Selected));
    }