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
|
|
|
{
|
2019-02-10 11:05:16 +00:00
|
|
|
if (!state.testFlag(QStyle::State_Enabled))
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
|
|
|
return QIcon::Disabled;
|
|
|
|
}
|
|
|
|
|
2019-02-10 11:05:16 +00:00
|
|
|
if (state.testFlag(QStyle::State_Selected))
|
2017-04-19 12:04:45 +00:00
|
|
|
{
|
|
|
|
return QIcon::Selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
return QIcon::Normal;
|
2017-02-07 22:06:28 +00:00
|
|
|
}
|