private void AddSection(Section section) { Frame frame = null; if (section.Count == 0) { return; } if (section.ShowLabel) { frame = new Frame(); Label label = new Label(); label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(section.Name)); label.UseUnderline = true; label.Show(); frame.LabelWidget = label; frame.LabelXalign = 0.0f; frame.LabelYalign = 0.5f; frame.Shadow = ShadowType.None; frame.Show(); PackStart(frame, false, false, 0); } Alignment alignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f); alignment.TopPadding = (uint)(frame == null ? 0 : 5); alignment.LeftPadding = section.ShowLabel ? (uint)12 : (uint)0; alignment.Show(); if (frame != null) { frame.Add(alignment); } else { PackStart(alignment, false, false, 0); } SectionBox box = new SectionBox(section); box.Show(); alignment.Add(box); }
private void AddSection (Section section) { Frame frame = null; if (section.Count == 0) { return; } if (section.ShowLabel) { frame = new Frame (); Label label = new Label (); label.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (section.Name)); label.UseUnderline = true; label.Show (); frame.LabelWidget = label; frame.LabelXalign = 0.0f; frame.LabelYalign = 0.5f; frame.Shadow = ShadowType.None; frame.Show (); PackStart (frame, false, false, 0); } Alignment alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f); alignment.TopPadding = (uint)(frame == null ? 0 : 5); alignment.LeftPadding = section.ShowLabel ? (uint)12 : (uint)0; alignment.Show (); if (frame != null) { frame.Add (alignment); } else { PackStart (alignment, false, false, 0); } SectionBox box = new SectionBox (section); box.Show (); alignment.Add (box); }