diff --git a/linphone-app/src/app/App.cpp b/linphone-app/src/app/App.cpp index ada828a34..1eea44294 100644 --- a/linphone-app/src/app/App.cpp +++ b/linphone-app/src/app/App.cpp @@ -20,7 +20,7 @@ #include "App.hpp" #ifdef Q_OS_WIN - #include +#include #endif // ifdef Q_OS_WIN #include #include @@ -61,736 +61,738 @@ using namespace std; namespace { - #ifdef Q_OS_LINUX - const QString AutoStartDirectory(QDir::homePath().append(QStringLiteral("/.config/autostart/"))); - #elif defined(Q_OS_MACOS) - const QString OsascriptExecutable(QStringLiteral("osascript")); - #else - const QString AutoStartSettingsFilePath( - QStringLiteral("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run") - ); - #endif // ifdef Q_OS_LINUX +#ifdef Q_OS_LINUX +const QString AutoStartDirectory(QDir::homePath().append(QStringLiteral("/.config/autostart/"))); +#elif defined(Q_OS_MACOS) +const QString OsascriptExecutable(QStringLiteral("osascript")); +#else +const QString AutoStartSettingsFilePath( + QStringLiteral("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run") + ); +#endif // ifdef Q_OS_LINUX } // ----------------------------------------------------------------------------- #ifdef Q_OS_LINUX - static inline bool autoStartEnabled () { - return QDir(AutoStartDirectory).exists() && QFile(AutoStartDirectory + EXECUTABLE_NAME ".desktop").exists(); - } +static inline bool autoStartEnabled () { + return QDir(AutoStartDirectory).exists() && QFile(AutoStartDirectory + EXECUTABLE_NAME ".desktop").exists(); +} #elif defined(Q_OS_MACOS) - static inline QString getMacOsBundlePath () { - QDir dir(QCoreApplication::applicationDirPath()); - if (dir.dirName() != QLatin1String("MacOS")) - return QString(); +static inline QString getMacOsBundlePath () { + QDir dir(QCoreApplication::applicationDirPath()); + if (dir.dirName() != QLatin1String("MacOS")) + return QString(); + + dir.cdUp(); + dir.cdUp(); + + QString path(dir.path()); + if (path.length() > 0 && path.right(1) == "/") + path.chop(1); + return path; +} - dir.cdUp(); - dir.cdUp(); +static inline QString getMacOsBundleName () { + return QFileInfo(getMacOsBundlePath()).baseName(); +} - QString path(dir.path()); - if (path.length() > 0 && path.right(1) == "/") - path.chop(1); - return path; - } - - static inline QString getMacOsBundleName () { - return QFileInfo(getMacOsBundlePath()).baseName(); - } - - static inline bool autoStartEnabled () { - const QByteArray expectedWord(getMacOsBundleName().toUtf8()); - if (expectedWord.isEmpty()) { - qInfo() << QStringLiteral("Application is not installed. Autostart unavailable."); - return false; - } - - QProcess process; - process.start(OsascriptExecutable, { "-e", "tell application \"System Events\" to get the name of every login item" }); - if (!process.waitForFinished()) { - qWarning() << QStringLiteral("Unable to execute properly: `%1` (%2).").arg(OsascriptExecutable).arg(process.errorString()); - return false; - } - - // TODO: Move in utils? - const QByteArray buf(process.readAll()); - for (const char *p = buf.data(), *word = p, *end = p + buf.length(); p <= end; ++p) { - switch (*p) { - case ' ': - case '\r': - case '\n': - case '\t': - case '\0': - if (word != p) { - if (!strncmp(word, expectedWord, size_t(p - word))) - return true; - word = p + 1; - } - default: - break; - } - } - - return false; - } +static inline bool autoStartEnabled () { + const QByteArray expectedWord(getMacOsBundleName().toUtf8()); + if (expectedWord.isEmpty()) { + qInfo() << QStringLiteral("Application is not installed. Autostart unavailable."); + return false; + } + + QProcess process; + process.start(OsascriptExecutable, { "-e", "tell application \"System Events\" to get the name of every login item" }); + if (!process.waitForFinished()) { + qWarning() << QStringLiteral("Unable to execute properly: `%1` (%2).").arg(OsascriptExecutable).arg(process.errorString()); + return false; + } + + // TODO: Move in utils? + const QByteArray buf(process.readAll()); + for (const char *p = buf.data(), *word = p, *end = p + buf.length(); p <= end; ++p) { + switch (*p) { + case ' ': + case '\r': + case '\n': + case '\t': + case '\0': + if (word != p) { + if (!strncmp(word, expectedWord, size_t(p - word))) + return true; + word = p + 1; + } + default: + break; + } + } + + return false; +} #else - static inline bool autoStartEnabled () { - return QSettings(AutoStartSettingsFilePath, QSettings::NativeFormat).value(EXECUTABLE_NAME).isValid(); - } +static inline bool autoStartEnabled () { + return QSettings(AutoStartSettingsFilePath, QSettings::NativeFormat).value(EXECUTABLE_NAME).isValid(); +} #endif // ifdef Q_OS_LINUX // ----------------------------------------------------------------------------- static inline bool installLocale (App &app, QTranslator &translator, const QLocale &locale) { - return translator.load(locale, Constants::LanguagePath) && app.installTranslator(&translator); + return translator.load(locale, Constants::LanguagePath) && app.installTranslator(&translator); } static inline string getConfigPathIfExists (const QCommandLineParser &parser) { - QString filePath = parser.value("config"); - string configPath; - if(!QUrl(filePath).isRelative()){ - configPath = Utils::appStringToCoreString(FileDownloader::synchronousDownload(filePath, Utils::coreStringToAppString(Paths::getConfigDirPath(false)), true)); - } - if( configPath == "") - configPath = Paths::getConfigFilePath(filePath, false); - if( configPath == "" ) - configPath = Paths::getConfigFilePath("", false); - return configPath; + QString filePath = parser.value("config"); + string configPath; + if(!QUrl(filePath).isRelative()){ + configPath = Utils::appStringToCoreString(FileDownloader::synchronousDownload(filePath, Utils::coreStringToAppString(Paths::getConfigDirPath(false)), true)); + } + if( configPath == "") + configPath = Paths::getConfigFilePath(filePath, false); + if( configPath == "" ) + configPath = Paths::getConfigFilePath("", false); + return configPath; } static inline shared_ptr getConfigIfExists (const string &configPath) { - string factoryPath(Paths::getFactoryConfigFilePath()); - if (!Paths::filePathExists(factoryPath)) - factoryPath.clear(); - - return linphone::Config::newWithFactory(configPath, factoryPath); + string factoryPath(Paths::getFactoryConfigFilePath()); + if (!Paths::filePathExists(factoryPath)) + factoryPath.clear(); + + return linphone::Config::newWithFactory(configPath, factoryPath); } bool App::setFetchConfig (QCommandLineParser *parser) { - bool fetched = false; - QString filePath = parser->value("fetch-config"); - if( !filePath.isEmpty()){ - if(QUrl(filePath).isRelative()){// this is a file path - filePath = Utils::coreStringToAppString(Paths::getConfigFilePath(filePath, false)); - if(!filePath.isEmpty()) - filePath = "file://"+filePath; - } - if(!filePath.isEmpty()){ - auto instance = CoreManager::getInstance(); - if(instance){ - auto core = instance->getCore(); - if(core){ - filePath.replace('\\','/'); - if(core->setProvisioningUri(Utils::appStringToCoreString(filePath)) == 0){ - parser->process(cleanParserKeys(parser, QStringList("fetch-config")));// Remove this parameter from the parser - fetched = true; - }else - fetched = false; - } - } - } - if(!fetched){ - qWarning() <<"Remote provisionning cannot be retrieved. Command have beend cleaned"; - createParser(); - } - } - return fetched; + bool fetched = false; + QString filePath = parser->value("fetch-config"); + if( !filePath.isEmpty()){ + if(QUrl(filePath).isRelative()){// this is a file path + filePath = Utils::coreStringToAppString(Paths::getConfigFilePath(filePath, false)); + if(!filePath.isEmpty()) + filePath = "file://"+filePath; + } + if(!filePath.isEmpty()){ + auto instance = CoreManager::getInstance(); + if(instance){ + auto core = instance->getCore(); + if(core){ + filePath.replace('\\','/'); + if(core->setProvisioningUri(Utils::appStringToCoreString(filePath)) == 0){ + parser->process(cleanParserKeys(parser, QStringList("fetch-config")));// Remove this parameter from the parser + fetched = true; + }else + fetched = false; + } + } + } + if(!fetched){ + qWarning() <<"Remote provisionning cannot be retrieved. Command have beend cleaned"; + createParser(); + } + } + return fetched; } // ----------------------------------------------------------------------------- App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true, Mode::User | Mode::ExcludeAppPath | Mode::ExcludeAppVersion) { - - connect(this, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(stateChanged(Qt::ApplicationState))); - - setWindowIcon(QIcon(Constants::WindowIconPath)); - - createParser(); - mParser->process(*this); - - // Initialize logger. - shared_ptr config = getConfigIfExists(getConfigPathIfExists(*mParser)); - Logger::init(config); - if (mParser->isSet("verbose")) - Logger::getInstance()->setVerbose(true); - - // List available locales. - for (const auto &locale : QDir(Constants::LanguagePath).entryList()) - mAvailableLocales << QLocale(locale); - - // Init locale. - mTranslator = new DefaultTranslator(this); - mDefaultTranslator = new DefaultTranslator(this); - initLocale(config); - - if (mParser->isSet("help")) { - mParser->showHelp(); - } - - if (mParser->isSet("cli-help")) { - Cli::showHelp(); - ::exit(EXIT_SUCCESS); - } - - if (mParser->isSet("version")) - mParser->showVersion(); - - mAutoStart = autoStartEnabled(); - - qInfo() << QStringLiteral("Starting " APPLICATION_NAME " (bin: " EXECUTABLE_NAME ")"); - qInfo() << QStringLiteral("Use locale: %1").arg(mLocale); + + connect(this, SIGNAL(applicationStateChanged(Qt::ApplicationState)), this, SLOT(stateChanged(Qt::ApplicationState))); + + setWindowIcon(QIcon(Constants::WindowIconPath)); + + createParser(); + mParser->process(*this); + + // Initialize logger. + shared_ptr config = getConfigIfExists(getConfigPathIfExists(*mParser)); + Logger::init(config); + if (mParser->isSet("verbose")) + Logger::getInstance()->setVerbose(true); + + // List available locales. + for (const auto &locale : QDir(Constants::LanguagePath).entryList()) + mAvailableLocales << QLocale(locale); + + // Init locale. + mTranslator = new DefaultTranslator(this); + mDefaultTranslator = new DefaultTranslator(this); + initLocale(config); + + if (mParser->isSet("help")) { + mParser->showHelp(); + } + + if (mParser->isSet("cli-help")) { + Cli::showHelp(); + ::exit(EXIT_SUCCESS); + } + + if (mParser->isSet("version")) + mParser->showVersion(); + + mAutoStart = autoStartEnabled(); + + qInfo() << QStringLiteral("Starting " APPLICATION_NAME " (bin: " EXECUTABLE_NAME ")"); + qInfo() << QStringLiteral("Use locale: %1").arg(mLocale); } App::~App () { - qInfo() << QStringLiteral("Destroying app..."); - delete mEngine; - delete mParser; + qInfo() << QStringLiteral("Destroying app..."); + delete mEngine; + delete mParser; } // ----------------------------------------------------------------------------- QStringList App::cleanParserKeys(QCommandLineParser * parser, QStringList keys){ - QStringList oldArguments = parser->optionNames(); - QStringList parameters; - parameters << "dummy"; - for(int i = 0 ; i < oldArguments.size() ; ++i){ - if( !keys.contains(oldArguments[i])){ - if( mParser->value(oldArguments[i]).isEmpty()) - parameters << "--"+oldArguments[i]; - else - parameters << "--"+oldArguments[i]+"="+parser->value(oldArguments[i]); - } - } - return parameters; + QStringList oldArguments = parser->optionNames(); + QStringList parameters; + parameters << "dummy"; + for(int i = 0 ; i < oldArguments.size() ; ++i){ + if( !keys.contains(oldArguments[i])){ + if( mParser->value(oldArguments[i]).isEmpty()) + parameters << "--"+oldArguments[i]; + else + parameters << "--"+oldArguments[i]+"="+parser->value(oldArguments[i]); + } + } + return parameters; } void App::processArguments(QHash args){ - QList keys = args.keys(); - QStringList parameters = cleanParserKeys(mParser, keys); - for(auto i = keys.begin() ; i != keys.end() ; ++i){ - parameters << "--"+(*i)+"="+args.value(*i); - } - mParser->process(parameters); + QList keys = args.keys(); + QStringList parameters = cleanParserKeys(mParser, keys); + for(auto i = keys.begin() ; i != keys.end() ; ++i){ + parameters << "--"+(*i)+"="+args.value(*i); + } + mParser->process(parameters); } static QQuickWindow *createSubWindow (QQmlApplicationEngine *engine, const char *path) { - qInfo() << QStringLiteral("Creating subwindow: `%1`.").arg(path); - - QQmlComponent component(engine, QUrl(path)); - if (component.isError()) { - qWarning() << component.errors(); - abort(); - } - qInfo() << QStringLiteral("Subwindow status: `%1`.").arg(component.status()); - - QObject *object = component.create(); - Q_ASSERT(object); - - QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); - object->setParent(engine); - - return qobject_cast(object); + qInfo() << QStringLiteral("Creating subwindow: `%1`.").arg(path); + + QQmlComponent component(engine, QUrl(path)); + if (component.isError()) { + qWarning() << component.errors(); + abort(); + } + qInfo() << QStringLiteral("Subwindow status: `%1`.").arg(component.status()); + + QObject *object = component.create(); + Q_ASSERT(object); + + QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); + object->setParent(engine); + + return qobject_cast(object); } // ----------------------------------------------------------------------------- void App::initContentApp () { - std::string configPath; - shared_ptr config; - bool mustBeIconified = false; - bool needRestart = true; - - // Destroy qml components and linphone core if necessary. - if (mEngine) { - needRestart = false; - setFetchConfig(mParser); - setOpened(false); - qInfo() << QStringLiteral("Restarting app..."); - delete mEngine; - - mNotifier = nullptr; - mSystemTrayIcon = nullptr; - // - CoreManager::uninit(); - removeTranslator(mTranslator); - removeTranslator(mDefaultTranslator); - delete mTranslator; - delete mDefaultTranslator; - mTranslator = new DefaultTranslator(this); - mDefaultTranslator = new DefaultTranslator(this); - configPath = getConfigPathIfExists(*mParser); - config = getConfigIfExists(configPath); - initLocale(config); - } else { - configPath = getConfigPathIfExists(*mParser); - config = getConfigIfExists(configPath); - // Update and download codecs. - VideoCodecsModel::updateCodecs(); - VideoCodecsModel::downloadUpdatableCodecs(this); - - // Don't quit if last window is closed!!! - setQuitOnLastWindowClosed(false); - - // Deal with received messages and CLI. - QObject::connect(this, &App::receivedMessage, this, [](int, const QByteArray &byteArray) { - QString command(byteArray); - qInfo() << QStringLiteral("Received command from other application: `%1`.").arg(command); - Cli::executeCommand(command); - }); - - #ifndef Q_OS_MACOS - mustBeIconified = mParser->isSet("iconified"); - #endif // ifndef Q_OS_MACOS - mColorListModel = new ColorListModel(); - mImageListModel = new ImageListModel(); - } - - // Change colors if necessary. - mColorListModel->useConfig(config); - mImageListModel->useConfig(config); - - // Init core. - CoreManager::init(this, Utils::coreStringToAppString(configPath)); - - - // Init engine content. - mEngine = new QQmlApplicationEngine(); - - // Provide `+custom` folders for custom components and `5.9` for old components. - { - QStringList selectors("custom"); - const QVersionNumber &version = QLibraryInfo::version(); - if (version.majorVersion() == 5 && version.minorVersion() == 9) - selectors.push_back("5.9"); - (new QQmlFileSelector(mEngine, mEngine))->setExtraSelectors(selectors); - } - qInfo() << QStringLiteral("Activated selectors:") << QQmlFileSelector::get(mEngine)->selector()->allSelectors(); - - // Set modules paths. - mEngine->addImportPath(":/ui/modules"); - mEngine->addImportPath(":/ui/scripts"); - mEngine->addImportPath(":/ui/views"); - - // Provide avatars/thumbnails providers. - mEngine->addImageProvider(AvatarProvider::ProviderId, new AvatarProvider()); - mEngine->addImageProvider(ImageProvider::ProviderId, new ImageProvider()); - mEngine->addImageProvider(ExternalImageProvider::ProviderId, new ExternalImageProvider()); - mEngine->addImageProvider(ThumbnailProvider::ProviderId, new ThumbnailProvider()); - - mEngine->rootContext()->setContextProperty("applicationUrl", APPLICATION_URL); - mEngine->rootContext()->setContextProperty("Colors", mColorListModel->getQmlData()); - mEngine->rootContext()->setContextProperty("Images", mImageListModel->getQmlData()); - - registerTypes(); - registerSharedTypes(); - registerToolTypes(); - registerSharedToolTypes(); - - // Enable notifications. - mNotifier = new Notifier(mEngine); - - // Load main view. - qInfo() << QStringLiteral("Loading main view..."); - mEngine->load(QUrl(Constants::QmlViewMainWindow)); - if (mEngine->rootObjects().isEmpty()) - qFatal("Unable to open main window."); - - QObject::connect( - CoreManager::getInstance(), - &CoreManager::coreManagerInitialized, CoreManager::getInstance(), - [this, mustBeIconified]() mutable { - if(CoreManager::getInstance()->started()) - openAppAfterInit(mustBeIconified); - } - ); - - // Execute command argument if needed. - const QString commandArgument = getCommandArgument(); - if (!commandArgument.isEmpty()) { - Cli::CommandFormat format; - Cli::executeCommand(commandArgument, &format); - if (format == Cli::UriFormat || format == Cli::UrlFormat ) - mustBeIconified = true; - } + std::string configPath; + shared_ptr config; + bool mustBeIconified = false; + bool needRestart = true; + + // Destroy qml components and linphone core if necessary. + if (mEngine) { + needRestart = false; + setFetchConfig(mParser); + setOpened(false); + qInfo() << QStringLiteral("Restarting app..."); + delete mEngine; + + mNotifier = nullptr; + mSystemTrayIcon = nullptr; + // + CoreManager::uninit(); + removeTranslator(mTranslator); + removeTranslator(mDefaultTranslator); + delete mTranslator; + delete mDefaultTranslator; + mTranslator = new DefaultTranslator(this); + mDefaultTranslator = new DefaultTranslator(this); + configPath = getConfigPathIfExists(*mParser); + config = getConfigIfExists(configPath); + initLocale(config); + } else { + configPath = getConfigPathIfExists(*mParser); + config = getConfigIfExists(configPath); + // Update and download codecs. + VideoCodecsModel::updateCodecs(); + VideoCodecsModel::downloadUpdatableCodecs(this); + + // Don't quit if last window is closed!!! + setQuitOnLastWindowClosed(false); + + // Deal with received messages and CLI. + QObject::connect(this, &App::receivedMessage, this, [](int, const QByteArray &byteArray) { + QString command(byteArray); + qInfo() << QStringLiteral("Received command from other application: `%1`.").arg(command); + Cli::executeCommand(command); + }); + +#ifndef Q_OS_MACOS + mustBeIconified = mParser->isSet("iconified"); +#endif // ifndef Q_OS_MACOS + mColorListModel = new ColorListModel(); + mImageListModel = new ImageListModel(); + } + + // Change colors if necessary. + mColorListModel->useConfig(config); + mImageListModel->useConfig(config); + + // Init core. + CoreManager::init(this, Utils::coreStringToAppString(configPath)); + + + // Init engine content. + mEngine = new QQmlApplicationEngine(); + + // Provide `+custom` folders for custom components and `5.9` for old components. + { + QStringList selectors("custom"); + const QVersionNumber &version = QLibraryInfo::version(); + if (version.majorVersion() == 5 && version.minorVersion() == 9) + selectors.push_back("5.9"); + (new QQmlFileSelector(mEngine, mEngine))->setExtraSelectors(selectors); + } + qInfo() << QStringLiteral("Activated selectors:") << QQmlFileSelector::get(mEngine)->selector()->allSelectors(); + + // Set modules paths. + mEngine->addImportPath(":/ui/modules"); + mEngine->addImportPath(":/ui/scripts"); + mEngine->addImportPath(":/ui/views"); + + // Provide avatars/thumbnails providers. + mEngine->addImageProvider(AvatarProvider::ProviderId, new AvatarProvider()); + mEngine->addImageProvider(ImageProvider::ProviderId, new ImageProvider()); + mEngine->addImageProvider(ExternalImageProvider::ProviderId, new ExternalImageProvider()); + mEngine->addImageProvider(ThumbnailProvider::ProviderId, new ThumbnailProvider()); + + mEngine->rootContext()->setContextProperty("applicationUrl", APPLICATION_URL); + mEngine->rootContext()->setContextProperty("Colors", mColorListModel->getQmlData()); + mEngine->rootContext()->setContextProperty("Images", mImageListModel->getQmlData()); + + registerTypes(); + registerSharedTypes(); + registerToolTypes(); + registerSharedToolTypes(); + + // Enable notifications. + mNotifier = new Notifier(mEngine); + + // Load main view. + qInfo() << QStringLiteral("Loading main view..."); + mEngine->load(QUrl(Constants::QmlViewMainWindow)); + if (mEngine->rootObjects().isEmpty()) + qFatal("Unable to open main window."); + + QObject::connect( + CoreManager::getInstance(), + &CoreManager::coreManagerInitialized, CoreManager::getInstance(), + [this, mustBeIconified]() mutable { + if(CoreManager::getInstance()->started()) + openAppAfterInit(mustBeIconified); + } + ); + + // Execute command argument if needed. + const QString commandArgument = getCommandArgument(); + if (!commandArgument.isEmpty()) { + Cli::CommandFormat format; + Cli::executeCommand(commandArgument, &format); + if (format == Cli::UriFormat || format == Cli::UrlFormat ) + mustBeIconified = true; + } } // ----------------------------------------------------------------------------- QString App::getCommandArgument () { - const QStringList &arguments = mParser->positionalArguments(); - return arguments.empty() ? QString("") : arguments[0]; + const QStringList &arguments = mParser->positionalArguments(); + return arguments.empty() ? QString("") : arguments[0]; } // ----------------------------------------------------------------------------- #ifdef Q_OS_MACOS - bool App::event (QEvent *event) { - if (event->type() == QEvent::FileOpen) { - const QString url = static_cast(event)->url().toString(); - if (isSecondary()) { - sendMessage(url.toLocal8Bit(), -1); - ::exit(EXIT_SUCCESS); - } - - Cli::executeCommand(url); - } - - return SingleApplication::event(event); - } +bool App::event (QEvent *event) { + if (event->type() == QEvent::FileOpen) { + const QString url = static_cast(event)->url().toString(); + if (isSecondary()) { + sendMessage(url.toLocal8Bit(), -1); + ::exit(EXIT_SUCCESS); + } + + Cli::executeCommand(url); + } + + return SingleApplication::event(event); +} #endif // ifdef Q_OS_MACOS // ----------------------------------------------------------------------------- QQuickWindow *App::getCallsWindow () const { - if (CoreManager::getInstance()->getCore()->getConfig()->getInt( - SettingsModel::UiSection, "disable_calls_window", 0 - )) - return nullptr; - - return mCallsWindow; + if (CoreManager::getInstance()->getCore()->getConfig()->getInt( + SettingsModel::UiSection, "disable_calls_window", 0 + )) + return nullptr; + + return mCallsWindow; } QQuickWindow *App::getMainWindow () const { - return qobject_cast( - const_cast(mEngine)->rootObjects().at(0) - ); + return qobject_cast( + const_cast(mEngine)->rootObjects().at(0) + ); } QQuickWindow *App::getSettingsWindow () const { - return mSettingsWindow; + return mSettingsWindow; } // ----------------------------------------------------------------------------- void App::smartShowWindow (QQuickWindow *window) { - if (!window) - return; - window->setVisible(true); -// Force show, maybe redundant with setVisible - if(window->visibility() == QWindow::Maximized)// Avoid to change visibility mode - window->showMaximized(); - else - window->show(); - window->raise();// Raise ensure to get focus on Mac - window->requestActivate(); + if (!window) + return; + window->setVisible(true); + // Force show, maybe redundant with setVisible + if(window->visibility() == QWindow::Maximized)// Avoid to change visibility mode + window->showMaximized(); + else + window->show(); + window->raise();// Raise ensure to get focus on Mac + window->requestActivate(); } // ----------------------------------------------------------------------------- bool App::hasFocus () const { - return getMainWindow()->isActive() || (mCallsWindow && mCallsWindow->isActive()); + return getMainWindow()->isActive() || (mCallsWindow && mCallsWindow->isActive()); } void App::stateChanged(Qt::ApplicationState pState) { - DesktopTools::applicationStateChanged(pState); + DesktopTools::applicationStateChanged(pState); } // ----------------------------------------------------------------------------- void App::createParser () { - delete mParser; - - mParser = new QCommandLineParser(); - mParser->setApplicationDescription(tr("applicationDescription")); - mParser->addPositionalArgument("command", tr("commandLineDescription").replace("%1", APPLICATION_NAME), "[command]"); - mParser->addOptions({ - { { "h", "help" }, tr("commandLineOptionHelp") }, - { "cli-help", tr("commandLineOptionCliHelp").replace("%1", APPLICATION_NAME) }, - { { "v", "version" }, tr("commandLineOptionVersion") }, - { "config", tr("commandLineOptionConfig").replace("%1", EXECUTABLE_NAME), tr("commandLineOptionConfigArg") }, - { "fetch-config", tr("commandLineOptionFetchConfig").replace("%1", EXECUTABLE_NAME), tr("commandLineOptionFetchConfigArg") }, - { { "c", "call" }, tr("commandLineOptionCall").replace("%1", EXECUTABLE_NAME),tr("commandLineOptionCallArg") }, - #ifndef Q_OS_MACOS - { "iconified", tr("commandLineOptionIconified") }, - #endif // ifndef Q_OS_MACOS - { { "V", "verbose" }, tr("commandLineOptionVerbose") } - }); + delete mParser; + + mParser = new QCommandLineParser(); + mParser->setApplicationDescription(tr("applicationDescription")); + mParser->addPositionalArgument("command", tr("commandLineDescription").replace("%1", APPLICATION_NAME), "[command]"); + mParser->addOptions({ + { { "h", "help" }, tr("commandLineOptionHelp") }, + { "cli-help", tr("commandLineOptionCliHelp").replace("%1", APPLICATION_NAME) }, + { { "v", "version" }, tr("commandLineOptionVersion") }, + { "config", tr("commandLineOptionConfig").replace("%1", EXECUTABLE_NAME), tr("commandLineOptionConfigArg") }, + { "fetch-config", tr("commandLineOptionFetchConfig").replace("%1", EXECUTABLE_NAME), tr("commandLineOptionFetchConfigArg") }, + { { "c", "call" }, tr("commandLineOptionCall").replace("%1", EXECUTABLE_NAME),tr("commandLineOptionCallArg") }, + #ifndef Q_OS_MACOS + { "iconified", tr("commandLineOptionIconified") }, + #endif // ifndef Q_OS_MACOS + { { "V", "verbose" }, tr("commandLineOptionVerbose") } + }); } // ----------------------------------------------------------------------------- template static QObject *makeSharedSingleton (QQmlEngine *, QJSEngine *) { - QObject *object = (*function)(); - QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); - return object; + QObject *object = (*function)(); + QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); + return object; } template static inline void registerSharedSingletonType (const char *name) { - qmlRegisterSingletonType(Constants::MainQmlUri, 1, 0, name, makeSharedSingleton); + qmlRegisterSingletonType(Constants::MainQmlUri, 1, 0, name, makeSharedSingleton); } template static QObject *makeSharedSingleton (QQmlEngine *, QJSEngine *) { - QObject *object = (CoreManager::getInstance()->*function)(); - QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); - return object; + QObject *object = (CoreManager::getInstance()->*function)(); + QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); + return object; } template static inline void registerSharedSingletonType (const char *name) { - qmlRegisterSingletonType(Constants::MainQmlUri, 1, 0, name, makeSharedSingleton); + qmlRegisterSingletonType(Constants::MainQmlUri, 1, 0, name, makeSharedSingleton); } template static inline void registerUncreatableType (const char *name) { - qmlRegisterUncreatableType(Constants::MainQmlUri, 1, 0, name, QLatin1String("Uncreatable")); + qmlRegisterUncreatableType(Constants::MainQmlUri, 1, 0, name, QLatin1String("Uncreatable")); } template static inline void registerSingletonType (const char *name) { - qmlRegisterSingletonType(Constants::MainQmlUri, 1, 0, name, [](QQmlEngine *engine, QJSEngine *) -> QObject *{ - return new T(engine); - }); + qmlRegisterSingletonType(Constants::MainQmlUri, 1, 0, name, [](QQmlEngine *engine, QJSEngine *) -> QObject *{ + return new T(engine); + }); } template static inline void registerType (const char *name) { - qmlRegisterType(Constants::MainQmlUri, 1, 0, name); + qmlRegisterType(Constants::MainQmlUri, 1, 0, name); } template static inline void registerToolType (const char *name) { - qmlRegisterSingletonType(name, 1, 0, name, [](QQmlEngine *engine, QJSEngine *) -> QObject *{ - return new T(engine); - }); + qmlRegisterSingletonType(name, 1, 0, name, [](QQmlEngine *engine, QJSEngine *) -> QObject *{ + return new T(engine); + }); } template static QObject *makeSharedTool (QQmlEngine *, QJSEngine *) { - QObject *object = (Owner::getInstance()->*function)(); - QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); - return object; + QObject *object = (Owner::getInstance()->*function)(); + QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership); + return object; } template static inline void registerSharedToolType (const char *name) { - qmlRegisterSingletonType(name, 1, 0, name, makeSharedTool); + qmlRegisterSingletonType(name, 1, 0, name, makeSharedTool); } void App::registerTypes () { - qInfo() << QStringLiteral("Registering types..."); - - qRegisterMetaType>(); - qRegisterMetaType(); - qRegisterMetaType>(); - qRegisterMetaType > >(); - qRegisterMetaType>(); - qRegisterMetaType>(); - qRegisterMetaType>(); - qRegisterMetaType>(); - qRegisterMetaType>(); - qRegisterMetaType>(); - qRegisterMetaType>(); - //qRegisterMetaType>(); - LinphoneEnums::registerMetaTypes(); - - registerType("AssistantModel"); - registerType("AuthenticationNotifier"); - registerType("CallsListProxyModel"); - registerType("Camera"); - registerType("CameraPreview"); - registerType("ChatRoomProxyModel"); - registerType("ConferenceHelperModel"); - registerType("ConferenceModel"); - registerType("ContactsListProxyModel"); - registerType("ContactsImporterListProxyModel"); - registerType("FileDownloader"); - registerType("FileExtractor"); - registerType("HistoryProxyModel"); - registerType("LdapProxyModel"); - registerType("ParticipantImdnStateProxyModel"); - registerType("SipAddressesProxyModel"); - registerType("SearchSipAddressesModel"); - registerType("SearchSipAddressesProxyModel"); - - - registerType("ColorProxyModel"); - registerType("ImageProxyModel"); - registerType("TimelineProxyModel"); - registerType("ParticipantProxyModel"); - registerType("SoundPlayer"); - registerType("TelephoneNumbersModel"); - - registerSingletonType("AudioCodecsModel"); - registerSingletonType("OwnPresenceModel"); - registerSingletonType("Presence"); - //registerSingletonType("TimelineModel"); - registerSingletonType("UrlHandlers"); - registerSingletonType("VideoCodecsModel"); - - registerUncreatableType("CallModel"); - registerUncreatableType("ChatCallModel"); - registerUncreatableType("ChatMessageModel"); - registerUncreatableType("ChatNoticeModel"); - registerUncreatableType("ChatRoomModel"); - registerUncreatableType("ColorModel"); - registerUncreatableType("ImageModel"); - registerUncreatableType("ConferenceAddModel"); - registerUncreatableType("ContactModel"); - registerUncreatableType("ContactsImporterModel"); - registerUncreatableType("ContentModel"); - registerUncreatableType("HistoryModel"); - registerUncreatableType("LdapModel"); - registerUncreatableType("SearchResultModel"); - registerUncreatableType("SipAddressObserver"); - registerUncreatableType("VcardModel"); - registerUncreatableType("TimelineModel"); - registerUncreatableType("ParticipantModel"); - registerUncreatableType("ParticipantListModel"); - registerUncreatableType("ParticipantDeviceModel"); - registerUncreatableType("ParticipantDeviceListModel"); - registerUncreatableType("ParticipantDeviceProxyModel"); - registerUncreatableType("ParticipantImdnStateModel"); - registerUncreatableType("ParticipantImdnStateListModel"); - - - - qmlRegisterUncreatableMetaObject(LinphoneEnums::staticMetaObject, "LinphoneEnums", 1, 0, "LinphoneEnums", "Only enums"); + qInfo() << QStringLiteral("Registering types..."); + + qRegisterMetaType>(); + qRegisterMetaType(); + qRegisterMetaType>(); + qRegisterMetaType > >(); + qRegisterMetaType>(); + qRegisterMetaType>(); + qRegisterMetaType>(); + qRegisterMetaType>(); + qRegisterMetaType>(); + qRegisterMetaType>(); + qRegisterMetaType>(); + //qRegisterMetaType>(); + LinphoneEnums::registerMetaTypes(); + + registerType("AssistantModel"); + registerType("AuthenticationNotifier"); + registerType("CallsListProxyModel"); + registerType("Camera"); + registerType("CameraPreview"); + registerType("ChatRoomProxyModel"); + registerType("ConferenceHelperModel"); + registerType("ConferenceModel"); + registerType("ContactsListProxyModel"); + registerType("ContactsImporterListProxyModel"); + registerType("FileDownloader"); + registerType("FileExtractor"); + registerType("HistoryProxyModel"); + registerType("LdapProxyModel"); + registerType("ParticipantImdnStateProxyModel"); + registerType("SipAddressesProxyModel"); + registerType("SearchSipAddressesModel"); + registerType("SearchSipAddressesProxyModel"); + + + registerType("ColorProxyModel"); + registerType("ImageProxyModel"); + registerType("TimelineProxyModel"); + registerType("ParticipantProxyModel"); + registerType("SoundPlayer"); + registerType("TelephoneNumbersModel"); + + registerSingletonType("AudioCodecsModel"); + registerSingletonType("OwnPresenceModel"); + registerSingletonType("Presence"); + //registerSingletonType("TimelineModel"); + registerSingletonType("UrlHandlers"); + registerSingletonType("VideoCodecsModel"); + + + registerUncreatableType("CallModel"); + registerUncreatableType("ChatCallModel"); + registerUncreatableType("ChatMessageModel"); + registerUncreatableType("ChatNoticeModel"); + registerUncreatableType("ChatRoomModel"); + registerUncreatableType("ColorModel"); + registerUncreatableType("ImageModel"); + registerUncreatableType("ConferenceAddModel"); + registerUncreatableType("ContactModel"); + registerUncreatableType("ContactsImporterModel"); + registerUncreatableType("ContentModel"); + registerUncreatableType("HistoryModel"); + registerUncreatableType("LdapModel"); + registerUncreatableType("SearchResultModel"); + registerUncreatableType("SipAddressObserver"); + registerUncreatableType("VcardModel"); + registerUncreatableType("TimelineModel"); + registerUncreatableType("ParticipantModel"); + registerUncreatableType("ParticipantListModel"); + registerUncreatableType("ParticipantDeviceModel"); + registerUncreatableType("ParticipantDeviceListModel"); + registerUncreatableType("ParticipantDeviceProxyModel"); + registerUncreatableType("ParticipantImdnStateModel"); + registerUncreatableType("ParticipantImdnStateListModel"); + + + + qmlRegisterUncreatableMetaObject(LinphoneEnums::staticMetaObject, "LinphoneEnums", 1, 0, "LinphoneEnums", "Only enums"); } void App::registerSharedTypes () { - qInfo() << QStringLiteral("Registering shared types..."); - - registerSharedSingletonType("App"); - registerSharedSingletonType("CoreManager"); - registerSharedSingletonType("SettingsModel"); - registerSharedSingletonType("AccountSettingsModel"); - registerSharedSingletonType("SipAddressesModel"); - registerSharedSingletonType("CallsListModel"); - registerSharedSingletonType("ContactsListModel"); - registerSharedSingletonType("ContactsImporterListModel"); - registerSharedSingletonType("LdapListModel"); - registerSharedSingletonType("TimelineListModel"); -// registerSharedSingletonType("ColorCpp"); + qInfo() << QStringLiteral("Registering shared types..."); + + registerSharedSingletonType("App"); + registerSharedSingletonType("CoreManager"); + registerSharedSingletonType("SettingsModel"); + registerSharedSingletonType("AccountSettingsModel"); + registerSharedSingletonType("SipAddressesModel"); + registerSharedSingletonType("CallsListModel"); + registerSharedSingletonType("ContactsListModel"); + registerSharedSingletonType("ContactsImporterListModel"); + registerSharedSingletonType("LdapListModel"); + registerSharedSingletonType("TimelineListModel"); + + //qmlRegisterSingletonType(Constants::MainQmlUri, 1, 0, "ColorList", mColorListModel); + + //registerSharedSingletonType("ColorCpp"); } void App::registerToolTypes () { - qInfo() << QStringLiteral("Registering tool types..."); - - registerToolType("Clipboard"); - registerToolType("DesktopTools"); - registerToolType("TextToSpeech"); - registerToolType("Units"); - registerToolType("ContactsImporterPluginsManager"); - registerToolType("UtilsCpp"); - registerToolType("ConstantsCpp"); - //registerToolType("ColorsCpp"); + qInfo() << QStringLiteral("Registering tool types..."); + + registerToolType("Clipboard"); + registerToolType("DesktopTools"); + registerToolType("TextToSpeech"); + registerToolType("Units"); + registerToolType("ContactsImporterPluginsManager"); + registerToolType("UtilsCpp"); + registerToolType("ConstantsCpp"); } void App::registerSharedToolTypes () { - qInfo() << QStringLiteral("Registering shared tool types..."); - - //registerSharedToolType("Colors"); - //registerSharedToolType("ColorsCpp"); + qInfo() << QStringLiteral("Registering shared tool types..."); + + registerSharedToolType("ColorsList"); } // ----------------------------------------------------------------------------- void App::setTrayIcon () { - QQuickWindow *root = getMainWindow(); - QSystemTrayIcon *systemTrayIcon = new QSystemTrayIcon(mEngine); - - // trayIcon: Right click actions. - QAction *settingsAction = new QAction(tr("settings"), root); - root->connect(settingsAction, &QAction::triggered, root, [this] { - App::smartShowWindow(getSettingsWindow()); - }); - - QAction *aboutAction = new QAction(tr("about"), root); - root->connect(aboutAction, &QAction::triggered, root, [root] { - App::smartShowWindow(root); - QMetaObject::invokeMethod( - root, Constants::AttachVirtualWindowMethodName, Qt::DirectConnection, - Q_ARG(QVariant, QUrl(Constants::AboutPath)), Q_ARG(QVariant, QVariant()), Q_ARG(QVariant, QVariant()) - ); - }); - - QAction *restoreAction = new QAction(tr("restore"), root); - root->connect(restoreAction, &QAction::triggered, root, [root] { - smartShowWindow(root); - }); - - QAction *quitAction = new QAction(tr("quit"), root); - root->connect(quitAction, &QAction::triggered, this, &App::quit); - - // trayIcon: Left click actions. - QMenu *menu = new QMenu(); - root->connect(systemTrayIcon, &QSystemTrayIcon::activated, [root]( - QSystemTrayIcon::ActivationReason reason - ) { - if (reason == QSystemTrayIcon::Trigger) { - if (root->visibility() == QWindow::Hidden) - smartShowWindow(root); - else - root->hide(); - } - }); - menu->setTitle(APPLICATION_NAME); - // Build trayIcon menu. - menu->addAction(settingsAction); - menu->addAction(aboutAction); - menu->addSeparator(); - menu->addAction(restoreAction); - menu->addSeparator(); - menu->addAction(quitAction); - - - - systemTrayIcon->setContextMenu(menu); - systemTrayIcon->setIcon(QIcon(Constants::WindowIconPath)); - systemTrayIcon->setToolTip(APPLICATION_NAME); - systemTrayIcon->show(); - mSystemTrayIcon = systemTrayIcon; - if(!QSystemTrayIcon::isSystemTrayAvailable()) - qInfo() << "System tray is not available"; + QQuickWindow *root = getMainWindow(); + QSystemTrayIcon *systemTrayIcon = new QSystemTrayIcon(mEngine); + + // trayIcon: Right click actions. + QAction *settingsAction = new QAction(tr("settings"), root); + root->connect(settingsAction, &QAction::triggered, root, [this] { + App::smartShowWindow(getSettingsWindow()); + }); + + QAction *aboutAction = new QAction(tr("about"), root); + root->connect(aboutAction, &QAction::triggered, root, [root] { + App::smartShowWindow(root); + QMetaObject::invokeMethod( + root, Constants::AttachVirtualWindowMethodName, Qt::DirectConnection, + Q_ARG(QVariant, QUrl(Constants::AboutPath)), Q_ARG(QVariant, QVariant()), Q_ARG(QVariant, QVariant()) + ); + }); + + QAction *restoreAction = new QAction(tr("restore"), root); + root->connect(restoreAction, &QAction::triggered, root, [root] { + smartShowWindow(root); + }); + + QAction *quitAction = new QAction(tr("quit"), root); + root->connect(quitAction, &QAction::triggered, this, &App::quit); + + // trayIcon: Left click actions. + QMenu *menu = new QMenu(); + root->connect(systemTrayIcon, &QSystemTrayIcon::activated, [root]( + QSystemTrayIcon::ActivationReason reason + ) { + if (reason == QSystemTrayIcon::Trigger) { + if (root->visibility() == QWindow::Hidden) + smartShowWindow(root); + else + root->hide(); + } + }); + menu->setTitle(APPLICATION_NAME); + // Build trayIcon menu. + menu->addAction(settingsAction); + menu->addAction(aboutAction); + menu->addSeparator(); + menu->addAction(restoreAction); + menu->addSeparator(); + menu->addAction(quitAction); + + + + systemTrayIcon->setContextMenu(menu); + systemTrayIcon->setIcon(QIcon(Constants::WindowIconPath)); + systemTrayIcon->setToolTip(APPLICATION_NAME); + systemTrayIcon->show(); + mSystemTrayIcon = systemTrayIcon; + if(!QSystemTrayIcon::isSystemTrayAvailable()) + qInfo() << "System tray is not available"; } // ----------------------------------------------------------------------------- void App::initLocale (const shared_ptr &config) { - // Try to use preferred locale. - QString locale; - - // Use english. This default translator is used if there are no found translations in others loads - mLocale = Constants::DefaultLocale; - if (!installLocale(*this, *mDefaultTranslator, QLocale(mLocale))) - qFatal("Unable to install default translator."); - - if (config) - locale = Utils::coreStringToAppString(config->getString(SettingsModel::UiSection, "locale", "")); - - if (!locale.isEmpty() && installLocale(*this, *mTranslator, QLocale(locale))) { - mLocale = locale; - return; - } - - // Try to use system locale. - QLocale sysLocale = QLocale::system(); - if (installLocale(*this, *mTranslator, sysLocale)) { - mLocale = sysLocale.name(); - return; - } - + // Try to use preferred locale. + QString locale; + + // Use english. This default translator is used if there are no found translations in others loads + mLocale = Constants::DefaultLocale; + if (!installLocale(*this, *mDefaultTranslator, QLocale(mLocale))) + qFatal("Unable to install default translator."); + + if (config) + locale = Utils::coreStringToAppString(config->getString(SettingsModel::UiSection, "locale", "")); + + if (!locale.isEmpty() && installLocale(*this, *mTranslator, QLocale(locale))) { + mLocale = locale; + return; + } + + // Try to use system locale. + QLocale sysLocale = QLocale::system(); + if (installLocale(*this, *mTranslator, sysLocale)) { + mLocale = sysLocale.name(); + return; + } + } QString App::getConfigLocale () const { - return Utils::coreStringToAppString( - CoreManager::getInstance()->getCore()->getConfig()->getString( - SettingsModel::UiSection, "locale", "" + return Utils::coreStringToAppString( + CoreManager::getInstance()->getCore()->getConfig()->getString( + SettingsModel::UiSection, "locale", "" ) - ); + ); } void App::setConfigLocale (const QString &locale) { - CoreManager::getInstance()->getCore()->getConfig()->setString( - SettingsModel::UiSection, "locale", Utils::appStringToCoreString(locale) - ); - - emit configLocaleChanged(locale); + CoreManager::getInstance()->getCore()->getConfig()->setString( + SettingsModel::UiSection, "locale", Utils::appStringToCoreString(locale) + ); + + emit configLocaleChanged(locale); } QString App::getLocale () const { - return mLocale; + return mLocale; } // ----------------------------------------------------------------------------- @@ -798,56 +800,56 @@ QString App::getLocale () const { #ifdef Q_OS_LINUX void App::setAutoStart (bool enabled) { - if (enabled == mAutoStart) - return; - - QDir dir(AutoStartDirectory); - if (!dir.exists() && !dir.mkpath(AutoStartDirectory)) { - qWarning() << QStringLiteral("Unable to build autostart dir path: `%1`.").arg(AutoStartDirectory); - return; - } - - const QString confPath(AutoStartDirectory + EXECUTABLE_NAME ".desktop"); - qInfo() << QStringLiteral("Updating `%1`...").arg(confPath); - QFile file(confPath); - - if (!enabled) { - if (file.exists() && !file.remove()) { - qWarning() << QLatin1String("Unable to remove autostart file: `" EXECUTABLE_NAME ".desktop`."); - return; - } - - mAutoStart = enabled; - emit autoStartChanged(enabled); - return; - } - - if (!file.open(QFile::WriteOnly)) { - qWarning() << "Unable to open autostart file: `" EXECUTABLE_NAME ".desktop`."; - return; - } - - const QString binPath(applicationFilePath()); - - // Check if installation is done via Flatpak, AppImage, or classic package - // in order to rewrite a correct exec path for autostart - QString exec; - qDebug() << "binpath=" << binPath; - if (binPath.startsWith("/app")) { //Flatpak - exec = QStringLiteral("flatpak run " APPLICATION_ID); - qDebug() << "exec path autostart set flatpak=" << exec; - } - else if (binPath.startsWith("/tmp/.mount")) { //Appimage - exec = QProcessEnvironment::systemEnvironment().value(QStringLiteral("APPIMAGE")); - qDebug() << "exec path autostart set appimage=" << exec; - } - else { //classic package - exec = binPath; - qDebug() << "exec path autostart set classic package=" << exec; - } - - QTextStream(&file) << QString( - "[Desktop Entry]\n" + if (enabled == mAutoStart) + return; + + QDir dir(AutoStartDirectory); + if (!dir.exists() && !dir.mkpath(AutoStartDirectory)) { + qWarning() << QStringLiteral("Unable to build autostart dir path: `%1`.").arg(AutoStartDirectory); + return; + } + + const QString confPath(AutoStartDirectory + EXECUTABLE_NAME ".desktop"); + qInfo() << QStringLiteral("Updating `%1`...").arg(confPath); + QFile file(confPath); + + if (!enabled) { + if (file.exists() && !file.remove()) { + qWarning() << QLatin1String("Unable to remove autostart file: `" EXECUTABLE_NAME ".desktop`."); + return; + } + + mAutoStart = enabled; + emit autoStartChanged(enabled); + return; + } + + if (!file.open(QFile::WriteOnly)) { + qWarning() << "Unable to open autostart file: `" EXECUTABLE_NAME ".desktop`."; + return; + } + + const QString binPath(applicationFilePath()); + + // Check if installation is done via Flatpak, AppImage, or classic package + // in order to rewrite a correct exec path for autostart + QString exec; + qDebug() << "binpath=" << binPath; + if (binPath.startsWith("/app")) { //Flatpak + exec = QStringLiteral("flatpak run " APPLICATION_ID); + qDebug() << "exec path autostart set flatpak=" << exec; + } + else if (binPath.startsWith("/tmp/.mount")) { //Appimage + exec = QProcessEnvironment::systemEnvironment().value(QStringLiteral("APPIMAGE")); + qDebug() << "exec path autostart set appimage=" << exec; + } + else { //classic package + exec = binPath; + qDebug() << "exec path autostart set classic package=" << exec; + } + + QTextStream(&file) << QString( + "[Desktop Entry]\n" "Name=" APPLICATION_NAME "\n" "GenericName=SIP Phone\n" "Comment=" APPLICATION_DESCRIPTION "\n" @@ -857,50 +859,50 @@ void App::setAutoStart (bool enabled) { "Categories=Network;Telephony;\n" "MimeType=x-scheme-handler/sip-linphone;x-scheme-handler/sip;x-scheme-handler/sips-linphone;x-scheme-handler/sips;x-scheme-handler/tel;x-scheme-handler/callto;\n" ); - - mAutoStart = enabled; - emit autoStartChanged(enabled); + + mAutoStart = enabled; + emit autoStartChanged(enabled); } #elif defined(Q_OS_MACOS) void App::setAutoStart (bool enabled) { - if (enabled == mAutoStart) - return; - - if (getMacOsBundlePath().isEmpty()) { - qWarning() << QStringLiteral("Application is not installed. Unable to change autostart state."); - return; - } - - if (enabled) - QProcess::execute(OsascriptExecutable, { - "-e", "tell application \"System Events\" to make login item at end with properties" - "{ path: \"" + getMacOsBundlePath() + "\", hidden: false }" - }); - else - QProcess::execute(OsascriptExecutable, { - "-e", "tell application \"System Events\" to delete login item \"" + getMacOsBundleName() + "\"" - }); - - mAutoStart = enabled; - emit autoStartChanged(enabled); + if (enabled == mAutoStart) + return; + + if (getMacOsBundlePath().isEmpty()) { + qWarning() << QStringLiteral("Application is not installed. Unable to change autostart state."); + return; + } + + if (enabled) + QProcess::execute(OsascriptExecutable, { + "-e", "tell application \"System Events\" to make login item at end with properties" + "{ path: \"" + getMacOsBundlePath() + "\", hidden: false }" + }); + else + QProcess::execute(OsascriptExecutable, { + "-e", "tell application \"System Events\" to delete login item \"" + getMacOsBundleName() + "\"" + }); + + mAutoStart = enabled; + emit autoStartChanged(enabled); } #else void App::setAutoStart (bool enabled) { - if (enabled == mAutoStart) - return; - - QSettings settings(AutoStartSettingsFilePath, QSettings::NativeFormat); - if (enabled) - settings.setValue(EXECUTABLE_NAME, QDir::toNativeSeparators(applicationFilePath())); - else - settings.remove(EXECUTABLE_NAME); - - mAutoStart = enabled; - emit autoStartChanged(enabled); + if (enabled == mAutoStart) + return; + + QSettings settings(AutoStartSettingsFilePath, QSettings::NativeFormat); + if (enabled) + settings.setValue(EXECUTABLE_NAME, QDir::toNativeSeparators(applicationFilePath())); + else + settings.remove(EXECUTABLE_NAME); + + mAutoStart = enabled; + emit autoStartChanged(enabled); } #endif // ifdef Q_OS_LINUX @@ -908,91 +910,91 @@ void App::setAutoStart (bool enabled) { // ----------------------------------------------------------------------------- void App::openAppAfterInit (bool mustBeIconified) { - qInfo() << QStringLiteral("Open " APPLICATION_NAME " app."); - auto coreManager = CoreManager::getInstance(); - // Create other windows. - mCallsWindow = createSubWindow(mEngine, Constants::QmlViewCallsWindow); - mSettingsWindow = createSubWindow(mEngine, Constants::QmlViewSettingsWindow); - QObject::connect(mSettingsWindow, &QWindow::visibilityChanged, this, [coreManager](QWindow::Visibility visibility) { - if (visibility == QWindow::Hidden) { - qInfo() << QStringLiteral("Update nat policy."); - shared_ptr core = coreManager->getCore(); - core->setNatPolicy(core->getNatPolicy()); - } - }); - - QQuickWindow *mainWindow = getMainWindow(); - - #ifndef __APPLE__ - // Enable TrayIconSystem. - if (!QSystemTrayIcon::isSystemTrayAvailable()) - qWarning("System tray not found on this system."); - else - setTrayIcon(); - #endif // ifndef __APPLE__ - - // Display Assistant if it does not exist proxy config. - if (coreManager->getCore()->getAccountList().empty()) - QMetaObject::invokeMethod(mainWindow, "setView", Q_ARG(QVariant, Constants::AssistantViewName), Q_ARG(QVariant, QString(""))); - - #ifdef ENABLE_UPDATE_CHECK - QTimer *timer = new QTimer(mEngine); - timer->setInterval(Constants::VersionUpdateCheckInterval); - - QObject::connect(timer, &QTimer::timeout, this, &App::checkForUpdate); - timer->start(); - - checkForUpdate(); - #endif // ifdef ENABLE_UPDATE_CHECK - - if(setFetchConfig(mParser)) - restart(); - else{ -// Launch call if wanted and clean parser - if( mParser->isSet("call") && coreManager->isLastRemoteProvisioningGood()){ - QString sipAddress = mParser->value("call"); - mParser->parse(cleanParserKeys(mParser, QStringList("call")));// Clean call from parser - if(coreManager->started()){ - coreManager->getCallsListModel()->launchAudioCall(sipAddress); - }else{ - QObject * context = new QObject(); - QObject::connect(CoreManager::getInstance(), &CoreManager::coreManagerInitialized,context, - [sipAddress,coreManager, context]() mutable { - if(context){ - delete context; - context = nullptr; - coreManager->getCallsListModel()->launchAudioCall(sipAddress); - } - }); - } - } + qInfo() << QStringLiteral("Open " APPLICATION_NAME " app."); + auto coreManager = CoreManager::getInstance(); + // Create other windows. + mCallsWindow = createSubWindow(mEngine, Constants::QmlViewCallsWindow); + mSettingsWindow = createSubWindow(mEngine, Constants::QmlViewSettingsWindow); + QObject::connect(mSettingsWindow, &QWindow::visibilityChanged, this, [coreManager](QWindow::Visibility visibility) { + if (visibility == QWindow::Hidden) { + qInfo() << QStringLiteral("Update nat policy."); + shared_ptr core = coreManager->getCore(); + core->setNatPolicy(core->getNatPolicy()); + } + }); + + QQuickWindow *mainWindow = getMainWindow(); + #ifndef __APPLE__ - if (!mustBeIconified) - smartShowWindow(mainWindow); + // Enable TrayIconSystem. + if (!QSystemTrayIcon::isSystemTrayAvailable()) + qWarning("System tray not found on this system."); + else + setTrayIcon(); +#endif // ifndef __APPLE__ + + // Display Assistant if it does not exist proxy config. + if (coreManager->getCore()->getAccountList().empty()) + QMetaObject::invokeMethod(mainWindow, "setView", Q_ARG(QVariant, Constants::AssistantViewName), Q_ARG(QVariant, QString(""))); + +#ifdef ENABLE_UPDATE_CHECK + QTimer *timer = new QTimer(mEngine); + timer->setInterval(Constants::VersionUpdateCheckInterval); + + QObject::connect(timer, &QTimer::timeout, this, &App::checkForUpdate); + timer->start(); + + checkForUpdate(); +#endif // ifdef ENABLE_UPDATE_CHECK + + if(setFetchConfig(mParser)) + restart(); + else{ + // Launch call if wanted and clean parser + if( mParser->isSet("call") && coreManager->isLastRemoteProvisioningGood()){ + QString sipAddress = mParser->value("call"); + mParser->parse(cleanParserKeys(mParser, QStringList("call")));// Clean call from parser + if(coreManager->started()){ + coreManager->getCallsListModel()->launchAudioCall(sipAddress); + }else{ + QObject * context = new QObject(); + QObject::connect(CoreManager::getInstance(), &CoreManager::coreManagerInitialized,context, + [sipAddress,coreManager, context]() mutable { + if(context){ + delete context; + context = nullptr; + coreManager->getCallsListModel()->launchAudioCall(sipAddress); + } + }); + } + } +#ifndef __APPLE__ + if (!mustBeIconified) + smartShowWindow(mainWindow); #else - Q_UNUSED(mustBeIconified); - smartShowWindow(mainWindow); + Q_UNUSED(mustBeIconified); + smartShowWindow(mainWindow); #endif - setOpened(true); - } + setOpened(true); + } } // ----------------------------------------------------------------------------- QString App::getStrippedApplicationVersion(){// x.y.z but if 'z-*' then x.y.z-1 - QString currentVersion = applicationVersion(); - QStringList versions = currentVersion.split('.'); - if(versions.size() >=3){ - currentVersion = versions[0]+"."+versions[1]+"."; - QStringList patchVersions = versions[2].split('-'); - if( patchVersions.size() > 1) - currentVersion += QString::number(patchVersions[0].toInt()-1); - else - currentVersion += patchVersions[0]; - } - return currentVersion; + QString currentVersion = applicationVersion(); + QStringList versions = currentVersion.split('.'); + if(versions.size() >=3){ + currentVersion = versions[0]+"."+versions[1]+"."; + QStringList patchVersions = versions[2].split('-'); + if( patchVersions.size() > 1) + currentVersion += QString::number(patchVersions[0].toInt()-1); + else + currentVersion += patchVersions[0]; + } + return currentVersion; } void App::checkForUpdate () { - CoreManager::getInstance()->getCore()->checkForUpdate( - Utils::appStringToCoreString(getStrippedApplicationVersion()) - ); + CoreManager::getInstance()->getCore()->checkForUpdate( + Utils::appStringToCoreString(getStrippedApplicationVersion()) + ); } diff --git a/linphone-app/src/components/other/colors/ColorListModel.cpp b/linphone-app/src/components/other/colors/ColorListModel.cpp index 6921cf57b..55af6e1ea 100644 --- a/linphone-app/src/components/other/colors/ColorListModel.cpp +++ b/linphone-app/src/components/other/colors/ColorListModel.cpp @@ -69,9 +69,14 @@ QVariant ColorListModel::data (const QModelIndex &index, int role) const { void ColorListModel::add(std::shared_ptr color){ int row = mList.count(); + + connect(color.get(), &ColorModel::uiColorChanged, this, &ColorListModel::handleUiColorChanged); + beginInsertRows(QModelIndex(), row, row); setProperty(color->getName().toStdString().c_str(), QVariant::fromValue(color.get())); + + mData.insert(color->getName(), QVariant::fromValue(color.get())); mList << color; @@ -79,6 +84,47 @@ void ColorListModel::add(std::shared_ptr color){ emit layoutChanged(); } +ColorModel * ColorListModel::add(const QString& id, const QString& idLink, QString description, QString colorValue){ + ColorModel * color = getColor(id); + if(!color){ + if(idLink != ""){ + if( colorValue == ""){ + auto linkColor = getColor(idLink); + if(linkColor){ + colorValue = linkColor->getColor().name(QColor::HexArgb); + } + } + addLink(id, idLink); + } + if( description == ""){ + description = id; + description.replace("_", " "); + } + auto colorShared = std::make_shared(id, colorValue, description); + add(colorShared); + color = colorShared.get(); + } + return color; +} + +void ColorListModel::addLink(const QString& a, const QString& b){ + int index = 0; + if( mColorLinkIndexes.contains(b)){ + index = mColorLinkIndexes[b]; + }else { + index = mColorLinks.size(); + mColorLinks.push_back(QStringList(b)); + mColorLinkIndexes[b] = index; + } + mColorLinks[index].push_back(a); + mColorLinkIndexes[a] = index; +} + +void ColorListModel::removeLink(const QString& a){ + mColorLinks[mColorLinkIndexes[a]].removeOne(a); + mColorLinkIndexes.remove(a); +} + bool ColorListModel::removeRow (int row, const QModelIndex &parent){ return removeRows(row, 1, parent); } @@ -117,6 +163,13 @@ QString ColorListModel::getNames(){ return names.join(", "); } +ColorModel * ColorListModel::getColor(const QString& id){ + if(mData.contains(id)){ + return mData[id].value(); + }else + return nullptr; +} + QQmlPropertyMap * ColorListModel::getQmlData() { return &mData; } @@ -125,6 +178,13 @@ const QQmlPropertyMap * ColorListModel::getQmlData() const{ return &mData; } +int ColorListModel::getLinkIndex(const QString& id){ + if( mColorLinkIndexes.contains(id)) + return mColorLinkIndexes[id]; + else + return -1; +} + void ColorListModel::overrideColors (const std::shared_ptr &config) { if (!config) return; @@ -137,7 +197,21 @@ void ColorListModel::overrideColors (const std::shared_ptr &co } } + +void ColorListModel::handleUiColorChanged(const QString& id, const QColor& color){ + if( mColorLinkIndexes.contains(id)){ + int index = mColorLinkIndexes[id]; + for(int i = 0 ; i < mColorLinks[index].size() ; ++i){ + auto colorToUpdate =getColor(mColorLinks[index][i]); + if(colorToUpdate) + colorToUpdate->setInternalColor(color); + } + } +} //-------------------------------------------------------------------------------- + + + /* std::shared_ptr ColorListModel::getImdnState(const std::shared_ptr & state){ std::shared_ptr imdn; diff --git a/linphone-app/src/components/other/colors/ColorListModel.hpp b/linphone-app/src/components/other/colors/ColorListModel.hpp index 4956891a9..4680603e8 100644 --- a/linphone-app/src/components/other/colors/ColorListModel.hpp +++ b/linphone-app/src/components/other/colors/ColorListModel.hpp @@ -133,10 +133,23 @@ public: void useConfig (const std::shared_ptr &config); Q_INVOKABLE QString getNames(); + ColorModel * getColor(const QString& id); + +// id: set an ID. If the ID already exist, the funtion return the item instead of create one. +// color : if empty, use the color from link +// description : describe the color +// idLink : link this color with another ID + Q_INVOKABLE ColorModel * add(const QString& id, const QString& idLink, QString description = "", QString color = ""); + + void addLink(const QString& a, const QString& b); + void removeLink(const QString& a); QQmlPropertyMap * getQmlData(); const QQmlPropertyMap * getQmlData() const; + int getLinkIndex(const QString& id); +public slots: + void handleUiColorChanged(const QString& id, const QColor& color); signals: void colorChanged(); @@ -153,6 +166,8 @@ private: QStringList getColorNames () const; QQmlPropertyMap mData; + QVector mColorLinks; + QMap mColorLinkIndexes;// Optimization for access }; #undef ADD_COLOR diff --git a/linphone-app/src/components/other/colors/ColorModel.cpp b/linphone-app/src/components/other/colors/ColorModel.cpp index 8ab67f9b2..375363e8e 100644 --- a/linphone-app/src/components/other/colors/ColorModel.cpp +++ b/linphone-app/src/components/other/colors/ColorModel.cpp @@ -51,6 +51,14 @@ QString ColorModel::getDescription() const{ void ColorModel::setColor(const QColor& color){ + if(color != mColor){ + mColor = color; + emit colorChanged(); + emit uiColorChanged(mName, color); + } +} + +void ColorModel::setInternalColor(const QColor& color){ if(color != mColor){ mColor = color; emit colorChanged(); diff --git a/linphone-app/src/components/other/colors/ColorModel.hpp b/linphone-app/src/components/other/colors/ColorModel.hpp index a506511ba..b8a33539d 100644 --- a/linphone-app/src/components/other/colors/ColorModel.hpp +++ b/linphone-app/src/components/other/colors/ColorModel.hpp @@ -45,11 +45,13 @@ public: void setColor(const QColor& color); + void setInternalColor(const QColor& color); void setAlpha(const int& alpha); void setDescription(const QString& description); signals: void colorChanged(); + void uiColorChanged(const QString& id, const QColor& color); // UI request a change void descriptionChanged(); private: diff --git a/linphone-app/src/components/other/colors/ColorProxyModel.cpp b/linphone-app/src/components/other/colors/ColorProxyModel.cpp index fea76bccc..bbea353d1 100644 --- a/linphone-app/src/components/other/colors/ColorProxyModel.cpp +++ b/linphone-app/src/components/other/colors/ColorProxyModel.cpp @@ -32,23 +32,26 @@ ColorProxyModel::ColorProxyModel (QObject *parent) : QSortFilterProxyModel(parent){ setSourceModel(App::getInstance()->getColorListModel()); + sort(0); } bool ColorProxyModel::filterAcceptsRow ( - int sourceRow, - const QModelIndex &sourceParent -) const { + int sourceRow, + const QModelIndex &sourceParent + ) const { Q_UNUSED(sourceRow) Q_UNUSED(sourceParent) - //const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); - //const ParticipantDeviceModel *device = index.data().value(); + //const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); + //const ParticipantDeviceModel *device = index.data().value(); return true; } bool ColorProxyModel::lessThan (const QModelIndex &left, const QModelIndex &right) const { - const ColorModel *a = sourceModel()->data(left).value(); - const ColorModel *b = sourceModel()->data(right).value(); - - return a->getName() < b->getName() ; + ColorListModel * model = static_cast(sourceModel()); + const ColorModel *a = model->data(left).value(); + const ColorModel *b = model->data(right).value(); + + return model->getLinkIndex(a->getName()) < model->getLinkIndex(b->getName()); + //return a->getName() < b->getName() ; } //--------------------------------------------------------------------------------- diff --git a/linphone-app/ui/modules/Common/Dialog/DialogTitle.qml b/linphone-app/ui/modules/Common/Dialog/DialogTitle.qml index 1f5575708..471975018 100644 --- a/linphone-app/ui/modules/Common/Dialog/DialogTitle.qml +++ b/linphone-app/ui/modules/Common/Dialog/DialogTitle.qml @@ -5,6 +5,7 @@ import Linphone 1.0 import Common.Styles 1.0 import Units 1.0 +import ColorsList 1.0 // ============================================================================= // Title bar used by dialogs. @@ -22,8 +23,8 @@ Item { Rectangle{ anchors.fill:parent gradient: Gradient { - GradientStop { position: 0.0; color: Colors.y.color } - GradientStop { position: 1.0; color: Colors.z.color} + GradientStop { position: 0.0; color: ColorsList.add("Dialog_title_gradient_low", "y").color } + GradientStop { position: 1.0; color: ColorsList.add("Dialog_title_gradient_high", "z").color} } visible:showBar } diff --git a/linphone-app/ui/modules/Common/Styles/Animations/BusyIndicatorStyle.qml b/linphone-app/ui/modules/Common/Styles/Animations/BusyIndicatorStyle.qml index 99b7794a6..fefaab20a 100644 --- a/linphone-app/ui/modules/Common/Styles/Animations/BusyIndicatorStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Animations/BusyIndicatorStyle.qml @@ -1,10 +1,10 @@ pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("Busy_indicator", "i").color property int duration: 1250 property int nSpheres: 6 } diff --git a/linphone-app/ui/modules/Common/Styles/Dialog/DialogStyle.qml b/linphone-app/ui/modules/Common/Styles/Dialog/DialogStyle.qml index f6ba3fd7a..2a2f60fc0 100644 --- a/linphone-app/ui/modules/Common/Styles/Dialog/DialogStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Dialog/DialogStyle.qml @@ -2,11 +2,12 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("Dialog", "k").color property QtObject buttons: QtObject { property int bottomMargin: 30 @@ -27,7 +28,7 @@ QtObject { } property QtObject description: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Dialog_description", "j").color property int leftMargin: 50 property int pointSize: Units.dp * 11 property int rightMargin: 50 diff --git a/linphone-app/ui/modules/Common/Styles/Form/Buttons/ExclusiveButtonsStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Buttons/ExclusiveButtonsStyle.qml index 7b772870e..a953d835a 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Buttons/ExclusiveButtonsStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Buttons/ExclusiveButtonsStyle.qml @@ -1,7 +1,7 @@ pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= QtObject { @@ -9,10 +9,10 @@ QtObject { property QtObject button: QtObject { property QtObject color: QtObject { - property color hovered: Colors.n.color - property color normal: Colors.x.color - property color pressed: Colors.i.color - property color selected: Colors.g.color + property color hovered: ColorsList.add("Exclusive_button_hovered", "n").color + property color normal: ColorsList.add("Exclusive_button_normal", "x").color + property color pressed: ColorsList.add("Exclusive_button_pressed", "i").color + property color selected: ColorsList.add("Exclusive_button_selected", "g").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Buttons/FileChooserButtonStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Buttons/FileChooserButtonStyle.qml index 37a784b6d..df73c3c46 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Buttons/FileChooserButtonStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Buttons/FileChooserButtonStyle.qml @@ -1,5 +1,6 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= @@ -11,9 +12,9 @@ QtObject { property int iconSize: 16 property QtObject color: QtObject { - property color hovered: Colors.c.color - property color normal: Colors.f.color - property color pressed: Colors.c.color + property color hovered: ColorsList.add("FileChooser_hovered", "c").color + property color normal: ColorsList.add("FileChooser_normal", "f").color + property color pressed: ColorsList.add("FileChooser_pressed", "c").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Buttons/SmallButtonStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Buttons/SmallButtonStyle.qml index 827a8efa4..0b8cdb01e 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Buttons/SmallButtonStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Buttons/SmallButtonStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -14,14 +15,14 @@ QtObject { property int radius: 20 property QtObject color: QtObject { - property color hovered: Colors.c.color - property color normal: Colors.f.color - property color pressed: Colors.i.color + property color hovered: ColorsList.add("SmallButton_background_hovered", "c").color + property color normal: ColorsList.add("SmallButton_background_normal", "f").color + property color pressed: ColorsList.add("SmallButton_background_pressed", "i").color } } property QtObject text: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("SmallButton_text", "q").color property int pointSize: Units.dp * 8 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonAStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonAStyle.qml index 3ff03e60a..0b32989de 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonAStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonAStyle.qml @@ -1,22 +1,23 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject backgroundColor: QtObject { - property color disabled: Colors.o.color - property color hovered: Colors.j.color - property color normal: Colors.r.color - property color pressed: Colors.i.color + property color disabled: ColorsList.add("TextButton_background_disabled", "o").color + property color hovered: ColorsList.add("TextButton_background_hovered", "j").color + property color normal: ColorsList.add("TextButton_background_normal", "r").color + property color pressed: ColorsList.add("TextButton_background_pressed", "i").color } property QtObject textColor: QtObject { - property color disabled: Colors.q.color - property color hovered: Colors.q.color - property color normal: Colors.q.color - property color pressed: Colors.q.color + property color disabled: ColorsList.add("TextButton_text_disabled", "q").color + property color hovered: ColorsList.add("TextButton_text_hovered", "q").color + property color normal: ColorsList.add("TextButton_text_normal", "q").color + property color pressed: ColorsList.add("TextButton_text_pressed", "q").color } property QtObject borderColor : backgroundColor } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonBStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonBStyle.qml index e662527ab..d578d9822 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonBStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Buttons/TextButtonBStyle.qml @@ -1,22 +1,22 @@ // TextButtonBStyle pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject backgroundColor: QtObject { - property color disabled: Colors.i30.color - property color hovered: Colors.b.color - property color normal: Colors.i.color - property color pressed: Colors.m.color + property color disabled: ColorsList.add("TextButtonB_background_disabled", "i30").color + property color hovered: ColorsList.add("TextButtonB_background_hovered", "b").color + property color normal: ColorsList.add("TextButtonB_background_normal", "i").color + property color pressed: ColorsList.add("TextButtonB_background_pressed", "m").color } property QtObject textColor: QtObject { - property color disabled: Colors.q.color - property color hovered: Colors.q.color - property color normal: Colors.q.color - property color pressed: Colors.q.color + property color disabled: ColorsList.add("TextButtonB_text_disabled", "q").color + property color hovered: ColorsList.add("TextButtonB_text_hovered", "q").color + property color normal: ColorsList.add("TextButtonB_text_normal", "q").color + property color pressed: ColorsList.add("TextButtonB_text_pressed", "q").color } property QtObject borderColor : backgroundColor } diff --git a/linphone-app/ui/modules/Common/Styles/Form/CheckBoxTextStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/CheckBoxTextStyle.qml index 5e7dc72be..e9f04069a 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/CheckBoxTextStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/CheckBoxTextStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -11,8 +12,8 @@ QtObject { property int size: 18 property QtObject color: QtObject { - property color pressed: Colors.i.color - property color hovered: Colors.h.color - property color normal: Colors.g.color + property color pressed: ColorsList.add("CheckBox_pressed", "i").color + property color hovered: ColorsList.add("CheckBox_hovered", "h").color + property color normal: ColorsList.add("CheckBox_normal", "g").color } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/ComboBoxStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/ComboBoxStyle.qml index a32c81e94..870e3ef19 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/ComboBoxStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/ComboBoxStyle.qml @@ -2,7 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 - +import ColorsList 1.0 // ============================================================================= QtObject { @@ -13,13 +13,13 @@ QtObject { property int width: 200 property QtObject border: QtObject { - property color color: Colors.c.color + property color color: ColorsList.add("ComboBox_border_normal", "c").color property int width: 1 } property QtObject color: QtObject { - property color normal: Colors.q.color - property color readOnly: Colors.e.color + property color normal: ColorsList.add("ComboBox_normal", "q").color + property color readOnly: ColorsList.add("ComboBox_readonly", "e").color } } @@ -29,7 +29,7 @@ QtObject { property int spacing: 5 property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("ComboBox_text_normal", "d").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/CommonItemDelegateStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/CommonItemDelegateStyle.qml index 69d2570ce..13fbb278f 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/CommonItemDelegateStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/CommonItemDelegateStyle.qml @@ -2,13 +2,14 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject color: QtObject { - property color hovered: Colors.o.color - property color normal: Colors.q.color + property color hovered: ColorsList.add("CommonItem_hovered", "o").color + property color normal: ColorsList.add("CommonItem_normal", "q").color } property QtObject contentItem: QtObject { @@ -16,18 +17,18 @@ QtObject { property int spacing: 5 property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("CommonItem_text", "d").color property int pointSize: Units.dp * 10 } } property QtObject indicator: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("CommonItem_indicator", "i").color property int width: 5 } property QtObject separator: QtObject { - property color color: Colors.c.color + property color color: ColorsList.add("CommonItem_separator", "c").color property int height: 1 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/DroppableTextAreaStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/DroppableTextAreaStyle.qml index cda319ab8..9f566f03d 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/DroppableTextAreaStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/DroppableTextAreaStyle.qml @@ -2,12 +2,13 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color backgroundColor: Colors.e.color - property color outsideBackgroundColor: Colors.aa.color + property color backgroundColor: ColorsList.add("DroppableTextArea_Chat_background", "e").color + property color outsideBackgroundColor: ColorsList.add("DroppableTextArea_Chat_outsideBackground", "aa").color property QtObject fileChooserButton: QtObject { property int margins: 6 @@ -15,16 +16,16 @@ QtObject { } property QtObject hoverContent: QtObject { - property color backgroundColor: Colors.q.color + property color backgroundColor: ColorsList.add("DroppableTextArea_Chat_hoverContent_background", "q").color property QtObject text: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("DroppableTextArea_Chat_hoverContent_text", "i").color property int pointSize: Units.dp * 11 } } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("DroppableTextArea_Chat_text", "d").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Fields/NumericFieldStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Fields/NumericFieldStyle.qml index 311b70756..4d41ad9f5 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Fields/NumericFieldStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Fields/NumericFieldStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -11,12 +12,12 @@ QtObject { property QtObject button: QtObject { property QtObject color: QtObject { - property color normal: Colors.f.color - property color pressed: Colors.c.color + property color normal: ColorsList.add("NumericField_normal", "f").color + property color pressed: ColorsList.add("NumericField_pressed", "c").color } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("NumericField_text", "d").color property int pointSize: Units.dp * 9 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml index 5cc153338..5caa8c8e7 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Fields/TextAreaFieldStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -13,18 +14,18 @@ QtObject { property int radius: 4 property QtObject border: QtObject { - property color color: Colors.c.color + property color color: ColorsList.add("TextAreaField_background_border", "c").color property int width: 1 } property QtObject color: QtObject { - property color normal: Colors.q.color - property color readOnly: Colors.e.color + property color normal: ColorsList.add("TextAreaField_background_normal", "q").color + property color readOnly: ColorsList.add("TextAreaField_background_reeadOnly", "e").color } } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("TextAreaField_text", "d").color property int pointSize: Units.dp * 10 property int padding: 8 } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml index aabfd2a40..5b399e9c9 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Fields/TextFieldStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { @@ -14,22 +15,22 @@ QtObject { property QtObject border: QtObject { property QtObject color: QtObject { - property color error: Colors.error.color - property color normal: Colors.c.color - property color selected: Colors.i.color + property color error: ColorsList.add("TextField_normal_background_border_error", "error").color + property color normal: ColorsList.add("TextField_normal_background_border_normal", "c").color + property color selected: ColorsList.add("TextField_normal_background_border_selected", "i").color } property int width: 1 } property QtObject color: QtObject { - property color normal: Colors.q.color - property color readOnly: Colors.e.color + property color normal: ColorsList.add("TextField_normal_background_normal", "q").color + property color readOnly: ColorsList.add("TextField_normal_background_readonly", "e").color } } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("TextField_normal_text", "d").color property int pointSize: Units.dp * 10 property int rightPadding: 10 } @@ -43,22 +44,22 @@ QtObject { property QtObject border: QtObject { property QtObject color: QtObject { - property color error: Colors.error.color - property color normal: Colors.c.color - property color selected: Colors.i.color + property color error: "black" + property color normal: "black" + property color selected: "black" } property int width: 0 } property QtObject color: QtObject { - property color normal: Colors.q.color - property color readOnly: Colors.e.color + property color normal: ColorsList.add("TextField_unbordered_background_normal", "q").color + property color readOnly: ColorsList.add("TextField_unbordered_background_readonly", "e").color } } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("TextField_unbordered_text", "d").color property int pointSize: Units.dp * 10 property int rightPadding: 10 } @@ -72,22 +73,22 @@ QtObject { property QtObject border: QtObject { property QtObject color: QtObject { - property color error: Colors.error.color - property color normal: Colors.c.color - property color selected: Colors.i.color + property color error: "black" + property color normal: "black" + property color selected: "black" } property int width: 0 } property QtObject color: QtObject { - property color normal: Colors.q.color - property color readOnly: Colors.e.color + property color normal: ColorsList.add("TextField_flat_background_normal", "q").color + property color readOnly: ColorsList.add("TextField_flat_background_readonly", "e").color } } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("TextField_flat_text", "d").color property int pointSize: Units.dp * 10 property int rightPadding: 10 } diff --git a/linphone-app/ui/modules/Common/Styles/Form/ListFormStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/ListFormStyle.qml index c3efb9eff..2fe287c0a 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/ListFormStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/ListFormStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -10,7 +11,7 @@ QtObject { property QtObject value: QtObject { property QtObject placeholder: QtObject { - property color color: Colors.n.color + property color color: ColorsList.add("ListForm_placeholder", "n").color property int pointSize: Units.dp * 10 } @@ -24,7 +25,7 @@ QtObject { property int iconSize: 18 property QtObject text: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("ListForm_text", "j").color property int pointSize: Units.dp * 9 property int width: 130 } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormHGroupStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormHGroupStyle.qml index 0cdb90719..eb8c60175 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormHGroupStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormHGroupStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -13,7 +14,7 @@ QtObject { } property QtObject legend: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("FormHGroup_legend", "j").color property int pointSize: Units.dp * 10 property int height: 36 property int width: 200 diff --git a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormStyle.qml index 46ef7f68d..634db4bf9 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -13,12 +14,12 @@ QtObject { property int spacing: 5 property QtObject separator: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("Form_header_separator", "i").color property int height: 2 } property QtObject title: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("Form_header_title", "i").color property int pointSize: Units.dp * 12 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormTableStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormTableStyle.qml index 70dd96818..51c7d7cce 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormTableStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormTableStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -14,7 +15,7 @@ QtObject { property int maxWidth: 400 property QtObject text: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Form_entry_text", "j").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml index 25329c338..6703974dd 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -13,13 +14,13 @@ QtObject { } property QtObject error: QtObject { - property color color: Colors.error.color + property color color: ColorsList.add("FormV_error", "error").color property int pointSize: Units.dp * 10 property int height: 11 } property QtObject legend: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("FormV_legend", "j").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/SearchBoxStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/SearchBoxStyle.qml index 95639e95c..f94598233 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/SearchBoxStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/SearchBoxStyle.qml @@ -1,9 +1,9 @@ pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= QtObject { - property color shadowColor: Colors.l.color + property color shadowColor: ColorsList.add("SearchBox_shadow", "l").color } diff --git a/linphone-app/ui/modules/Common/Styles/Form/SliderStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/SliderStyle.qml index 7b19fa769..089fb9bbb 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/SliderStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/SliderStyle.qml @@ -1,18 +1,18 @@ pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject background: QtObject { - property color color: Colors.c.color + property color color: ColorsList.add("Slider_background", "c").color property int height: 4 property int radius: 2 property int width: 200 property QtObject content: QtObject { - property color color: Colors.m.color + property color color: ColorsList.add("Slider_content", "m").color property int radius: 2 } } @@ -24,14 +24,14 @@ QtObject { property QtObject border: QtObject { property QtObject color: QtObject { - property color normal: Colors.c.color - property color pressed: Colors.c.color + property color normal: ColorsList.add("Slider_handle_border_normal", "c").color + property color pressed: ColorsList.add("Slider_handle_border_pressed", "c").color } } property QtObject color: QtObject { - property color normal: Colors.e.color - property color pressed: Colors.f.color + property color normal: ColorsList.add("Slider_handle_normal", "e").color + property color pressed: ColorsList.add("Slider_handle_pressed", "f").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/SwitchStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/SwitchStyle.qml index 2d17d68a2..89ee98103 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/SwitchStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/SwitchStyle.qml @@ -1,5 +1,6 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject{ @@ -14,16 +15,16 @@ QtObject{ property int width: 48 property QtObject border: QtObject { property QtObject color: QtObject { - property color checked: Colors.i.color - property color disabled: Colors.c.color - property color normal: Colors.c.color + property color checked: ColorsList.add("Switch_normal_indicator_border_checked", "i").color + property color disabled: ColorsList.add("Switch_normal_indicator_border_disabled", "c").color + property color normal: ColorsList.add("Switch_normal_indicator_border_normal", "c").color } } property QtObject color: QtObject { - property color checked: Colors.i.color - property color disabled: Colors.e.color - property color normal: Colors.q.color + property color checked: ColorsList.add("Switch_normal_indicator_checked", "i").color + property color disabled: ColorsList.add("Switch_normal_indicator_disabled", "e").color + property color normal: ColorsList.add("Switch_normal_indicator_normal", "q").color } } @@ -32,17 +33,17 @@ QtObject{ property QtObject border: QtObject { property QtObject color: QtObject { - property color checked: Colors.i.color - property color disabled: Colors.c.color - property color normal: Colors.n.color - property color pressed: Colors.n.color + property color checked: ColorsList.add("Switch_normal_sphere_border_checked", "i").color + property color disabled: ColorsList.add("Switch_normal_sphere_border_disabled", "c").color + property color normal: ColorsList.add("Switch_normal_sphere_border_normal", "n").color + property color pressed: ColorsList.add("Switch_normal_sphere_border_pressed", "n").color } } property QtObject color: QtObject { - property color pressed: Colors.c.color - property color disabled: Colors.e.color - property color normal: Colors.q.color + property color pressed: ColorsList.add("Switch_normal_sphere_pressed", "c").color + property color disabled: ColorsList.add("Switch_normal_sphere_disabled", "e").color + property color normal: ColorsList.add("Switch_normal_sphere_normal", "q").color } } } @@ -57,16 +58,16 @@ QtObject{ property int width: 48 property QtObject border: QtObject { property QtObject color: QtObject { - property color checked: Colors.s.color - property color disabled: Colors.c.color - property color normal: Colors.c.color + property color checked: ColorsList.add("Switch_aux_indicator_border_checked", "s").color + property color disabled: ColorsList.add("Switch_aux_indicator_border_disabled", "c").color + property color normal: ColorsList.add("Switch_aux_indicator_border_normal", "c").color } } property QtObject color: QtObject { - property color checked: Colors.s.color - property color disabled: Colors.e.color - property color normal: Colors.q.color + property color checked: ColorsList.add("Switch_aux_indicator_checked", "s").color + property color disabled: ColorsList.add("Switch_aux_indicator_disabled", "e").color + property color normal: ColorsList.add("Switch_aux_indicator_normal", "q").color } } @@ -75,17 +76,17 @@ QtObject{ property QtObject border: QtObject { property QtObject color: QtObject { - property color checked: Colors.s.color - property color disabled: Colors.c.color - property color normal: Colors.n.color - property color pressed: Colors.n.color + property color checked: ColorsList.add("Switch_aux_sphere_border_checked", "s").color + property color disabled: ColorsList.add("Switch_aux_sphere_border_disabled", "c").color + property color normal: ColorsList.add("Switch_aux_sphere_border_normal", "n").color + property color pressed: ColorsList.add("Switch_aux_sphere_border_pressed", "n").color } } property QtObject color: QtObject { - property color pressed: Colors.c.color - property color disabled: Colors.e.color - property color normal: Colors.q.color + property color pressed: ColorsList.add("Switch_aux_sphere_pressed", "c").color + property color disabled: ColorsList.add("Switch_aux_sphere_disabled", "e").color + property color normal: ColorsList.add("Switch_aux_sphere_normal", "q").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml index 6238dd0c6..8d5f037a1 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Tab/TabButtonStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -9,11 +10,11 @@ QtObject { property int spacing: 8 property QtObject backgroundColor: QtObject { - property color disabled: Colors.i30.color - property color hovered: Colors.b.color - property color normal: Colors.i.color - property color pressed: Colors.m.color - property color selected: Colors.k.color + property color disabled: ColorsList.add("TabButton_background_disabled", "i30").color + property color hovered: ColorsList.add("TabButton_background_hovered", "b").color + property color normal: ColorsList.add("TabButton_background_normal", "i").color + property color pressed: ColorsList.add("TabButton_background_pressed", "m").color + property color selected: ColorsList.add("TabButton_background_selected", "k").color } property QtObject icon: QtObject { @@ -27,11 +28,11 @@ QtObject { property int rightPadding: 10 property QtObject color: QtObject { - property color disabled: Colors.q.color - property color hovered: Colors.q.color - property color normal: Colors.q.color - property color pressed: Colors.q.color - property color selected: Colors.i.color + property color disabled: ColorsList.add("TabButton_text_disabled", "q").color + property color hovered: ColorsList.add("TabButton_text_hovered", "q").color + property color normal: ColorsList.add("TabButton_text_normal", "q").color + property color pressed: ColorsList.add("TabButton_text_pressed", "q").color + property color selected: ColorsList.add("TabButton_text_selected", "i").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml index a35d77306..ddde5ee95 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/Tab/TabContainerStyle.qml @@ -1,10 +1,11 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("TabContainer", "k").color property int bottomMargin: 30 property int leftMargin: 30 property int rightMargin: 40 @@ -12,6 +13,6 @@ QtObject { property QtObject separator: QtObject { property int height: 2 - property color color: Colors.f.color + property color color: ColorsList.add("TabContainer_separator", "f").color } } diff --git a/linphone-app/ui/modules/Common/Styles/Form/TransparentTextInputStyle.qml b/linphone-app/ui/modules/Common/Styles/Form/TransparentTextInputStyle.qml index ffded571d..f40b6d5d1 100644 --- a/linphone-app/ui/modules/Common/Styles/Form/TransparentTextInputStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Form/TransparentTextInputStyle.qml @@ -2,16 +2,17 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color backgroundColor: Colors.f.color + property color backgroundColor: ColorsList.add("TabTransparentTextInput_background", "f").color property int iconSize: 12 property int padding: 10 property QtObject placeholder: QtObject { - property color color: Colors.n.color + property color color: ColorsList.add("TabTransparentTextInput_palceholder", "n").color property int pointSize: Units.dp * 10 } @@ -19,8 +20,8 @@ QtObject { property int pointSize: Units.dp * 10 property QtObject color: QtObject { - property color focused: Colors.l.color - property color normal: Colors.d.color + property color focused: ColorsList.add("TabTransparentTextInput_text_focused", "l").color + property color normal: ColorsList.add("TabTransparentTextInput_text_normal", "d").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Indicators/VuMeterStyle.qml b/linphone-app/ui/modules/Common/Styles/Indicators/VuMeterStyle.qml index 7c7782815..828a8e7ce 100644 --- a/linphone-app/ui/modules/Common/Styles/Indicators/VuMeterStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Indicators/VuMeterStyle.qml @@ -1,6 +1,8 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 + // ============================================================================= QtObject { @@ -10,26 +12,26 @@ QtObject { property QtObject high: QtObject { property QtObject background: QtObject { property QtObject color: QtObject { - property color disabled: Colors.o.color - property color enabled: Colors.n.color + property color disabled: ColorsList.add("VuMeter_background_disabled", "o").color + property color enabled: ColorsList.add("VuMeter_background_enabled", "n").color } } property QtObject contentItem: QtObject { - property color color: Colors.b.color + property color color: ColorsList.add("VuMeter_contentItem", "b").color } } property QtObject low: QtObject { property QtObject background: QtObject { property QtObject color: QtObject { - property color disabled: Colors.o.color - property color enabled: Colors.n.color + property color disabled: ColorsList.add("VuMeter_low_background_disabled", "o").color + property color enabled: ColorsList.add("VuMeter_low_background_enabled", "n").color } } property QtObject contentItem: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("VuMeter_low_contentItem", "j").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Menus/ApplicationMenuStyle.qml b/linphone-app/ui/modules/Common/Styles/Menus/ApplicationMenuStyle.qml index b01b941e9..3f50ff93a 100644 --- a/linphone-app/ui/modules/Common/Styles/Menus/ApplicationMenuStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Menus/ApplicationMenuStyle.qml @@ -2,12 +2,13 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { property int spacing: 1 - property color backgroundColor: Colors.n.color + property color backgroundColor: ColorsList.add("ApplicationMenu_background", "n").color property QtObject entry: QtObject { property int iconSize: 24 @@ -16,14 +17,14 @@ QtObject { property int spacing: 18 property QtObject color: QtObject { - property color hovered: Colors.h.color - property color normal: Colors.g.color - property color pressed: Colors.i.color - property color selected: Colors.j.color + property color hovered: ColorsList.add("ApplicationMenu_entry_hovered", "h").color + property color normal: ColorsList.add("ApplicationMenu_entry_normal", "g").color + property color pressed: ColorsList.add("ApplicationMenu_entry_pressed", "i").color + property color selected: ColorsList.add("ApplicationMenu_entry_selected", "j").color } property QtObject indicator: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("ApplicationMenu_entry_indicator", "i").color property int width: 5 } @@ -31,8 +32,8 @@ QtObject { property int pointSize: Units.dp * 10 property QtObject color: QtObject { - property color normal: Colors.q.color //q50 - property color selected: Colors.q.color + property color normal: ColorsList.add("ApplicationMenu_entry_text_normal", "q").color + property color selected: ColorsList.add("ApplicationMenu_entry_text_selected", "q").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Menus/DropDownStaticMenuStyle.qml b/linphone-app/ui/modules/Common/Styles/Menus/DropDownStaticMenuStyle.qml index 2e4e22e45..eec18bfa5 100644 --- a/linphone-app/ui/modules/Common/Styles/Menus/DropDownStaticMenuStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Menus/DropDownStaticMenuStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -13,13 +14,13 @@ QtObject { property int rightMargin: 8 property QtObject color: QtObject { - property color hovered: Colors.j.color - property color normal: Colors.g.color - property color pressed: Colors.i.color + property color hovered: ColorsList.add("DropDownMenu_entry_hovered", "j").color + property color normal: ColorsList.add("DropDownMenu_entry_normal", "g").color + property color pressed: ColorsList.add("DropDownMenu_entry_pressed", "i").color } property QtObject text: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("DropDownMenu_entry_text", "q").color property int pointSize: Units.dp * 9 } } diff --git a/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml b/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml index f276c81dd..a73e61fd3 100644 --- a/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Menus/MenuItemStyle.qml @@ -3,6 +3,7 @@ import QtQml 2.2 import QtQuick 2.3 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -15,9 +16,9 @@ QtObject { property int height: 30 property QtObject color: QtObject { - property color hovered: Colors.o.color - property color normal: Colors.q.color - property color pressed: Colors.o.color + property color hovered: ColorsList.add("MenuItem_normal_background_hovered", "o").color + property color normal: ColorsList.add("MenuItem_normal_background_normal", "q").color + property color pressed: ColorsList.add("MenuItem_normal_background_pressed", "o").color } } @@ -26,10 +27,10 @@ QtObject { property int weight : Font.Bold property QtObject color: QtObject { - property color hovered: Colors.j.color - property color normal: Colors.j.color - property color pressed: Colors.j.color - property color disabled: Colors.l50.color + property color hovered: ColorsList.add("MenuItem_normal_text_hovered", "j").color + property color normal: ColorsList.add("MenuItem_normal_text_normal", "j").color + property color pressed: ColorsList.add("MenuItem_normal_text_pressed", "j").color + property color disabled: ColorsList.add("MenuItem_normal_text_disabled", "l50").color } } } @@ -41,9 +42,9 @@ QtObject { property int height: 40 property QtObject color: QtObject { - property color hovered: Colors.v.color - property color normal: Colors.a.color - property color pressed: Colors.v.color + property color hovered: ColorsList.add("MenuItem_aux_background_hovered", "v").color + property color normal: ColorsList.add("MenuItem_aux_background_normal", "a").color + property color pressed: ColorsList.add("MenuItem_aux_background_pressed", "v").color } } @@ -52,10 +53,10 @@ QtObject { property int weight : Font.Normal property QtObject color: QtObject { - property color hovered: Colors.j.color - property color normal: Colors.j.color - property color pressed: Colors.j.color - property color disabled: Colors.l50.color + property color hovered: ColorsList.add("MenuItem_aux_text_hovered", "j").color + property color normal: ColorsList.add("MenuItem_aux_text_normal", "j").color + property color pressed: ColorsList.add("MenuItem_aux_text_pressed", "j").color + property color disabled: ColorsList.add("MenuItem_aux_text_disabled", "l50").color } } } @@ -67,9 +68,9 @@ QtObject { property int height: 40 property QtObject color: QtObject { - property color hovered: Colors.v.color - property color normal: Colors.a.color - property color pressed: Colors.v.color + property color hovered: ColorsList.add("MenuItem_auxRed_background_hovered", "v").color + property color normal: ColorsList.add("MenuItem_auxRed_background_normal", "a").color + property color pressed: ColorsList.add("MenuItem_auxRed_background_pressed", "v").color } } @@ -78,10 +79,10 @@ QtObject { property int weight : Font.Normal property QtObject color: QtObject { - property color hovered: Colors.error.color - property color normal: Colors.error.color - property color pressed: Colors.error.color - property color disabled: Colors.l50.color + property color hovered: ColorsList.add("MenuItem_auxRed_text_hovered", "error").color + property color normal: ColorsList.add("MenuItem_auxRed_text_normal", "error").color + property color pressed: ColorsList.add("MenuItem_auxRed_text_pressed", "error").color + property color disabled: ColorsList.add("MenuItem_auxRed_text_disabled", "l50").color } } } @@ -93,9 +94,9 @@ QtObject { property int height: 50 property QtObject color: QtObject { - property color hovered: Colors.w.color - property color normal: Colors.w.color - property color pressed: Colors.w.color + property color hovered: ColorsList.add("MenuItem_aux2_background_hovered", "w").color + property color normal: ColorsList.add("MenuItem_aux2_background_normal", "w").color + property color pressed: ColorsList.add("MenuItem_aux2_background_pressed", "v").color } } @@ -104,10 +105,10 @@ QtObject { property int weight : Font.Normal property QtObject color: QtObject { - property color hovered: Colors.m.color - property color normal: Colors.j.color - property color pressed: Colors.m.color - property color disabled: Colors.l50.color + property color hovered: ColorsList.add("MenuItem_aux2_text_hovered", "m").color + property color normal: ColorsList.add("MenuItem_aux2_text_normal", "j").color + property color pressed: ColorsList.add("MenuItem_aux2_text_pressed", "m").color + property color disabled: ColorsList.add("MenuItem_aux2_text_disabled", "l50").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Menus/MenuStyle.qml b/linphone-app/ui/modules/Common/Styles/Menus/MenuStyle.qml index 888173630..8261a1653 100644 --- a/linphone-app/ui/modules/Common/Styles/Menus/MenuStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Menus/MenuStyle.qml @@ -1,40 +1,41 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject normal : QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Menu_normal", "q").color property int width: 130 property bool shadowEnabled: true property int radius : 0 property QtObject border : QtObject { - property color color: Colors.u.color + property color color: "black" property int width: 0 } } property QtObject aux : QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Menu_aux", "q").color property int width: 200 property bool shadowEnabled: false property int radius : 5 property QtObject border : QtObject { - property color color: Colors.u.color + property color color: ColorsList.add("Menu_aux_border", "u").color property int width: 1 } } property QtObject aux2 : QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Menu_aux2", "q").color property int width: 250 property bool shadowEnabled: false property int radius : 0 property QtObject border : QtObject { - property color color: Colors.u.color + property color color: "black" property int width: 0 } } diff --git a/linphone-app/ui/modules/Common/Styles/Misc/ForceScrollBarStyle.qml b/linphone-app/ui/modules/Common/Styles/Misc/ForceScrollBarStyle.qml index 7f6494af8..fcc29e629 100644 --- a/linphone-app/ui/modules/Common/Styles/Misc/ForceScrollBarStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Misc/ForceScrollBarStyle.qml @@ -1,11 +1,12 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject background : QtObject { - property color color: Colors.g20.color + property color color: ColorsList.add("ForceScrollBar_background", "g20").color property int radius : 10 } @@ -16,8 +17,8 @@ QtObject { } property QtObject color: QtObject { - property color hovered: Colors.h.color - property color normal: Colors.g20.color - property color pressed: Colors.d.color + property color hovered: ColorsList.add("ForceScrollBar_hovered", "h").color + property color normal: ColorsList.add("ForceScrollBar_normal", "g20").color + property color pressed: ColorsList.add("ForceScrollBar_pressed", "d").color } } diff --git a/linphone-app/ui/modules/Common/Styles/Misc/PanedStyle.qml b/linphone-app/ui/modules/Common/Styles/Misc/PanedStyle.qml index a15bc57e5..7f35fd05b 100644 --- a/linphone-app/ui/modules/Common/Styles/Misc/PanedStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Misc/PanedStyle.qml @@ -1,6 +1,7 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { @@ -10,9 +11,9 @@ QtObject { property int width: 5 property QtObject color: QtObject { - property color hovered: Colors.h.color - property color normal: Colors.c.color - property color pressed: Colors.d.color + property color hovered: ColorsList.add("Paned_hovered", "h").color + property color normal: ColorsList.add("Paned_normal", "c").color + property color pressed: ColorsList.add("Paned_pressed", "d").color } } } diff --git a/linphone-app/ui/modules/Common/Styles/Popup/PopupStyle.qml b/linphone-app/ui/modules/Common/Styles/Popup/PopupStyle.qml index 71cd84339..3947eeebe 100644 --- a/linphone-app/ui/modules/Common/Styles/Popup/PopupStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Popup/PopupStyle.qml @@ -1,14 +1,15 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { - property color backgroundColor: Colors.k.color + property color backgroundColor: ColorsList.add("Popup_background", "k").color property QtObject shadow: QtObject { - property color color: Colors.l.color + property color color: ColorsList.add("Popup_shadow", "l").color property int horizontalOffset: 2 property int radius: 10 property int samples: 15 diff --git a/linphone-app/ui/modules/Common/Styles/Tooltip/TooltipStyle.qml b/linphone-app/ui/modules/Common/Styles/Tooltip/TooltipStyle.qml index 17d88d98b..5bd6cedc2 100644 --- a/linphone-app/ui/modules/Common/Styles/Tooltip/TooltipStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Tooltip/TooltipStyle.qml @@ -2,12 +2,13 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color backgroundColor: Colors.g.color - property color color: Colors.q.color + property color backgroundColor: ColorsList.add("Tooltip_background", "g").color + property color color: ColorsList.add("Tooltip", "q").color property int arrowSize: 8 property int delay: 1000 property int pointSize: Units.dp * 9 diff --git a/linphone-app/ui/modules/Common/Styles/Window/WindowStyle.qml b/linphone-app/ui/modules/Common/Styles/Window/WindowStyle.qml index daf194d73..2e39c8fa4 100644 --- a/linphone-app/ui/modules/Common/Styles/Window/WindowStyle.qml +++ b/linphone-app/ui/modules/Common/Styles/Window/WindowStyle.qml @@ -1,11 +1,12 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject transientWindow: QtObject { - property color color: Colors.l80.color + property color color: ColorsList.add("Window_transient", "l80").color } } diff --git a/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml b/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml index bdd6cdb3e..d2ee1d2c2 100644 --- a/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml @@ -9,6 +9,7 @@ import LinphoneEnums 1.0 import Linphone.Styles 1.0 import Utils 1.0 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -72,7 +73,7 @@ Row { //property ContentModel contentModel : ($chatEntry.getContent(0) ? $chatEntry.getContent(0) : null) property ContentModel contentModel : $chatEntry.fileContentModel - property string thumbnail : contentModel.thumbnail + property string thumbnail : contentModel ? contentModel.thumbnail : '' color: isOutgoing ? ChatStyle.entry.message.outgoing.backgroundColor : ChatStyle.entry.message.incoming.backgroundColor @@ -311,7 +312,7 @@ Row { spacing:5 Text{ text: $chatEntry.ephemeralExpireTime > 0 ? Utils.formatElapsedTime($chatEntry.ephemeralExpireTime) : Utils.formatElapsedTime($chatEntry.ephemeralLifetime) - color: Colors.ad.color + color: ColorsList.add("FileMessage_ephemeral_text", "ad").color font.pointSize: Units.dp * 8 Timer{ running:parent.visible diff --git a/linphone-app/ui/modules/Linphone/Chat/Message.qml b/linphone-app/ui/modules/Linphone/Chat/Message.qml index 4d291bb3d..0b0edf26a 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Message.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Message.qml @@ -13,6 +13,8 @@ import Units 1.0 import UtilsCpp 1.0 import LinphoneEnums 1.0 +import ColorsList 1.0 + import 'Message.js' as Logic // ============================================================================= @@ -57,7 +59,7 @@ Item { spacing:5 Text{ text: $chatEntry.ephemeralExpireTime > 0 ? Utils.formatElapsedTime($chatEntry.ephemeralExpireTime) : Utils.formatElapsedTime($chatEntry.ephemeralLifetime) - color: Colors.ad.color + color: ColorsList.add("Message_ephemeral_text", "ad").color font.pointSize: Units.dp * 8 Timer{ running:parent.visible diff --git a/linphone-app/ui/modules/Linphone/Chat/Notice.qml b/linphone-app/ui/modules/Linphone/Chat/Notice.qml index 8aac0d798..1c28a9595 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Notice.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Notice.qml @@ -7,6 +7,7 @@ import Linphone.Styles 1.0 import Utils 1.0 import LinphoneEnums 1.0 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -84,7 +85,7 @@ RowLayout{ } property bool isImportant: $chatEntry.eventLogType == LinphoneEnums.EventLogTypeConferenceTerminated property bool isError: $chatEntry.status == ChatNoticeModel.NoticeError - property color eventColor : (isError ? Colors.error.color : ( isImportant ? Colors.error.color : Colors.ab.color )) + property color eventColor : (isError ? ColorsList.add("Notice_error", "error").color : ( isImportant ? ColorsList.add("Notice_important", "error").color : ColorsList.add("Notice", "ab").color )) Layout.preferredHeight: ChatStyle.entry.lineHeight diff --git a/linphone-app/ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml index cc0a672a9..a88055df7 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -15,12 +16,12 @@ QtObject { } property QtObject sipAddress: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("Account_sipAddress", "g").color property int pointSize: Units.dp * 10 } property QtObject username: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Account_username", "j").color property int pointSize: Units.dp * 11 } property QtObject messageCounter: QtObject { diff --git a/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml index 2934e0097..48fc9e905 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -14,7 +15,7 @@ QtObject { } property QtObject description: QtObject { - property color color: Colors.n.color + property color color: ColorsList.add("CardBlock_description", "n").color property int pointSize: Units.dp * 10 property int height: 40 } @@ -25,7 +26,7 @@ QtObject { } property QtObject title: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("CardBlock_title", "j").color property int bottomMargin: 10 property int pointSize: Units.dp * 10 property int height: 20 diff --git a/linphone-app/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml index ce434fe3a..5e527eb98 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -9,7 +10,7 @@ QtObject { property int height: 60 property QtObject error: QtObject { - property color color: Colors.error.color + property color color: ColorsList.add("RequestBlock_error", "error").color property int pointSize: Units.dp * 11 property int padding: 4 } diff --git a/linphone-app/ui/modules/Linphone/Styles/Calls/CallControlsStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Calls/CallControlsStyle.qml index 12a2fc43f..afbc3832f 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Calls/CallControlsStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Calls/CallControlsStyle.qml @@ -1,11 +1,12 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.e.color + property color color: ColorsList.add("CallControl", "e").color property int height: 60 property int leftMargin: 12 property int rightMargin: 12 diff --git a/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml index 841451ab8..3b283ca57 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml @@ -2,11 +2,12 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.e.color + property color color: ColorsList.add("CallStats", "e").color property int height: 280 property int leftMargin: 12 property int rightMargin: 12 @@ -14,19 +15,19 @@ QtObject { property int topMargin: 10 property QtObject title: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("CallStats_title", "d").color property int bottomMargin: 20 property int pointSize: Units.dp * 16 } property QtObject key: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("CallStats_key", "d").color property int pointSize: Units.dp * 10 property int width: 200 } property QtObject value: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("CallStats_value", "d").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml index 86021f937..705b4a980 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Calls/CallsStyle.qml @@ -1,6 +1,7 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= @@ -12,24 +13,24 @@ QtObject { property int width: 200 property QtObject color: QtObject { - property color normal: Colors.e.color - property color selected: Colors.j.color + property color normal: ColorsList.add("Calls_entry_normal", "e").color + property color selected: ColorsList.add("Calls_entry_selected", "j").color } property QtObject endCallAnimation: QtObject { - property color blinkColor: Colors.i.color + property color blinkColor: ColorsList.add("Calls_entry_end_blink", "i").color property int duration: 300 property int loops: 3 } property QtObject sipAddressColor: QtObject { - property color normal: Colors.n.color - property color selected: Colors.q.color + property color normal: ColorsList.add("Calls_entry_sipAddress_normal", "n").color + property color selected: ColorsList.add("Calls_entry_sipAddress_selected", "q").color } property QtObject usernameColor: QtObject { - property color normal: Colors.j.color - property color selected: Colors.q.color + property color normal: ColorsList.add("Calls_entry_username_normal", "j").color + property color selected: ColorsList.add("Calls_entry_username_selected", "q").color } } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Calls/ConferenceControlsStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Calls/ConferenceControlsStyle.qml index ab4b00687..2bedb9001 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Calls/ConferenceControlsStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Calls/ConferenceControlsStyle.qml @@ -1,11 +1,12 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.e.color + property color color: ColorsList.add("ConferenceControls", "e").color property int height: 60 property int leftMargin: 12 property int rightMargin: 12 diff --git a/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml index 68909bbf9..f33adcf28 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Chat/ChatStyle.qml @@ -2,24 +2,25 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Chat", "q").color property QtObject sectionHeading: QtObject { property int padding: 5 property int bottomMargin: 20 property QtObject border: QtObject { - property color color: Colors.g10.color + property color color: ColorsList.add("Chat_section_border", "g10").color property int width: 1 } property QtObject text: QtObject { property int pointSize: Units.dp * 10 - property color color: Colors.ab.color + property color color: ColorsList.add("Chat_section_text", "ab").color } } @@ -27,13 +28,13 @@ QtObject { property int height: 80 property QtObject border: QtObject { - property color color: Colors.f.color + property color color: ColorsList.add("Chat_send_border", "f").color property int width: 1 } } property QtObject composingText: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("Chat_composing_text", "d").color property int height: 25 property int leftPadding: 20 property int pointSize: Units.dp * 9 @@ -50,7 +51,7 @@ QtObject { property int iconSize: 18 property QtObject text: QtObject { - property color color: Colors.ac.color + property color color: ColorsList.add("Chat_entry_text", "ac").color property int pointSize: Units.dp * 10 } } @@ -79,11 +80,11 @@ QtObject { property QtObject extension: QtObject { property QtObject background: QtObject { - property color color: Colors.l50.color + property color color: ColorsList.add("Chat_file_extension_background", "l50").color } property QtObject text: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Chat_file_extension_text", "q").color } } @@ -95,11 +96,11 @@ QtObject { property int radius: 3 property QtObject background: QtObject { - property color color: Colors.f.color + property color color: ColorsList.add("Chat_file_statusbar_background", "f").color } property QtObject contentItem: QtObject { - property color color: Colors.p.color + property color color: ColorsList.add("Chat_file_statusbar_content", "p").color } } } @@ -110,30 +111,30 @@ QtObject { } property QtObject incoming: QtObject { - property color backgroundColor: Colors.o.color + property color backgroundColor: ColorsList.add("Chat_incoming_background", "o").color property int avatarSize: 20 property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("Chat_incoming_text", "d").color property int pointSize: Units.dp * 10 } } property QtObject outgoing: QtObject { - property color backgroundColor: Colors.e.color + property color backgroundColor: ColorsList.add("Chat_outgoing_background", "e").color property int areaSize: 16 property int busyIndicatorSize: 16 property int sendIconSize: 12 property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("Chat_outgoing_text", "d").color property int pointSize: Units.dp * 10 } } } property QtObject time: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("Chat_time", "d").color property int pointSize: Units.dp * 10 property int width: 44 } diff --git a/linphone-app/ui/modules/Linphone/Styles/Codecs/CodecsViewerStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Codecs/CodecsViewerStyle.qml index adb0661ad..66db86d61 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Codecs/CodecsViewerStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Codecs/CodecsViewerStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -13,8 +14,8 @@ QtObject { property QtObject background: QtObject { property QtObject color: QtObject { - property color normal: Colors.a.color - property color hovered: Colors.o.color + property color normal: ColorsList.add("Codecs_normal", "a").color + property color hovered: ColorsList.add("Codecs_hovered", "o").color } } @@ -23,7 +24,7 @@ QtObject { } property QtObject text: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Codecs_text", "j").color property int pointSize: Units.dp * 10 } } @@ -38,7 +39,7 @@ QtObject { } property QtObject legend: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Codecs_legend", "j").color property int pointSize: Units.dp * 10 property int height: 50 } diff --git a/linphone-app/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml index 19915c0f8..29f08ca81 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Contact/AvatarStyle.qml @@ -2,14 +2,15 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color backgroundColor: Colors.d.color + property color backgroundColor: ColorsList.add("Avatar_background", "d").color property QtObject initials: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Avatar_initials", "q").color property int pointSize: Units.dp * 10 property int ratio: 30 } diff --git a/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml index 370f1464e..d7a1d6c63 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml @@ -3,22 +3,23 @@ import QtQml 2.2 import QtQuick 2.7 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject sipAddress: QtObject { - property color color: Colors.n.color + property color color: ColorsList.add("ContactDescription_sipAddress", "n").color property int pointSize: Units.dp * 10 property int weight: Font.Normal } property QtObject username: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("ContactDescription_username", "j").color property int pointSize: Units.dp * 11 property int weight: Font.Bold property QtObject status : QtObject{ - property color color : Colors.g.color + property color color : ColorsList.add("ContactDescription_status", "g").color property int pointSize : Units.dp * 9 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Dialog/OnlineInstallerDialogStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Dialog/OnlineInstallerDialogStyle.qml index 4df18e665..c943806cd 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Dialog/OnlineInstallerDialogStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Dialog/OnlineInstallerDialogStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -17,19 +18,19 @@ QtObject { property int radius: 6 property QtObject background: QtObject { - property color color: Colors.f.color + property color color: ColorsList.add("OnlineInstallerDialog_bar_background", "f").color } property QtObject contentItem: QtObject { property QtObject color: QtObject { - property color failed: Colors.error.color - property color normal: Colors.p.color + property color failed: ColorsList.add("OnlineInstallerDialog_bar_content_failed", "error").color + property color normal: ColorsList.add("OnlineInstallerDialog_bar_content_normal", "p").color } } } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("OnlineInstallerDialog_text", "d").color property int pointSize: Units.dp * 11 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/History/HistoryStyle.qml b/linphone-app/ui/modules/Linphone/Styles/History/HistoryStyle.qml index 8952a6e00..c68e75ce1 100644 --- a/linphone-app/ui/modules/Linphone/Styles/History/HistoryStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/History/HistoryStyle.qml @@ -2,24 +2,25 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("History", "q").color property QtObject sectionHeading: QtObject { property int padding: 5 property int bottomMargin: 20 property QtObject border: QtObject { - property color color: Colors.g10.color + property color color: ColorsList.add("History_section_border", "g10").color property int width: 1 } property QtObject text: QtObject { property int pointSize: Units.dp * 10 - property color color: Colors.g.color + property color color: ColorsList.add("History_section_text", "g").color } } @@ -35,7 +36,7 @@ QtObject { property int iconSize: 18 property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("History_event_text", "d").color property int pointSize: Units.dp * 10 } } @@ -52,7 +53,7 @@ QtObject { } property QtObject time: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("History_time", "d").color property int pointSize: Units.dp * 10 property int width: 44 } diff --git a/linphone-app/ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml index 16a6656db..58fac0560 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml @@ -3,6 +3,8 @@ import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 + // ============================================================================= QtObject { @@ -16,13 +18,13 @@ QtObject { property int width: 300 property QtObject color: QtObject { - property color hovered: Colors.j.color - property color normal: Colors.g.color - property color pressed: Colors.i.color + property color hovered: ColorsList.add("SipAddressView_entry_hovered", "j").color + property color normal: ColorsList.add("SipAddressView_entry_normal", "g").color + property color pressed: ColorsList.add("SipAddressView_entry_pressed", "i").color } property QtObject text: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("SipAddressView_entry_text", "q").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Misc/MessageCounterStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Misc/MessageCounterStyle.qml index d0c5a02e4..e1e54b7ed 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Misc/MessageCounterStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Misc/MessageCounterStyle.qml @@ -3,6 +3,8 @@ import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 + // ============================================================================= QtObject { @@ -12,7 +14,7 @@ QtObject { } property QtObject text: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("MessageCounter_text", "q").color property int pointSize: Units.dp * 6 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml index e2c7c6ecc..1ef89432a 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -11,7 +12,7 @@ QtObject { property int overrodeHeight: 55 property QtObject message: QtObject { - property color color: Colors.h.color + property color color: ColorsList.add("Notification_basic_message", "h").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml index 957699799..47bbaaa7b 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml @@ -2,23 +2,24 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("NorificationReceived_file", "k").color property int leftMargin: 25 property int overrodeHeight: 55 property int rightMargin: 15 property int spacing: 10 property QtObject fileName: QtObject { - property color color: Colors.h.color + property color color: ColorsList.add("NorificationReceived_file_name", "h").color property int pointSize: Units.dp * 10 } property QtObject fileSize: QtObject { - property color color: Colors.h.color + property color color: ColorsList.add("NorificationReceived_file_size", "h").color property int pointSize: Units.dp * 9 property int width: 100 } diff --git a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml index 5ade58321..5a3829ac4 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml @@ -2,11 +2,12 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("NorificationReceived_message", "k").color property int bottomMargin: 15 property int leftMargin: 15 property int overrodeHeight: 55 @@ -14,12 +15,12 @@ QtObject { property int spacing: 0 property QtObject messageContainer: QtObject { - property color color: Colors.o.color + property color color: ColorsList.add("NorificationReceived_message_container", "o").color property int radius: 6 property int margins: 10 property QtObject text: QtObject { - property color color: Colors.l.color + property color color: ColorsList.add("NorificationReceived_message_container_text", "l").color property int pointSize: Units.dp * 9 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml index 0c82e6b89..e6625c9fa 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml @@ -1,16 +1,18 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 + // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("Norification", "k").color property int height: 120 property int iconSize: 40 property int width: 300 property QtObject border: QtObject { - property color color: Colors.n.color + property color color: ColorsList.add("Norification_border", "n").color property int width: 1 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/TelKeypad/TelKeypadStyle.qml b/linphone-app/ui/modules/Linphone/Styles/TelKeypad/TelKeypadStyle.qml index eddac5783..f0ed030a5 100644 --- a/linphone-app/ui/modules/Linphone/Styles/TelKeypad/TelKeypadStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/TelKeypad/TelKeypadStyle.qml @@ -2,7 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 - +import ColorsList 1.0 // ============================================================================= QtObject { @@ -10,19 +10,19 @@ QtObject { property int height: 180 property int rowSpacing: 0 property int width: 180 - property color color: Colors.k.color - property color selectedColor : Colors.m.color + property color color: ColorsList.add("TelKeypad", "k").color + property color selectedColor : ColorsList.add("TelKeypad_selected", "m").color property int selectedBorderWidth: 2 property real radius : 5.0 property QtObject button: QtObject { property QtObject color: QtObject { - property color normal: Colors.q.color - property color pressed: Colors.i.color + property color normal: ColorsList.add("TelKeypad_button_normal", "q").color + property color pressed: ColorsList.add("TelKeypad_button_pressed", "i").color } property QtObject line: QtObject { - property color color: Colors.l50.color + property color color: ColorsList.add("TelKeypad_button_line", "l50").color property int bottomMargin: 4 property int height: 2 property int leftMargin: 8 @@ -31,7 +31,7 @@ QtObject { } property QtObject text: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("TelKeypad_button_text", "d").color property int pointSize: Units.dp * 11 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml index b0cf7476e..52b6d7a9e 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml @@ -2,42 +2,43 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Timeline_background", "q").color property QtObject contact: QtObject { property int height: 60 property QtObject backgroundColor: QtObject { - property color a: Colors.g10.color - property color b: Colors.a.color - property color selected: Colors.i.color + property color a: ColorsList.add("Timeline_contact_background_a", "g10").color + property color b: ColorsList.add("Timeline_contact_background_b", "a").color + property color selected: ColorsList.add("Timeline_contact_background_selected", "i").color } property QtObject sipAddress: QtObject { property QtObject color: QtObject { - property color normal: Colors.n.color - property color selected: Colors.q.color + property color normal: ColorsList.add("Timeline_contact_sipAddress_normal", "n").color + property color selected: ColorsList.add("Timeline_contact_sipAddress_selected", "q").color } } property QtObject username: QtObject { property QtObject color: QtObject { - property color normal: Colors.j.color - property color selected: Colors.q.color + property color normal: ColorsList.add("Timeline_contact_username_normal", "j").color + property color selected: ColorsList.add("Timeline_contact_username_selected", "q").color } } } property QtObject legend: QtObject { property QtObject backgroundColor: QtObject { - property color normal: Colors.f.color - property color hovered: Colors.c.color + property color normal: ColorsList.add("Timeline_contact_legend_background_normal", "f").color + property color hovered: ColorsList.add("Timeline_contact_legend_background_hovered", "c").color } - property color color: Colors.d.color + property color color: ColorsList.add("Timeline_contact_legend", "d").color property int pointSize: Units.dp * 10 property int height: 30 property int iconSize: 14 diff --git a/linphone-app/ui/modules/Linphone/Styles/View/ParticipantsViewStyle.qml b/linphone-app/ui/modules/Linphone/Styles/View/ParticipantsViewStyle.qml index 12b0b8f49..ffdce74ce 100644 --- a/linphone-app/ui/modules/Linphone/Styles/View/ParticipantsViewStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/View/ParticipantsViewStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -9,7 +10,7 @@ QtObject { property QtObject entry: QtObject { property QtObject status: QtObject { - property color color : Colors.g.color + property color color : ColorsList.add("Participants_entry_status", "g").color property int pointSize : Units.dp * 8 } } diff --git a/linphone-app/ui/modules/Linphone/Styles/View/SipAddressesViewStyle.qml b/linphone-app/ui/modules/Linphone/Styles/View/SipAddressesViewStyle.qml index 56b5d8309..9cb3e2b74 100644 --- a/linphone-app/ui/modules/Linphone/Styles/View/SipAddressesViewStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/View/SipAddressesViewStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -12,17 +13,17 @@ QtObject { property int rightMargin: 10 property QtObject color: QtObject { - property color hovered: Colors.o.color - property color normal: Colors.q.color + property color hovered: ColorsList.add("SipAddressesView_entry_hovered", "o").color + property color normal: ColorsList.add("SipAddressesView_entry_normal", "q").color } property QtObject indicator: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("SipAddressesView_entry_indicator", "i").color property int width: 5 } property QtObject separator: QtObject { - property color color: Colors.c.color + property color color: ColorsList.add("SipAddressesView_entry_separator", "c").color property int height: 1 } } @@ -37,16 +38,16 @@ QtObject { } property QtObject color: QtObject { - property color normal: Colors.j.color - property color pressed: Colors.i.color + property color normal: ColorsList.add("SipAddressesView_header_normal", "j").color + property color pressed: ColorsList.add("SipAddressesView_header_pressed", "i").color } property QtObject text: QtObject { property int pointSize: Units.dp * 9 property QtObject color: QtObject { - property color normal: Colors.q.color - property color pressed: Colors.q.color + property color normal: ColorsList.add("SipAddressesView_header_text_normal", "q").color + property color pressed: ColorsList.add("SipAddressesView_header_text_pressed", "q").color } } } diff --git a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml index 6111799bf..3543e65f9 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml @@ -5,6 +5,7 @@ import QtQuick.Controls 2.5 import Common 1.0 import Linphone 1.0 import Linphone.Styles 1.0 +import ColorsList 1.0 import 'Timeline.js' as Logic @@ -117,7 +118,7 @@ Rectangle { Layout.fillWidth: true Layout.preferredHeight: filterChoices.height Layout.alignment: Qt.AlignCenter - border.color: Colors.border.color + border.color: ColorsList.add("Timeline_filter_border", "border").color border.width: 2 visible:false @@ -181,10 +182,9 @@ Rectangle { Layout.fillWidth: true Layout.preferredHeight: 40 Layout.alignment: Qt.AlignCenter - border.color: Colors.border.color + border.color: ColorsList.add("Timeline_search_border", "border").color border.width: 2 visible:false - //color: ContactsStyle.bar.backgroundColor onVisibleChanged: if(visible){ timeline.model.filterText = searchBar.text searchBar.forceActiveFocus() diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index 12f0c913a..b18b64aa8 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -11,6 +11,8 @@ import App.Styles 1.0 import Common.Styles 1.0 import Units 1.0 +import ColorsList 1.0 + import 'Conversation.js' as Logic @@ -117,7 +119,7 @@ ColumnLayout { //: 'Admin' : Admin(istrator) //~ Context One word title for describing the current admin status text: qsTr('adminStatus') - color: Colors.af.color + color: ColorsList.add("Conversation_admin_status", "af").color font.pointSize: Units.dp * 8 } } @@ -336,7 +338,7 @@ ColumnLayout { id: separator1 height:1 width:parent.width - color:Colors.u.color + color: ColorsList.add("Conversation_menu_separator", "u").color visible: groupInfoMenu.visible && devicesMenuItem.visible } MenuItem{ @@ -357,7 +359,7 @@ ColumnLayout { id: separator2 height:1 width:parent.width - color:Colors.u.color + color: ColorsList.add("Conversation_menu_separator", "u").color visible: ephemeralMenuItem.visible && (groupInfoMenu.visible || devicesMenuItem.visible) } MenuItem{ diff --git a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml index 6f420bd29..3fe22de5f 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/NewChatRoom.qml @@ -10,6 +10,7 @@ import App.Styles 1.0 import Common.Styles 1.0 import Units 1.0 import UtilsCpp 1.0 +import ColorsList 1.0 // ============================================================================= @@ -94,7 +95,7 @@ DialogPlus { Layout.fillWidth: true //: 'Would you like to encrypt your chat?' : Ask about setting the chat room as secured. text:qsTr('askEncryption') - color: Colors.g.color + color: ColorsList.add("NewChatRoom_ask_encryption", "g").color font.pointSize: Units.dp * 11 font.weight: Font.DemiBold } @@ -153,7 +154,7 @@ DialogPlus { textFormat: Text.RichText //: 'Subject' : Label of a text field about the subject of the chat room text :qsTr('subjectLabel') +'*' - color: Colors.g.color + color: ColorsList.add("NewChatRoom_subject_title", "g").color font.pointSize: Units.dp * 11 font.weight: Font.DemiBold } @@ -183,7 +184,7 @@ DialogPlus { Text{ //: 'Last contacts' : Header for showing last contacts text : qsTr('LastContactsTitle') - color: Colors.g.color + color: ColorsList.add("NewChatRoom_recent_contact_title", "g").color font.pointSize: Units.dp * 11 font.weight: Font.DemiBold } @@ -231,7 +232,7 @@ DialogPlus { font.weight: Font.DemiBold lineHeight: 0.8 - color: Colors.g.color + color: ColorsList.add("NewChatRoom_recent_contact_username", "g").color font.pointSize: Units.dp * 9 clip:false } @@ -282,7 +283,7 @@ DialogPlus { Layout.fillHeight: true Layout.fillWidth: true border.width: 1 - border.color: Colors.l.color + border.color: ColorsList.add("NewChatRoom_addresses_border", "l").color ColumnLayout { anchors.fill: parent @@ -339,7 +340,7 @@ DialogPlus { //~ one word for admin status text : qsTr('adminStatus') - color: Colors.g.color + color: ColorsList.add("NewChatRoom_addresses_admin", "g").color font.pointSize: Units.dp * 11 font.weight: Font.Light visible: participantView.count > 0 @@ -401,7 +402,7 @@ DialogPlus { //: 'Required' : Word relative to a star to explain that it is a requirement (Field form) text : '* '+qsTr('requiredField') //font.weight: Font.DemiBold - color: Colors.g.color + color: ColorsList.add("NewChatRoom_requiered_text", "g").color font.pointSize: Units.dp * 8 } } diff --git a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml index 82bda2c08..347e2cf8a 100644 --- a/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml +++ b/linphone-app/ui/views/App/Main/Dialogs/ParticipantsDevices.qml @@ -9,6 +9,7 @@ import LinphoneEnums 1.0 import App.Styles 1.0 import Units 1.0 +import ColorsList 1.0 import '../Conversation.js' as Logic @@ -121,7 +122,7 @@ DialogPlus { } } Rectangle { - color: Colors.ag.color + color: ColorsList.add("ParticipantDevices_separator", "ag").color Layout.preferredHeight: 1 Layout.fillWidth: true } @@ -147,7 +148,7 @@ DialogPlus { width:parent.width height:50 - color: Colors.ah.color + color: ColorsList.add("ParticipantDevices_line_background", "ah").color RowLayout{ anchors.fill:parent Text{ @@ -188,7 +189,7 @@ DialogPlus { } } Rectangle { - color: Colors.ag.color + color: ColorsList.add("ParticipantDevices_separator", "ag").color anchors.left : parent.left anchors.right :parent.right anchors.bottom: parent.bottom diff --git a/linphone-app/ui/views/App/Settings/SettingsAudio.qml b/linphone-app/ui/views/App/Settings/SettingsAudio.qml index 5bbd446f9..698ce86d2 100644 --- a/linphone-app/ui/views/App/Settings/SettingsAudio.qml +++ b/linphone-app/ui/views/App/Settings/SettingsAudio.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts 1.10 import Common 1.0 import Linphone 1.0 import Utils 1.0 +import ColorsList 1.0 import App.Styles 1.0 @@ -141,12 +142,12 @@ TabContainer { width: audioTestSlider.availableWidth height: implicitHeight radius: 2 - color: Colors.slider_background.color + color: ColorsList.add("SettingsAudio_slider_background", "slider_background").color Rectangle { width: audioTestSlider.visualPosition * parent.width height: parent.height - color: audioTestSlider.value > 0.8 ? Colors.slider_high.color : Colors.slider_low.color + color: audioTestSlider.value > 0.8 ? ColorsList.add("SettingsAudio_slider_high", "slider_high").color : ColorsList.add("SettingsAudio_slider_low", "slider_low").color radius: 2 } } diff --git a/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml b/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml index 0dc3acfb8..5029f6a75 100644 --- a/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/CallStyle.qml @@ -2,11 +2,12 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color backgroundColor: Colors.f.color + property color backgroundColor: ColorsList.add("Call_background", "f").color property QtObject actionArea: QtObject { property int height: 100 @@ -27,7 +28,7 @@ QtObject { } property QtObject callError: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("Call_action_error", "i").color property int pointSize: Units.dp * 12 } } @@ -36,15 +37,15 @@ QtObject { property int margins: 15 property QtObject avatar: QtObject { - property color backgroundColor: Colors.n.color + property color backgroundColor: ColorsList.add("Call_container_avatar_background", "n").color property int maxSize: 300 } property QtObject pause: QtObject { - property color color: Colors.g90.color + property color color: ColorsList.add("Call_container_pause", "g90").color property QtObject text: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("Call_container_pause_text", "q").color property int pointSizeFactor: 10 } } @@ -59,7 +60,7 @@ QtObject { property int topMargin: 26 property QtObject busyIndicator: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("Call_header_busy", "g").color property int height: 30 property int width: 30 } @@ -70,7 +71,7 @@ QtObject { } property QtObject elapsedTime: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Call_header_elapsed_time", "j").color property int pointSize: Units.dp * 10 property QtObject fullscreen: QtObject { @@ -91,8 +92,8 @@ QtObject { } property QtObject text: QtObject { - property color colorA: Colors.j.color - property color colorB: Colors.i.color + property color colorA: ColorsList.add("Call_zrtp_text_a", "j").color + property color colorB: ColorsList.add("Call_zrtp_text_b", "i").color property int pointSize: Units.dp * 10 property int wordsSpacing: 5 } diff --git a/linphone-app/ui/views/App/Styles/Calls/CallsWindowStyle.qml b/linphone-app/ui/views/App/Styles/Calls/CallsWindowStyle.qml index 2448a111b..b17799e14 100644 --- a/linphone-app/ui/views/App/Styles/Calls/CallsWindowStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/CallsWindowStyle.qml @@ -1,6 +1,6 @@ pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= @@ -13,14 +13,14 @@ QtObject { } property QtObject callsList: QtObject { - property color color: Colors.q.color + property color color: ColorsList.add("CallsWindow_list_background", "q").color property int defaultWidth: 250 property int maximumWidth: 250 property int minimumWidth: 110 property QtObject header: QtObject { - property color color1: Colors.q.color - property color color2: Colors.f.color + property color color1: ColorsList.add("CallsWindow_list_header_a", "q").color + property color color2: ColorsList.add("CallsWindow_list_header_b", "f").color property int height: 60 property int iconSize: 40 property int leftMargin: 10 diff --git a/linphone-app/ui/views/App/Styles/Calls/ConferenceStyle.qml b/linphone-app/ui/views/App/Styles/Calls/ConferenceStyle.qml index 24801c721..dcaf4102f 100644 --- a/linphone-app/ui/views/App/Styles/Calls/ConferenceStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/ConferenceStyle.qml @@ -2,12 +2,13 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject description: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Conference_description", "j").color property int pointSize: Units.dp * 12 property int height: 60 property int width: 150 diff --git a/linphone-app/ui/views/App/Styles/Calls/Dialogs/ConferenceManagerStyle.qml b/linphone-app/ui/views/App/Styles/Calls/Dialogs/ConferenceManagerStyle.qml index 480e531f8..ac442e29a 100644 --- a/linphone-app/ui/views/App/Styles/Calls/Dialogs/ConferenceManagerStyle.qml +++ b/linphone-app/ui/views/App/Styles/Calls/Dialogs/ConferenceManagerStyle.qml @@ -1,6 +1,7 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= @@ -14,7 +15,7 @@ QtObject { } property QtObject separator: QtObject { - property color color: Colors.c.color + property color color: ColorsList.add("ConferenceManager_separator", "c").color property int leftMargin: 25 property int rightMargin: 25 property int width: 1 diff --git a/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithEmailStyle.qml b/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithEmailStyle.qml index 9bd94bc38..9f57db1e2 100644 --- a/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithEmailStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithEmailStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -9,7 +10,7 @@ QtObject { property int spacing: 20 property QtObject activationSteps: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("ActivateApp_email_steps", "g").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithPhoneNumberStyle.qml b/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithPhoneNumberStyle.qml index 9bd94bc38..1aad8008a 100644 --- a/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithPhoneNumberStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Assistant/ActivateAppSipAccountWithPhoneNumberStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -9,7 +10,7 @@ QtObject { property int spacing: 20 property QtObject activationSteps: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("ActivateApp_phone_steps", "g").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml b/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml index 79d473163..30d79a7ce 100644 --- a/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -19,12 +20,12 @@ QtObject { property int spacing: 20 property QtObject description: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("Assistant_info_description", "g").color property int pointSize: Units.dp * 11 } property QtObject title: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("Assistant_info_title", "g").color property int pointSize: Units.dp * 11 } } diff --git a/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml b/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml index 6c5ad8ed6..c1445426d 100644 --- a/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -11,13 +12,13 @@ QtObject { property int iconSize: 150 property QtObject description: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("Assistant_home_description", "g").color property int pointSize: Units.dp * 10 property int height: 40 } property QtObject title: QtObject { - property color color: Colors.g.color + property color color: ColorsList.add("Assistant_home_title", "g").color property int pointSize: Units.dp * 11 property int height: 40 } diff --git a/linphone-app/ui/views/App/Styles/Main/AssistantStyle.qml b/linphone-app/ui/views/App/Styles/Main/AssistantStyle.qml index 46abd32a9..0c5f3a3b6 100644 --- a/linphone-app/ui/views/App/Styles/Main/AssistantStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/AssistantStyle.qml @@ -1,10 +1,12 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 + // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("Assistant", "k").color property int bottomMargin: 35 property int leftMargin: 90 property int rightMargin: 90 diff --git a/linphone-app/ui/views/App/Styles/Main/ContactEditStyle.qml b/linphone-app/ui/views/App/Styles/Main/ContactEditStyle.qml index 6de64797f..db9521c47 100644 --- a/linphone-app/ui/views/App/Styles/Main/ContactEditStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/ContactEditStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -12,7 +13,7 @@ QtObject { } property QtObject bar: QtObject { - property color color: Colors.e.color + property color color: ColorsList.add("ContactEdit_bar", "e").color property int avatarSize: 60 property int height: 80 property int leftMargin: 40 @@ -41,13 +42,13 @@ QtObject { } property QtObject username: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("ContactEdit_username", "j").color property int pointSize: Units.dp * 13 } } property QtObject content: QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("ContactEdit_content", "k").color } property QtObject values: QtObject { @@ -57,7 +58,7 @@ QtObject { property int topMargin: 20 property QtObject separator: QtObject { - property color color: Colors.f.color + property color color: ColorsList.add("ContactEdit_separator", "f").color property int height: 1 } } diff --git a/linphone-app/ui/views/App/Styles/Main/ContactsStyle.qml b/linphone-app/ui/views/App/Styles/Main/ContactsStyle.qml index 8ddbfc054..3626b3503 100644 --- a/linphone-app/ui/views/App/Styles/Main/ContactsStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/ContactsStyle.qml @@ -2,15 +2,16 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { - property color backgroundColor: Colors.k.color + property color backgroundColor: ColorsList.add("Contacts_background", "k").color property int spacing: 20 property QtObject bar: QtObject { - property color backgroundColor: Colors.e.color + property color backgroundColor: ColorsList.add("Contacts_bar_background", "e").color property int height: 60 property int leftMargin: 18 property int rightMargin: 18 @@ -27,27 +28,27 @@ QtObject { property int spacing: 15 property QtObject backgroundColor: QtObject { - property color normal: Colors.k.color - property color hovered: Colors.g10.color + property color normal: ColorsList.add("Contacts_contact_background_normal", "k").color + property color hovered: ColorsList.add("Contacts_contact_background_hovered", "g10").color } property QtObject border: QtObject { - property color color: Colors.f.color + property color color: ColorsList.add("Contacts_contact_border", "f").color property int width: 1 } property QtObject indicator: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("Contacts_contact_indicator", "i").color property int width: 5 } property QtObject presence: QtObject { property int pointSize: Units.dp * 10 - property color color: Colors.n.color + property color color: ColorsList.add("Contacts_contact_presence", "n").color } property QtObject username: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Contacts_contact_username", "j").color property int pointSize: Units.dp * 10 property int width: 220 } diff --git a/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml b/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml index 8e5e18254..c3538098d 100644 --- a/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/ConversationStyle.qml @@ -3,12 +3,13 @@ import QtQml 2.2 import QtQuick 2.7 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject bar: QtObject { - property color backgroundColor: Colors.e.color + property color backgroundColor: ColorsList.add("Conversation_bar_background", "e").color property int avatarSize: 60 property int groupChatSize: 55 property int height: 80 @@ -34,17 +35,17 @@ QtObject { property QtObject contactDescription : QtObject { property QtObject sipAddress: QtObject { - property color color: Colors.n.color + property color color: ColorsList.add("Conversation_description_sipAddress", "n").color property int pointSize: Units.dp * 10 property int weight: Font.Light } property QtObject username: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("Conversation_description_username", "j").color property int pointSize: Units.dp * 11 property int weight: Font.Normal property QtObject status : QtObject{ - property color color : Colors.g.color + property color color : ColorsList.add("Conversation_description_username_status", "g").color property int pointSize : Units.dp * 9 } } @@ -52,12 +53,12 @@ QtObject { } property QtObject filters: QtObject { - property color backgroundColor: Colors.q.color + property color backgroundColor: ColorsList.add("Conversation_filters_background", "q").color property int height: 51 property int leftMargin: 40 property QtObject border: QtObject { - property color color: Colors.g10.color + property color color: ColorsList.add("Conversation_filters_border", "g10").color property int bottomWidth: 1 property int topWidth: 0 } diff --git a/linphone-app/ui/views/App/Styles/Main/Dialogs/AboutStyle.qml b/linphone-app/ui/views/App/Styles/Main/Dialogs/AboutStyle.qml index 3a957539a..9946844c1 100644 --- a/linphone-app/ui/views/App/Styles/Main/Dialogs/AboutStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Dialogs/AboutStyle.qml @@ -1,6 +1,7 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 import Units 1.0 // ============================================================================= @@ -14,12 +15,12 @@ QtObject { property int spacing: 10 property QtObject license: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("About_license", "d").color property int pointSize: Units.dp * 10 } property QtObject url: QtObject { - property color color: Colors.i.color + property color color: ColorsList.add("About_url", "i").color property int pointSize: Units.dp * 10 } } @@ -29,12 +30,12 @@ QtObject { property int spacing: 10 property QtObject appVersion: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("About_appVersion", "d").color property int pointSize: Units.dp * 10 } property QtObject coreVersion: QtObject { - property color color: Colors.d.color + property color color: ColorsList.add("About_coreVersion", "d").color property int pointSize: Units.dp * 10 } } diff --git a/linphone-app/ui/views/App/Styles/Main/Dialogs/EphemeralChatRoomStyle.qml b/linphone-app/ui/views/App/Styles/Main/Dialogs/EphemeralChatRoomStyle.qml index 03920b525..bbd4f2348 100644 --- a/linphone-app/ui/views/App/Styles/Main/Dialogs/EphemeralChatRoomStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Dialogs/EphemeralChatRoomStyle.qml @@ -3,6 +3,7 @@ import QtQml 2.2 import QtQuick 2.7 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { @@ -22,10 +23,11 @@ QtObject { property int preferredWidth: 50 } property QtObject descriptionText: QtObject { + property int preferredWidth: 200 property int leftMargin: 10 property int rightMargin: 10 property real pointSize: Units.dp * 11 - property color color: Colors.d.color + property color color: ColorsList.add("Ephemeral_popup_description", "d").color } property QtObject timerPicker: QtObject { property int preferredWidth: 150 diff --git a/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoChatRoomStyle.qml b/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoChatRoomStyle.qml index 75acdf35a..8859ea12a 100644 --- a/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoChatRoomStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoChatRoomStyle.qml @@ -3,6 +3,7 @@ import QtQml 2.2 import QtQuick 2.7 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { @@ -22,11 +23,11 @@ QtObject { property QtObject results : QtObject{ property int topMargin : 10 - property color color : Colors.g.color + property color color : ColorsList.add("InfoChatRoom_results", "g").color property QtObject title : QtObject{ property int topMargin: 10 property int leftMargin: 20 - property color color: Colors.j.color + property color color: ColorsList.add("InfoChatRoom_results_title", "j").color property int pointSize : Units.dp * 11 property int weight : Font.DemiBold } @@ -42,23 +43,23 @@ QtObject { property QtObject leaveButton : QtObject { property QtObject backgroundColor: QtObject { - property color disabled: Colors.o.color - property color hovered: Colors.j.color - property color normal: Colors.k.color - property color pressed: Colors.i.color + property color disabled: ColorsList.add("InfoChatRoom_leave_background_disabled", "o").color + property color hovered: ColorsList.add("InfoChatRoom_leave_background_hovered", "j").color + property color normal: ColorsList.add("InfoChatRoom_leave_background_normal", "k").color + property color pressed: ColorsList.add("InfoChatRoom_leave_background_pressed", "i").color } property QtObject textColor: QtObject { - property color disabled: Colors.q.color - property color hovered: Colors.q.color - property color normal: Colors.i.color - property color pressed: Colors.q.color + property color disabled: ColorsList.add("InfoChatRoom_leave_text_disabled", "q").color + property color hovered: ColorsList.add("InfoChatRoom_leave_text_hovered", "q").color + property color normal: ColorsList.add("InfoChatRoom_leave_text_normal", "i").color + property color pressed: ColorsList.add("InfoChatRoom_leave_text_pressed", "q").color } property QtObject borderColor : QtObject{ - property color disabled: Colors.q.color - property color hovered: Colors.q.color - property color normal: Colors.i.color - property color pressed: Colors.q.color + property color disabled: ColorsList.add("InfoChatRoom_leave_border_disabled", "q").color + property color hovered: ColorsList.add("InfoChatRoom_leave_border_hovered", "q").color + property color normal: ColorsList.add("InfoChatRoom_leave_border_normal", "i").color + property color pressed: ColorsList.add("InfoChatRoom_leave_border_pressed", "q").color } } } \ No newline at end of file diff --git a/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoEncryptionStyle.qml b/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoEncryptionStyle.qml index a46a5e1f8..32fdd57db 100644 --- a/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoEncryptionStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/Dialogs/InfoEncryptionStyle.qml @@ -3,6 +3,7 @@ import QtQml 2.2 import QtQuick 2.7 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -20,17 +21,17 @@ QtObject { property QtObject okButton : QtObject{ property QtObject backgroundColor: QtObject { - property color disabled: Colors.i30.color - property color hovered: Colors.b.color - property color normal: Colors.s.color - property color pressed: Colors.m.color + property color disabled: ColorsList.add("InfoEncryption_ok_background_disabled", "i30").color + property color hovered: ColorsList.add("InfoEncryption_ok_background_hovered", "b").color + property color normal: ColorsList.add("InfoEncryption_ok_background_normal", "s").color + property color pressed: ColorsList.add("InfoEncryption_ok_background_pressed", "m").color } property QtObject textColor: QtObject { - property color disabled: Colors.q.color - property color hovered: Colors.q.color - property color normal: Colors.q.color - property color pressed: Colors.q.color + property color disabled: ColorsList.add("InfoEncryption_ok_text_disabled", "q").color + property color hovered: ColorsList.add("InfoEncryption_ok_text_hovered", "q").color + property color normal: ColorsList.add("InfoEncryption_ok_text_normal", "q").color + property color pressed: ColorsList.add("InfoEncryption_ok_text_pressed", "q").color } } @@ -44,6 +45,6 @@ QtObject { property int leftMargin: 10 property int rightMargin: 10 property real pointSize: Units.dp * 11 - property color color: Colors.d.color + property color color: ColorsList.add("InfoEncryption_description", "d").color } } \ No newline at end of file diff --git a/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml b/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml index 7781cd2d3..2042d9a38 100644 --- a/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/HistoryViewStyle.qml @@ -1,12 +1,12 @@ pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= QtObject { property QtObject bar: QtObject { - property color backgroundColor: Colors.e.color + property color backgroundColor: ColorsList.add("HistoryView_bar_background", "e").color property int avatarSize: 60 property int height: 80 property int leftMargin: 40 @@ -30,18 +30,18 @@ QtObject { } property QtObject description: QtObject { - property color sipAddressColor: Colors.g.color - property color usernameColor: Colors.j.color + property color sipAddressColor: ColorsList.add("HistoryView_bar_description_sipAddress", "g").color + property color usernameColor: ColorsList.add("HistoryView_bar_description_username", "j").color } } property QtObject filters: QtObject { - property color backgroundColor: Colors.q.color + property color backgroundColor: ColorsList.add("HistoryView_filters_background", "q").color property int height: 51 property int leftMargin: 40 property QtObject border: QtObject { - property color color: Colors.g10.color + property color color: ColorsList.add("HistoryView_filters_border", "g10").color property int bottomWidth: 1 property int topWidth: 0 } diff --git a/linphone-app/ui/views/App/Styles/Main/HomeStyle.qml b/linphone-app/ui/views/App/Styles/Main/HomeStyle.qml index 5a2fa4334..e4a1aa981 100644 --- a/linphone-app/ui/views/App/Styles/Main/HomeStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/HomeStyle.qml @@ -1,10 +1,10 @@ pragma Singleton import QtQml 2.2 - +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("Home_background", "k").color property int spacing: 20 } diff --git a/linphone-app/ui/views/App/Styles/Main/InviteFriendsStyle.qml b/linphone-app/ui/views/App/Styles/Main/InviteFriendsStyle.qml index 7dc053000..5b5d80053 100644 --- a/linphone-app/ui/views/App/Styles/Main/InviteFriendsStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/InviteFriendsStyle.qml @@ -1,11 +1,12 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("InviteFriends_background", "k").color property int width: 400 property QtObject message: QtObject { diff --git a/linphone-app/ui/views/App/Styles/Main/MainWindowStyle.qml b/linphone-app/ui/views/App/Styles/Main/MainWindowStyle.qml index 586d1eb35..767779360 100644 --- a/linphone-app/ui/views/App/Styles/Main/MainWindowStyle.qml +++ b/linphone-app/ui/views/App/Styles/Main/MainWindowStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQuick 2.7 import Units 1.0 +import ColorsList 1.0 // ============================================================================= @@ -24,7 +25,7 @@ QtObject { property QtObject text: QtObject { property int pointSize: Units.dp * 8 - property color color: Colors.i.color + property color color: ColorsList.add("MainWindow_auto_answer_text", "i").color } } @@ -44,7 +45,7 @@ QtObject { property int spacing: 16 property var background: Rectangle { - color: Colors.f.color + color: ColorsList.add("MainWindow_toolbar_background", "f").color } } } diff --git a/linphone-app/ui/views/App/Styles/Settings/SettingsAdvancedStyle.qml b/linphone-app/ui/views/App/Styles/Settings/SettingsAdvancedStyle.qml index eb6ebf6c8..248c7d17f 100644 --- a/linphone-app/ui/views/App/Styles/Settings/SettingsAdvancedStyle.qml +++ b/linphone-app/ui/views/App/Styles/Settings/SettingsAdvancedStyle.qml @@ -2,6 +2,7 @@ pragma Singleton import QtQml 2.2 import Units 1.0 +import ColorsList 1.0 // ============================================================================= QtObject { @@ -10,10 +11,10 @@ QtObject { } property QtObject error: QtObject { - property color color: Colors.error.color + property color color: ColorsList.add("SettingsAdvanced_error", "error").color } property QtObject info: QtObject { - property color color: Colors.j.color + property color color: ColorsList.add("SettingsAdvanced_info", "j").color property int pointSize: Units.dp * 11 } property QtObject lists: QtObject { diff --git a/linphone-app/ui/views/App/Styles/Settings/SettingsWindowStyle.qml b/linphone-app/ui/views/App/Styles/Settings/SettingsWindowStyle.qml index 4ebd32e88..0a3d113ac 100644 --- a/linphone-app/ui/views/App/Styles/Settings/SettingsWindowStyle.qml +++ b/linphone-app/ui/views/App/Styles/Settings/SettingsWindowStyle.qml @@ -1,11 +1,12 @@ pragma Singleton import QtQml 2.2 +import ColorsList 1.0 // ============================================================================= QtObject { - property color color: Colors.k.color + property color color: ColorsList.add("Settings_background", "k").color property int height: 640 property int width: 1024