Skip to content

Commit

Permalink
Merge pull request #148 from cristian64/watch_group_icons
Browse files Browse the repository at this point in the history
Add icon to watch groups.
  • Loading branch information
dreamsyntax authored May 19, 2024
2 parents 31d2a0e + 10fcc8a commit c7d0d7f
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/GUI/MemWatcher/MemWatchModel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "MemWatchModel.h"

#include <QDataStream>
#include <QIcon>
#include <QMimeData>

#include <cassert>
Expand Down Expand Up @@ -277,6 +278,12 @@ QVariant MemWatchModel::data(const QModelIndex& index, int role) const
{
if (index.column() == 0 && (role == Qt::DisplayRole || role == Qt::EditRole))
return item->getGroupName();
if (index.column() == 0 && role == Qt::DecorationRole)
{
static const QIcon s_folderIcon(":/folder.svg");
static const QIcon s_emptyFolderIcon(":/folder_empty.svg");
return item->hasChildren() ? s_folderIcon : s_emptyFolderIcon;
}
}
return {};
}
Expand Down
45 changes: 45 additions & 0 deletions Source/Resources/folder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions Source/Resources/folder_empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Source/Resources/resource.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/">
<file>folder_empty.svg</file>
<file>folder.svg</file>
<file>logo.svg</file>
</qresource>
</RCC>

0 comments on commit c7d0d7f

Please sign in to comment.