~aleteoryx/muditaos

ref: 2305f2bf669e2c1c89893bf8537c3ba46878bc83 muditaos/module-apps/application-settings/windows/advanced/AdvancedOptionsWindow.cpp -rw-r--r-- 1.3 KiB
2305f2bf — Tigran Soghbatyan [BH-1267] Fix state controller 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "AdvancedOptionsWindow.hpp"

#include <application-settings/windows/WindowNames.hpp>
#include <status-bar/Style.hpp>

std::list<gui::Option> advancedOptions(app::ApplicationCommon *app)
{
    std::list<gui::Option> l;

    auto addMenu = [&l, &app](UTF8 name, const std::string &window = "") {
        l.emplace_back(gui::Option{name,
                                   [=](gui::Item &item) {
                                       if (window.empty()) {
                                           return false;
                                       }
                                       LOG_INFO("switching to %s page", window.c_str());
                                       app->switchWindow(window, nullptr);
                                       return true;
                                   },
                                   gui::option::Arrow::Enabled});
    };

    addMenu("Information", gui::window::name::information);
    addMenu("UI Test", gui::window::name::ui_test);
    addMenu("Color Test", gui::window::name::color_test_window);
    addMenu("Statusbar Image Test", gui::window::name::status_bar_img_type);

    return l;
}