mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Hide mono icon options if the resource has no mono icons
This commit is contained in:
parent
e89bdfc422
commit
697e355f07
@ -21,6 +21,7 @@
|
||||
#include "mirall/mirallconfigfile.h"
|
||||
|
||||
#include <QNetworkProxy>
|
||||
#include <QDir>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
@ -49,6 +50,16 @@ GeneralSettings::GeneralSettings(QWidget *parent) :
|
||||
|
||||
// misc
|
||||
connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
|
||||
|
||||
// OEM themes are not obliged to ship mono icons, so there
|
||||
// is no point in offering an option
|
||||
QString themeDir = QString::fromLatin1(":/mirall/theme/1%1/")
|
||||
.arg(Theme::instance()->systrayIconFlavor(true));
|
||||
if (QDir(themeDir).exists())
|
||||
{
|
||||
_ui->monoIconsCheckBox->setVisible(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GeneralSettings::~GeneralSettings()
|
||||
|
||||
@ -94,12 +94,8 @@ QIcon Theme::trayFolderIcon( const QString& backend ) const
|
||||
QIcon Theme::themeIcon( const QString& name, bool sysTray ) const
|
||||
{
|
||||
QString flavor;
|
||||
if (sysTray && _mono) {
|
||||
#ifdef Q_OS_MAC
|
||||
flavor = QLatin1String("black");
|
||||
#else
|
||||
flavor = QLatin1String("white");
|
||||
#endif
|
||||
if (sysTray) {
|
||||
flavor = systrayIconFlavor(_mono);
|
||||
} else {
|
||||
flavor = QLatin1String("colored");
|
||||
}
|
||||
@ -158,6 +154,21 @@ QString Theme::defaultClientFolder() const
|
||||
return appName();
|
||||
}
|
||||
|
||||
QString Theme::systrayIconFlavor(bool mono) const
|
||||
{
|
||||
QString flavor;
|
||||
if (mono) {
|
||||
#ifdef Q_OS_MAC
|
||||
flavor = QLatin1String("black");
|
||||
#else
|
||||
flavor = QLatin1String("white");
|
||||
#endif
|
||||
} else {
|
||||
flavor = QLatin1String("colored");
|
||||
}
|
||||
return flavor;
|
||||
}
|
||||
|
||||
void Theme::setSystrayUseMonoIcons(bool mono)
|
||||
{
|
||||
_mono = mono;
|
||||
|
||||
@ -119,6 +119,8 @@ public:
|
||||
*/
|
||||
virtual QString enforcedLocale() const { return QString::null; }
|
||||
|
||||
/** colored, white or black */
|
||||
QString systrayIconFlavor(bool mono) const;
|
||||
|
||||
/**
|
||||
* Override to use a string or a custom image name.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user