This commit is contained in:
DavidXanatos 2023-01-28 21:49:24 +01:00
parent e23b0266e4
commit effaaea8f6
9 changed files with 22 additions and 14 deletions

View File

@ -2283,8 +2283,8 @@ __declspec(dllimport) NTSTATUS RtlGetGroupSecurityDescriptor(
PSID* Group, PBOOLEAN GroupDefaulted
);
__declspec(dllimport) BOOLEAN RtlEqualSid(PSID Sid1, PSID Sid2);
__declspec(dllimport) PVOID RtlFreeSid(PSID Sid);
__declspec(dllimport) BOOLEAN NTAPI RtlEqualSid(PSID Sid1, PSID Sid2);
__declspec(dllimport) PVOID NTAPI RtlFreeSid(PSID Sid);
//---------------------------------------------------------------------------

View File

@ -261,8 +261,8 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
else {
pNode->busyState = 0;
if(boxDel && !bVintage)
Icon = theGUI->MakeIconRecycle(Icon);
if (boxDel && !bVintage)
Icon = theGUI->IconAddOverlay(Icon, ":/Boxes/AutoDel");
}
if (m_LargeIcons) // but not for boxes
@ -383,9 +383,16 @@ bool CSbieModel::Sync(const CSandBoxPtr& pBox, const QList<QVariant>& Path, cons
//else
// pNode->Icon = icons.first().pixmap;
pNode->Icon = m_IconProvider.icon(QFileInfo(pProcess->GetFileName()));
if (pNode->Icon.isNull() || !pNode->Icon.isValid())
pNode->Icon = m_ExeIcon;
QIcon Icon = m_IconProvider.icon(QFileInfo(pProcess->GetFileName()));
if (Icon.isNull())
Icon = m_ExeIcon;
if(pProcess->HasSystemToken())
Icon = theGUI->IconAddOverlay(Icon, ":/Actions/SystemShield.png", 20);
else if(pProcess->HasElevatedToken())
Icon = theGUI->IconAddOverlay(Icon, ":/Actions/AdminShield.png", 20);
pNode->Icon = Icon;
Changed = 1;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -136,6 +136,9 @@
<file>Actions/BFance.png</file>
<file>Actions/Shield16.png</file>
<file>Actions/Editor.png</file>
<file>Actions/USB.png</file>
<file>Actions/SystemShield.png</file>
<file>Actions/AdminShield.png</file>
</qresource>
<qresource prefix="/Boxes">
<file alias="Empty3">Boxes/sandbox-b-empty.png</file>

View File

@ -1201,11 +1201,9 @@ QIcon CSandMan::MakeIconBusy(const QIcon& Icon, int Index)
return QIcon(result);
}
QIcon CSandMan::MakeIconRecycle(const QIcon& Icon)
QIcon CSandMan::IconAddOverlay(const QIcon& Icon, const QString& Name, int Size)
{
static QPixmap overlay;
if(overlay.isNull())
overlay = QPixmap(":/Boxes/AutoDel");
QPixmap overlay = QPixmap(Name).scaled(Size, Size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
QPixmap base = Icon.pixmap(32, 32);
QPixmap result(base.width(), base.height());
@ -1213,7 +1211,7 @@ QIcon CSandMan::MakeIconRecycle(const QIcon& Icon)
QPainter painter(&result);
painter.drawPixmap(0, 0, base);
painter.drawPixmap(8, 8, overlay);
painter.drawPixmap(32 - Size, 32 - Size, overlay);
return QIcon(result);
}

View File

@ -69,7 +69,7 @@ public:
QRgb GetBoxColor(int boxType) { return m_BoxColors[boxType]; }
QIcon GetColorIcon(QColor boxColor, bool inUse = false/*, bool bOut = false*/);
QIcon MakeIconBusy(const QIcon& Icon, int Index = 0);
QIcon MakeIconRecycle(const QIcon& Icon);
QIcon IconAddOverlay(const QIcon& Icon, const QString& Name, int Size = 24);
QString GetBoxDescription(int boxType);
bool CheckCertificate(QWidget* pWidget);

View File

@ -156,4 +156,4 @@ void CSbieProcess::InitProcessInfoImpl(void* ProcessHandle)
CloseHandle(TokenHandle);
}
}
}