protected override void OnChangeBackground(PanelAppletBackgroundType type, Gdk.Color color, Gdk.Pixmap pixmap) { if (applet_event_box == null) { return; } Gtk.RcStyle rc_style = new Gtk.RcStyle(); applet_event_box.Style = null; applet_event_box.ModifyStyle(rc_style); switch (type) { case PanelAppletBackgroundType.ColorBackground: applet_event_box.ModifyBg(Gtk.StateType.Normal, color); break; case PanelAppletBackgroundType.NoBackground: break; case PanelAppletBackgroundType.PixmapBackground: Gtk.Style copy = applet_event_box.Style.Copy(); copy.SetBgPixmap(Gtk.StateType.Normal, pixmap); applet_event_box.Style = copy; break; } }
public static Gtk.Style GetStyle(Gtk.Widget widget) { IntPtr raw_ret = gtk_rc_get_style(widget == null ? IntPtr.Zero : widget.Handle); Gtk.Style ret = GLib.Object.GetObject(raw_ret) as Gtk.Style; return(ret); }
public override void SetStyle(Gtk.Style style) { // need to ensure every proxied item gets this update foreach (AbstractDockItem adi in Provider.Items) { adi.SetStyle(style); } }
protected override void OnStyleSet(Gtk.Style old_style) { base.OnStyleSet(old_style); if (IsRealized) { Style.SetBackground(bin_window, Gtk.StateType.Normal); } }
public Gdk.Pixbuf RenderIcon(Gtk.Style style, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail) { IntPtr native_detail = GLib.Marshaller.StringToPtrGStrdup(detail); IntPtr raw_ret = gtk_icon_set_render_icon(Handle, style == null ? IntPtr.Zero : style.Handle, (int)direction, (int)state, (int)size, widget == null ? IntPtr.Zero : widget.Handle, native_detail); Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf; GLib.Marshaller.Free(native_detail); return(ret); }
public void SetStyle (Gtk.Style style) { Style = style; try { OnStyleSet (style); } catch (Exception e) { Log<AbstractDockPainter>.Error (e.Message); Log<AbstractDockPainter>.Debug (e.StackTrace); } QueueRepaint (); }
public void SetStyle(Gtk.Style style) { Style = style; try { OnStyleSet(style); } catch (Exception e) { Log <AbstractDockPainter> .Error(e.Message); Log <AbstractDockPainter> .Debug(e.StackTrace); } QueueRepaint(); }
public unsafe Gdk.Pixbuf LoadSymbolicForStyle(Gtk.Style style, Gtk.StateType state, out bool was_symbolic) { IntPtr error = IntPtr.Zero; IntPtr raw_ret = gtk_icon_info_load_symbolic_for_style(Handle, style == null ? IntPtr.Zero : style.Handle, (int)state, out was_symbolic, out error); Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf; if (error != IntPtr.Zero) { throw new GLib.GException(error); } return(ret); }
public static Style GetColorStyle(Gtk.Style widgetStyle, string name) { if (styles.ContainsKey(name)) { return(styles [name]); } if (styleLookup.ContainsKey(name)) { LoadStyle(name); return(GetColorStyle(widgetStyle, name)); } return(new DefaultStyle(widgetStyle)); }
// 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 (); 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 (); } }
// 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(); 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(); } }
public static bool OnExposeEvent(Gtk.Container aContainer, Gdk.EventExpose ev) { if (aContainer == null) { return(true); } int x = aContainer.Allocation.Left; int y = aContainer.Allocation.Top; int width = aContainer.Allocation.Width; int height = aContainer.Allocation.Height; Widget e = GetEntryStyle(aContainer); Gtk.Style s = aContainer.Style; StateType st = aContainer.State; if (e != null) { s = e.Style; st = e.State; } if (GetContainerFocus(aContainer) == true) { if ((e == null) || (e.HasFocus == false)) { st = StateType.Selected; } Gtk.Style.PaintFlatBox(s, aContainer.GdkWindow, st, Gtk.ShadowType.In, aContainer.Allocation, aContainer, "entry_bg", x, y, width, height); Gtk.Style.PaintFocus(s, aContainer.GdkWindow, st, ev.Area, aContainer, "entry", x, y, width, height); Gtk.Style.PaintShadow(s, aContainer.GdkWindow, st, Gtk.ShadowType.In, ev.Area, aContainer, "entry", x, y, width, height); } else { Gtk.Style.PaintFlatBox(s, aContainer.GdkWindow, st, Gtk.ShadowType.In, aContainer.Allocation, aContainer, "entry_bg", x, y, width, height); Gtk.Style.PaintShadow(s, aContainer.GdkWindow, st, Gtk.ShadowType.In, ev.Area, aContainer, "entry", x, y, width, height); } e = null; s = null; return(true); }
protected override void OnStyleSet(Gtk.Style style) { // if we set a hue manually, we don't want to reset the hue when the style changes if (Hue != 0) { return; } Gdk.Color gdkColor = Style.Backgrounds [(int)Gtk.StateType.Selected]; int hue = (int)new Cairo.Color((double)gdkColor.Red / ushort.MaxValue, (double)gdkColor.Green / ushort.MaxValue, (double)gdkColor.Blue / ushort.MaxValue, 1.0).GetHue(); if (HueShift >= 0) { HueShift = (((hue - 202) % 360) + 360) % 360; } }
Gdk.Color get_background() { /* We can't know the exact background because we're not * in TextView's rendering, but we can make a guess */ if (BackgroundSet) { return(BackgroundGdk); } Gtk.Style s = Gtk.Rc.GetStyleByPaths(Gtk.Settings.Default, "GtkTextView", "GtkTextView", Gtk.TextView.GType); if (s == null) { Logger.Debug("get_background: Style for GtkTextView came back null! Returning white..."); return(new Gdk.Color(0xff, 0xff, 0xff)); //white, for lack of a better idea } else { return(s.Background(Gtk.StateType.Normal)); } }
protected override void OnStyleSet(Gtk.Style previous_style) { base.OnStyleSet(previous_style); UpdateFont((FixedWidthWrapLabel)Child); }
static BooleanEditorCell () { // reinit style MonoDevelop.Ide.Gui.Styles.Changed += (sender, e) => style = null; }
protected override void OnStyleSet(Gtk.Style previous) { this.SetTransparentColor(this.Style.Backgrounds [(int)Gtk.StateType.Normal]); }
protected override void OnStyleSet(Gtk.Style previous_style) { CreateLayout(); UpdateLayout(); base.OnStyleSet(previous_style); }
protected override void OnStyleSet(Gtk.Style previous) { this.Update(); }
protected override void OnStyleSet(Gtk.Style previous_style) { base.OnStyleSet(previous_style); UpdateLinkColor(); }
static BooleanEditorCell() { // reinit style MonoDevelop.Ide.Gui.Styles.Changed += (sender, e) => style = null; }
public virtual void UpdateFromGtkStyle(Gtk.Style style) { }
public PageGtkHeader() { Gtk.Style s = Gtk.Rc.GetStyle(new Gtk.Button()); Gdk.Color bg = s.Base(Gtk.StateType.Normal); Gdk.Color e_bg = s.Background(Gtk.StateType.Normal); Gdk.Color light = s.Base(Gtk.StateType.Selected); Gdk.Color text = s.Text(Gtk.StateType.Normal); Gdk.Color dark = s.Dark(Gtk.StateType.Selected); Gdk.Color dark_text = s.Text(Gtk.StateType.Selected); //Background image for error div // crashes // string bg_image; // try { // string name = Gtk.Stock.DialogError; // Gtk.IconInfo info = Gtk.IconTheme.Default.LookupIcon(name,256,Gtk.IconLookupFlags.ForceSvg); // bg_image = info.Filename; // } catch (Exception e) { // Console.WriteLine(e.Message); // bg_image= ""; // } this.content = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" + "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">" + "<head>" + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" + // "<style type=\"text/css\" media=\"screen,projection\">/*<![CDATA[*/ @import \"/skins-1.5/monobook/main.css?7\"; /*]]>*/</style>"+ // "<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" href=\"/skins-1.5/common/commonPrint.css\" />"+ // "<meta http-equiv=\"imagetoolbar\" content=\"no\" /><![endif]-->"+ // "<script type=\"text/javascript\">var skin = 'monobook';var stylepath = '/skins-1.5';</script>"+ // "<script type=\"text/javascript\" src=\"/skins-1.5/common/wikibits.js?1\"><!-- wikibits js --></script>"+ // "<script type=\"text/javascript\" src=\"/w/index.php?title=-&action=raw&gen=js\"><!-- site js --></script>"+ // "<style type=\"text/css\">/*<![CDATA[*/"+ // "@import \"/w/index.php?title=MediaWiki:Common.css&action=raw&ctype=text/css&smaxage=2678400\";"+ // "@import \"/w/index.php?title=MediaWiki:Monobook.css&action=raw&ctype=text/css&smaxage=2678400\";"+ // "@import \"/w/index.php?title=-&action=raw&gen=css&maxage=2678400\";"+ // "/*]]>*/</style>"+ "<style>" + "body { " + "margin:10px;" + "border:0px;" + "background-color: rgb(" + (bg.Red >> 8) + "," + (bg.Green >> 8) + "," + (bg.Blue >> 8) + ");" + "color: rgb(" + (text.Red >> 8) + "," + (text.Green >> 8) + "," + (text.Blue >> 8) + ");" + "font-size:x-small;" + "font:Verdana,Sans-serif;" + "}" + "h1 { " + " padding:5px;"+ " background-color: rgb("+ (light.Red >> 8) + "," + (light.Green >> 8) + "," + (light.Blue >> 8) + "); " + " -moz-border-radius:5px;"+ " }"+ "#title {" + "background-color: rgb(" + (dark.Red >> 8) + "," + (dark.Green >> 8) + "," + (dark.Blue >> 8) + ");" + "color: rgb(" + (dark_text.Red >> 8) + "," + (dark_text.Green >> 8) + "," + (dark_text.Blue >> 8) + "); }" + "img a { boder:none;}" + "a {color: rgb(" + (dark.Red >> 8) + "," + (dark.Green >> 8) + "," + (dark.Blue >> 8) + "); }" + "#error { background-color:rgb(255,0,0); color(255,255,255);}" + ".e_msg {" + " border:1px solid red;font-size:medium; width:60%;margin:auto;"+ " background-color: rgb("+ (e_bg.Red >> 8) + "," + (e_bg.Green >> 8) + "," + (e_bg.Blue >> 8) + ");" + " padding:40px;"+ " -moz-border-radius:15px;"+ // " background-image: url(\"file://"+bg_image+"\"); "+ // " background-repeat: no-repeat; "+ // " background-position: top left;"+ "}" + "</style></head><body>"; // "<img src=\""+bg_image+"\" /><br />"+ // "<img src=\"file://"+bg_image+"\" />"; // Array st = Enum.GetValues(typeof(Gtk.StateType)); // foreach ( Gtk.StateType t in st ) { // bg = s.Background(t); // Gdk.Color ba = s.Base(t); // dark = s.Dark(t); // Gdk.Color fg = s.Foreground(t); // light = s.Light(t); // Gdk.Color mid = s.Mid(t); // text = s.Text(t); // this.content += string.Format("<h1>{0}</h1>",t); // this.content += string.Format("<div style=\"background-color: rgb("+(bg.Red>>8)+","+(bg.Green>>8)+","+(bg.Blue>>8)+");\">{0}</div><br />","Backgroung"); // this.content += string.Format("<div style=\"background-color: rgb("+(ba.Red>>8)+","+(ba.Green>>8)+","+(ba.Blue>>8)+");\">{0}</div><br />","Base"); // this.content += string.Format("<div style=\"background-color: rgb("+(dark.Red>>8)+","+(dark.Green>>8)+","+(dark.Blue>>8)+");\">{0}</div><br />","Dark"); // this.content += string.Format("<div style=\"background-color: rgb("+(fg.Red>>8)+","+(fg.Green>>8)+","+(fg.Blue>>8)+");\">{0}</div><br />","Foreground"); // this.content += string.Format("<div style=\"background-color: rgb("+(light.Red>>8)+","+(light.Green>>8)+","+(light.Blue>>8)+");\">{0}</div><br />","Light"); // this.content += string.Format("<div style=\"background-color: rgb("+(mid.Red>>8)+","+(mid.Green>>8)+","+(mid.Blue>>8)+");\">{0}</div><br />","Mid"); // this.content += string.Format("<div style=\"background-color: rgb("+(text.Red>>8)+","+(text.Green>>8)+","+(text.Blue>>8)+");\">{0}</div><br />","Text"); // this.content += string.Format("<br /><br />"); // } }
protected override void OnStyleSet(Gtk.Style previous_style) { base.OnStyleSet(previous_style); d_graph.Font = Style.FontDescription; }
public Mono.TextEditor.Highlighting.Style GetColorStyle (Gtk.Style widgetStyle) { return DefaultSourceEditorOptions.Instance.GetColorStyle (widgetStyle); }
protected override void OnStyleSet(Gtk.Style previous) { CheckPattern = new CheckPattern(this.Style.Backgrounds [(int)Gtk.StateType.Normal]); }
public virtual ColorScheme GetColorStyle(Gtk.Style widgetStyle) { return(SyntaxModeService.GetColorStyle(widgetStyle, ColorScheme)); }
protected virtual void OnStyleSet(Gtk.Style style) { }