Example #1
0
        void HandleCustomOutputPadFontChanged(object sender, EventArgs e)
        {
            if (customFont != null)
            {
                customFont.Dispose();
                customFont = null;
            }

            customFont = Pango.FontDescription.FromString(IdeApp.Preferences.CustomOutputPadFont);

            view.SetFont(customFont);
        }
Example #2
0
 void UpdateFont(MonoDevelop.Components.FixedWidthWrapLabel label)
 {
     if (label == null)
     {
         return;
     }
     if (fontDescription != null)
     {
         fontDescription.Dispose();
     }
     fontDescription       = new Gtk.Label("").Style.FontDescription.Copy();
     fontDescription.Size  = DefaultSourceEditorOptions.Instance.Font.Size;
     label.FontDescription =  fontDescription;
 }
 void DisposeFont()
 {
     if (font != null)
     {
         font.Dispose();
         font = null;
     }
 }
        public AddLogEntryDialog(Dictionary <string, ChangeLogEntry> entries)
        {
            Build();

            Pango.FontDescription font = Pango.FontDescription.FromString(DesktopService.DefaultMonospaceFont);
            textview.ModifyFont(font);
            textview.WrapMode   = WrapMode.None;
            textview.AcceptsTab = true;
            Pango.TabArray tabs = new Pango.TabArray(1, true);
            tabs.SetTab(0, Pango.TabAlign.Left, GetStringWidth(" ") * 4);
            textview.Tabs           = tabs;
            textview.SizeRequested += delegate(object o, SizeRequestedArgs args)
            {
                textview.WidthRequest = GetStringWidth(string.Empty.PadRight(80));
            };
            font.Dispose();

            store          = new ListStore(typeof(ChangeLogEntry), typeof(Gdk.Pixbuf), typeof(string));
            fileList.Model = store;

            fileList.AppendColumn(string.Empty, new CellRendererPixbuf(), "pixbuf", 1);
            fileList.AppendColumn(string.Empty, new CellRendererText(), "text", 2);

            foreach (ChangeLogEntry ce in entries.Values)
            {
                Gdk.Pixbuf pic;
                if (ce.CantGenerate)
                {
                    pic = ImageService.GetPixbuf(Gtk.Stock.DialogWarning, Gtk.IconSize.Menu);
                }
                else if (ce.IsNew)
                {
                    pic = ImageService.GetPixbuf(Gtk.Stock.New, Gtk.IconSize.Menu);
                }
                else
                {
                    pic = null;
                }
                store.AppendValues(ce, pic, ce.File);
            }
            fileList.Selection.Changed += OnSelectionChanged;
            textview.Buffer.Changed    += OnTextChanged;
            TreeIter it;

            editMark              = textview.Buffer.CreateMark(null, textview.Buffer.EndIter, false);
            oldTextTag            = new Gtk.TextTag("readonly");
            oldTextTag.Foreground = "gray";
            oldTextTag.Editable   = false;
            textview.Buffer.TagTable.Add(oldTextTag);

            if (store.GetIterFirst(out it))
            {
                fileList.Selection.SelectIter(it);
            }
        }
Example #5
0
        public CommitMessageStylePanelWidget()
        {
            this.Build();

            Pango.FontDescription font = Pango.FontDescription.FromString(
                DesktopService.DefaultMonospaceFont);
            font.Size = Pango.Units.FromPixels(8);
            textview.ModifyFont(font);
            textview.AcceptsTab = true;
            font.Dispose();
        }
Example #6
0
 protected override void OnDestroyed()
 {
     isDisposed = true;
     DisposeLayout();
     if (font != null)
     {
         font.Dispose();
         font = null;
     }
     base.OnDestroyed();
 }
        protected void DisposeFont()
        {
            if (font != null)
            {
                font.Dispose();
                font = null;
            }

            if (gutterFont != null)
            {
                gutterFont.Dispose();
                gutterFont = null;
            }
        }
Example #8
0
        public RatingEntryTestModule() : base("Rating Entry")
        {
            var pbox = new VBox();

            Add(pbox);

            var m    = new Menu();
            var b    = new MenuBar();
            var item = new MenuItem("Rate Me!")
            {
                Submenu = m
            };

            b.Append(item);
            m.Append(new MenuItem("Apples"));
            m.Append(new MenuItem("Pears"));
            m.Append(new RatingMenuItem());
            m.Append(new ImageMenuItem("gtk-remove", null));
            m.ShowAll();
            pbox.PackStart(b, false, false, 0);

            var box = new VBox {
                BorderWidth = 10,
                Spacing     = 10
            };

            pbox.PackStart(box, true, true, 0);

            var entry1 = new RatingEntry();

            box.PackStart(entry1, true, true, 0);

            var entry2 = new RatingEntry();

            box.PackStart(entry2, false, false, 0);

            box.PackStart(new Entry("Normal GtkEntry"), false, false, 0);

            var entry3 = new RatingEntry();

            Pango.FontDescription fd = entry3.PangoContext.FontDescription.Copy();
            fd.Size = (int)(fd.Size * Pango.Scale.XXLarge);
            entry3.ModifyFont(fd);
            fd.Dispose();
            box.PackStart(entry3, true, true, 0);

            pbox.ShowAll();
        }
 public override void SetToolbarStyle(Gtk.Toolbar toolbar)
 {
     if (Style != null)
     {
         if (fd != null)
         {
             fd.Dispose();
             fd = null;
         }
         if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar)
         {
             fd = FontService.SansFont.CopyModified(Styles.FontScale11);
         }
         combo.ModifyLabelFont(fd);
     }
 }
 public void Dispose()
 {
     editor.EditorOptionsChanged -= HandleEditorEditorOptionsChanged;
     if (textWidthDictionary != null)
     {
         foreach (var l in textWidthDictionary.Values)
         {
             l.Layout.Dispose();
         }
     }
     if (fontDescription != null)
     {
         fontDescription.Dispose();
         fontDescription = null;
     }
 }
Example #11
0
 public override void SetToolbarStyle(Gtk.Toolbar toolbar)
 {
     if (Style != null)
     {
         if (fd != null)
         {
             fd.Dispose();
             fd = null;
         }
         if (toolbar.IconSize == Gtk.IconSize.Menu || toolbar.IconSize == Gtk.IconSize.SmallToolbar)
         {
             fd      = Style.FontDescription.Copy();
             fd.Size = (int)(fd.Size * Pango.Scale.Small);
         }
         combo.ModifyLabelFont(fd);
     }
 }
Example #12
0
        protected override bool OnExposeEvent(Gdk.EventExpose evt)
        {
            if (bitmap != null)
            {
                Gdk.GC gc = Style.LightGC(StateType.Normal);
                GdkWindow.DrawPixbuf(gc, bitmap, 0, 0, 0, 0, bitmap.Width, bitmap.Height, Gdk.RgbDither.None, 0, 0);

                using (Pango.Layout pl = new Pango.Layout(PangoContext)) {
                    Pango.FontDescription des = this.Style.FontDescription.Copy();
                    pl.FontDescription = des;
                    //pl.SetMarkup("<b><span foreground='#cccccc'>" + BuildVariables.PackageVersionLabel + "</span></b>");
                    int w, h;
                    pl.GetPixelSize(out w, out h);
                    GdkWindow.DrawLayout(gc, bitmap.Width - w - 75, 90, pl);
                    des.Dispose();
                }
            }
            return(base.OnExposeEvent(evt));
        }