Commit 3f505da4 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Color staged status as green, otherwise red

parent bb854ebe
......@@ -74,7 +74,7 @@ QVariant GitStatusModel::data(const QModelIndex &index, int role) const
return {};
}
auto row = index.row();
const int row = index.row();
if (index.internalId() == Root) {
if (role == Qt::DisplayRole) {
......@@ -137,6 +137,12 @@ QVariant GitStatusModel::data(const QModelIndex &index, int role) const
} else {
return Qt::AlignRight;
}
} else if (role == Qt::ForegroundRole) {
if (index.column() == 1 && rootIndex > 0) {
return QColor(Qt::red);
  • I suggest to use some Breeze colors here for red and green: https://hig.kde.org/style/color/default.html

    @waqar

  • Sure, I have changed to Breeze fg-positive and Breeze-fg-negative for now. Not sure how it will work if one changes the theme. Is there some way we can access the current desktop theme's palette?

Please register or sign in to reply
} else if (index.column() == 1 && rootIndex == 0) {
return QColor(Qt::green);
}
}
}
......
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