[gnome-boxes] list-view-row: Don't disable status_label for styling
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] list-view-row: Don't disable status_label for styling
- Date: Sat, 29 Aug 2015 22:21:57 +0000 (UTC)
commit 4ba9352ac7db92d584c1409eabd6e7fa3922be13
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Sat Aug 29 13:53:33 2015 +0100
list-view-row: Don't disable status_label for styling
Instead of disabling the status_label, add/remove style classes to it.
https://bugzilla.gnome.org/show_bug.cgi?id=753888
src/list-view-row.vala | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/list-view-row.vala b/src/list-view-row.vala
index 314cf2a..db702dc 100644
--- a/src/list-view-row.vala
+++ b/src/list-view-row.vala
@@ -114,26 +114,33 @@ private class Boxes.ListViewRow: Gtk.Box {
private void update_status () {
if (machine is RemoteMachine) {
status_label.label = machine.is_connected ? _("connected"): _("disconnected");
- status_label.sensitive = machine.is_connected;
+ update_status_label_style (!machine.is_connected);
return;
}
if (machine.is_running) {
status_label.label = _("running");
- status_label.sensitive = true;
+ update_status_label_style (false);
return;
}
if (machine.is_on) {
status_label.label = _("paused");
- status_label.sensitive = false;
+ update_status_label_style (true);
return;
}
status_label.label = _("powered off");
- status_label.sensitive = false;
+ update_status_label_style (true);
+ }
+
+ private void update_status_label_style (bool dim) {
+ if (dim)
+ status_label.get_style_context ().add_class ("dim-label");
+ else
+ status_label.get_style_context ().remove_class ("dim-label");
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]