aboutsummaryrefslogtreecommitdiff
path: root/include/Theme.hpp
blob: 185bcdc26c5d43263fdb6d41059da9232ab1c99a (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once

#include <mglpp/system/MemoryMappedFile.hpp>
#include <mglpp/graphics/Color.hpp>
#include <mglpp/graphics/Font.hpp>
#include <mglpp/graphics/Texture.hpp>

#include <string>

namespace gsr {
    struct Config;
    struct GsrInfo;

    struct Theme {
        Theme() = default;
        Theme(const Theme&) = delete;
        Theme& operator=(const Theme&) = delete;

        float window_width = 0.0f;
        float window_height = 0.0f;

        mgl::MemoryMappedFile body_font_file;
        mgl::MemoryMappedFile title_font_file;
        mgl::Font body_font;
        mgl::Font title_font;
        mgl::Font top_bar_font;

        mgl::Texture combobox_arrow_texture;
        mgl::Texture settings_texture;
        mgl::Texture settings_small_texture;
        mgl::Texture folder_texture;
        mgl::Texture up_arrow_texture;
        mgl::Texture replay_button_texture;
        mgl::Texture record_button_texture;
        mgl::Texture stream_button_texture;
        mgl::Texture close_texture;
        mgl::Texture logo_texture;
        mgl::Texture checkbox_circle_texture;
        mgl::Texture checkbox_background_texture;
        mgl::Texture play_texture;
        mgl::Texture stop_texture;
        mgl::Texture pause_texture;
        mgl::Texture save_texture;

        double double_click_timeout_seconds = 0.4;

        // Reloads fonts
        bool set_window_size(mgl::vec2i window_size);
    };

    bool init_theme(const std::string &resources_path);
    void deinit_theme();
    Theme& get_theme();

    struct ColorTheme {
        mgl::Color tint_color = mgl::Color(118, 185, 0);
        mgl::Color page_bg_color = mgl::Color(38, 43, 47);
        mgl::Color text_color = mgl::Color(255, 255, 255);
    };

    bool init_color_theme(const Config &config, const GsrInfo &gsr_info);
    void deinit_color_theme();
    ColorTheme& get_color_theme();
}