Commit 5c80a12c authored by Adrien Plazas's avatar Adrien Plazas
Browse files

Add icons to the pages

This makes the view switcher look better.
parent 41276851
...@@ -46,6 +46,7 @@ namespace Usage ...@@ -46,6 +46,7 @@ namespace Usage
{ {
name = "PERFORMANCE"; name = "PERFORMANCE";
title = _("Performance"); title = _("Performance");
icon_name = "speedometer-symbolic";
sub_views = new View[] sub_views = new View[]
{ {
......
...@@ -43,6 +43,7 @@ namespace Usage ...@@ -43,6 +43,7 @@ namespace Usage
{ {
name = "STORAGE"; name = "STORAGE";
title = _("Storage"); title = _("Storage");
icon_name = "drive-harddisk-symbolic";
/* It would be nice being able to this in the template file. */ /* It would be nice being able to this in the template file. */
storage_list_box = new StorageListBox(); storage_list_box = new StorageListBox();
......
...@@ -23,6 +23,7 @@ namespace Usage ...@@ -23,6 +23,7 @@ namespace Usage
public abstract class View : Gtk.Bin public abstract class View : Gtk.Bin
{ {
public string title; public string title;
public string icon_name;
protected View () protected View ()
{ {
......
...@@ -55,8 +55,10 @@ namespace Usage ...@@ -55,8 +55,10 @@ namespace Usage
new StorageView(), new StorageView(),
}; };
foreach(var view in views) foreach(var view in views) {
stack.add_titled(view, view.name, view.title); stack.add_titled(view, view.name, view.title);
stack.child_set (view, "icon-name", view.icon_name, null);
}
stack.notify.connect(() => { stack.notify.connect(() => {
if(stack.visible_child_name == views[Views.PERFORMANCE].name) if(stack.visible_child_name == views[Views.PERFORMANCE].name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment