[gnome-usage] Add icons to the pages
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] Add icons to the pages
- Date: Wed, 24 Jun 2020 13:10:19 +0000 (UTC)
commit 058112190c4b33bc0c578bf7918d6e3b00872ad5
Author: Adrien Plazas <kekun plazas laposte net>
Date: Tue Sep 10 19:16:19 2019 +0200
Add icons to the pages
This makes the view switcher look better.
src/performance-view.vala | 1 +
src/storage/storage-view.vala | 1 +
src/view.vala | 1 +
src/window.vala | 4 +++-
4 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/performance-view.vala b/src/performance-view.vala
index ca30809..555dbde 100644
--- a/src/performance-view.vala
+++ b/src/performance-view.vala
@@ -46,6 +46,7 @@ namespace Usage
{
name = "PERFORMANCE";
title = _("Performance");
+ icon_name = "speedometer-symbolic";
sub_views = new View[]
{
diff --git a/src/storage/storage-view.vala b/src/storage/storage-view.vala
index 6449c1a..6e11780 100644
--- a/src/storage/storage-view.vala
+++ b/src/storage/storage-view.vala
@@ -76,6 +76,7 @@ public class Usage.StorageView : Usage.View {
construct {
name = "STORAGE";
title = _("Storage");
+ icon_name = "drive-harddisk-symbolic";
try {
connection = Sparql.Connection.get ();
diff --git a/src/view.vala b/src/view.vala
index e1c8f98..997197c 100644
--- a/src/view.vala
+++ b/src/view.vala
@@ -23,6 +23,7 @@ namespace Usage
public abstract class View : Gtk.Bin
{
public string title;
+ public string icon_name;
protected View ()
{
diff --git a/src/window.vala b/src/window.vala
index 338eb29..6b00116 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -66,8 +66,10 @@ namespace Usage
new StorageView(),
};
- foreach(var view in views)
+ foreach(var view in views) {
stack.add_titled(view, view.name, view.title);
+ stack.child_set (view, "icon-name", view.icon_name, null);
+ }
stack.notify.connect(() => {
if(stack.visible_child_name == views[Views.PERFORMANCE].name)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]