StorageBar


Object Hierarchy:

Granite.Widgets.StorageBar Granite.Widgets.StorageBar Granite.Widgets.StorageBar Gtk.Box Gtk.Box Gtk.Box->Granite.Widgets.StorageBar Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Container GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Atk.Implementor Atk.Implementor Atk.Implementor->Gtk.Box Atk.Implementor->Gtk.Container Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.Box Gtk.Buildable->Gtk.Container Gtk.Buildable->Gtk.Widget Gtk.Orientable Gtk.Orientable Gtk.Orientable->Gtk.Box

Description:


public class StorageBar : Box

An horizontal bar showing the remaining amount of space.

Example

public class StorageView : Gtk.Grid {
construct {
var file_root = GLib.File.new_for_path ("/");

try {
var info = file_root.query_filesystem_info (GLib.FileAttribute.FILESYSTEM_SIZE, null);

var size = info.get_attribute_uint64 (GLib.FileAttribute.FILESYSTEM_SIZE);

var storage = new Granite.Widgets.StorageBar.with_total_usage (size, size/2);
storage.update_block_size (Granite.Widgets.StorageBar.ItemDescription.AUDIO, size/40);
storage.update_block_size (Granite.Widgets.StorageBar.ItemDescription.VIDEO, size/30);
storage.update_block_size (Granite.Widgets.StorageBar.ItemDescription.APP, size/20);
storage.update_block_size (Granite.Widgets.StorageBar.ItemDescription.PHOTO, size/10);
storage.update_block_size (Granite.Widgets.StorageBar.ItemDescription.FILES, size/5);

add (storage);
} catch (Error e) {
critical (e.message);
}
}
}


Namespace: Granite.Widgets
Package: granite

Content:

Enums:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Gtk.Widget
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.Orientable