Ejemplo n.º 1
0
        static Gtk.IconSet MakeIcons(Wrappers.Renderers.Renderer renderer, string detail)
        {
            Gtk.IconSet    s = new Gtk.IconSet();
            Gtk.IconSource source;

            renderer.Detail = detail;

            Gtk.IconSize[] sizes = new Gtk.IconSize[] {
                Gtk.IconSize.Button,
                Gtk.IconSize.Dialog,
                Gtk.IconSize.Dnd,
                Gtk.IconSize.LargeToolbar,
                Gtk.IconSize.Menu,
                Gtk.IconSize.SmallToolbar
            };

            for (int i = 0; i < sizes.Length; ++i)
            {
                source = new Gtk.IconSource();

                int width, height;
                Gtk.Icon.SizeLookup(sizes[i], out width, out height);

                source.Pixbuf              = renderer.Icon(width);
                source.Size                = sizes[i];
                source.StateWildcarded     = true;
                source.DirectionWildcarded = true;
                source.SizeWildcarded      = false;

                s.AddSource(source);
            }

            return(s);
        }
Ejemplo n.º 2
0
 internal static void Initialize(Gtk.Widget iconRenderer)
 {
     if ((Stetic.Gui.initialized == false)) {
         Stetic.Gui.initialized = true;
         Gtk.IconFactory w1 = new Gtk.IconFactory();
         Gtk.IconSet w2 = new Gtk.IconSet();
         Gtk.IconSource w3 = new Gtk.IconSource();
         w3.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "./res/swap.png"));
         w2.AddSource(w3);
         Gtk.IconSource w4 = new Gtk.IconSource();
         w4.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "./res/flags/ar.png"));
         w2.AddSource(w4);
         Gtk.IconSource w5 = new Gtk.IconSource();
         w5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "./res/flags/bg.png"));
         w2.AddSource(w5);
         w1.Add("swap", w2);
         w1.AddDefault();
     }
 }
Ejemplo n.º 3
0
 internal static void Initialize(Gtk.Widget iconRenderer)
 {
     if ((Stetic.Gui.initialized == false))
     {
         Stetic.Gui.initialized = true;
         Gtk.IconFactory w1 = new Gtk.IconFactory();
         Gtk.IconSet     w2 = new Gtk.IconSet();
         Gtk.IconSource  w3 = new Gtk.IconSource();
         w3.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "./res/swap.png"));
         w2.AddSource(w3);
         Gtk.IconSource w4 = new Gtk.IconSource();
         w4.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "./res/flags/ar.png"));
         w2.AddSource(w4);
         Gtk.IconSource w5 = new Gtk.IconSource();
         w5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "./res/flags/bg.png"));
         w2.AddSource(w5);
         w1.Add("swap", w2);
         w1.AddDefault();
     }
 }