2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2017-2022 Mnemosyne LLC.
|
2022-02-07 16:25:02 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
2022-01-20 18:27:56 +00:00
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2017-02-07 22:06:28 +00:00
|
|
|
|
|
|
|
#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
|
|
|
}
|