2017-02-07 22:06:28 +00:00
|
|
|
/*
|
|
|
|
* This file Copyright (C) 2017 Mnemosyne LLC
|
|
|
|
*
|
|
|
|
* It may be used under the GNU GPL versions 2 or 3
|
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "StyleHelper.h"
|
|
|
|
|
2017-04-19 12:04:45 +00:00
|
|
|
QIcon::Mode StyleHelper::getIconMode(QStyle::State state)
|
2017-02-07 22:06:28 +00:00
|
|
|
{
|
2017-04-19 12:04:45 +00:00
|
|
|
if ((state & QStyle::State_Enabled) == 0)
|
|
|
|
{
|
|
|
|
return QIcon::Disabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((state & QStyle::State_Selected) != 0)
|
|
|
|
{
|
|
|
|
return QIcon::Selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
return QIcon::Normal;
|
2017-02-07 22:06:28 +00:00
|
|
|
}
|