2022-01-20 12:27:56 -06:00
|
|
|
// This file Copyright © 2017-2022 Mnemosyne LLC.
|
2022-02-07 10:25:02 -06:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 12:27:56 -06:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2017-02-08 01:06:28 +03:00
|
|
|
|
|
|
|
#include "StyleHelper.h"
|
|
|
|
|
2017-04-19 15:04:45 +03:00
|
|
|
QIcon::Mode StyleHelper::getIconMode(QStyle::State state)
|
2017-02-08 01:06:28 +03:00
|
|
|
{
|
2019-02-10 14:05:16 +03:00
|
|
|
if (!state.testFlag(QStyle::State_Enabled))
|
2017-04-19 15:04:45 +03:00
|
|
|
{
|
|
|
|
return QIcon::Disabled;
|
|
|
|
}
|
|
|
|
|
2019-02-10 14:05:16 +03:00
|
|
|
if (state.testFlag(QStyle::State_Selected))
|
2017-04-19 15:04:45 +03:00
|
|
|
{
|
|
|
|
return QIcon::Selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
return QIcon::Normal;
|
2017-02-08 01:06:28 +03:00
|
|
|
}
|