From c8ad6d6fadf6bd1402e8faab1f21f85c87047c5f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 29 Mar 2016 17:13:37 +0200 Subject: Use foreground instead of background for marking unusable vms --- src/session.h | 2 +- src/sessiontreemodel.cpp | 4 ++-- src/vsession.cpp | 6 +++--- src/vsession.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/session.h b/src/session.h index c490d88..907fbaa 100644 --- a/src/session.h +++ b/src/session.h @@ -30,7 +30,7 @@ class Session { virtual int type() const = 0; virtual SectionType section() const = 0; virtual bool is64Bit() const { return false; } - virtual QVariant backgroundRole() const { return QVariant(); } + virtual QVariant foregroundRole() const { return QVariant(); } virtual bool operator<(const Session& s) const = 0; diff --git a/src/sessiontreemodel.cpp b/src/sessiontreemodel.cpp index 08b43e4..ac60ee9 100644 --- a/src/sessiontreemodel.cpp +++ b/src/sessiontreemodel.cpp @@ -53,8 +53,8 @@ QVariant SessionTreeModel::data(const QModelIndex &index, int role) const { return s->shortDescription(); if (role == Qt::ToolTipRole) return s->description(); - if (role == Qt::BackgroundRole) - return s->backgroundRole(); + if (role == Qt::ForegroundRole) + return s->foregroundRole(); if (role == Qt::DecorationRole) { if (index.column() == 0) { // TODO: is this line needed? return s->icon(); diff --git a/src/vsession.cpp b/src/vsession.cpp index ef0e191..4c53c5a 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -430,10 +430,10 @@ bool VSession::is64Bit() const { // TODO: vmbox, qemu-kvm, ... } -QVariant VSession::backgroundRole() const { +QVariant VSession::foregroundRole() const { if (!g_noVtx || !is64Bit()) - return Session::backgroundRole(); - return QColor(200, 200, 200); + return Session::foregroundRole(); + return QColor(180, 180, 180); } bool VSession::operator<(const Session& other) const { diff --git a/src/vsession.h b/src/vsession.h index 820b411..f20b111 100644 --- a/src/vsession.h +++ b/src/vsession.h @@ -60,7 +60,7 @@ class VSession : public Session { } bool is64Bit() const; - QVariant backgroundRole() const; + QVariant foregroundRole() const; QString getAttribute(const QString& nodeName, const QString& attribute = "param") const; -- cgit v1.2.3-55-g7522