Beispiel #1
0
        private void BuildWidget()
        {
            HBox box = new HBox();

            disk_bar_align          = new Alignment(0.5f, 0.5f, 1.0f, 1.0f);
            disk_bar                = new SegmentedBar();
            disk_bar.ValueFormatter = DapValueFormatter;

            disk_bar.AddSegmentRgb(Catalog.GetString("Audio"), 0, 0x3465a4);
            disk_bar.AddSegmentRgb(Catalog.GetString("Video"), 0, 0x73d216);
            disk_bar.AddSegmentRgb(Catalog.GetString("Other"), 0, 0xf57900);
            disk_bar.AddSegment(Catalog.GetString("Free Space"), 0, disk_bar.RemainderColor, false);

            UpdateUsage();

            disk_bar_align.Add(disk_bar);

            box.PackStart(disk_bar_align, true, true, 0);
            disk_bar_align.TopPadding = 6;

            Add(box);
            box.ShowAll();

            SizeAllocated += delegate(object o, Gtk.SizeAllocatedArgs args) {
                SetBackground();
                disk_bar.HorizontalPadding = (int)(args.Allocation.Width * 0.25);
            };
        }