summaryrefslogtreecommitdiff
path: root/Applications/DisplayProperties/DisplayProperties.h
blob: c8c96988f1fe961d405528ced33fdca992110fda (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
#pragma once

#include <AK/RefPtr.h>
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibCore/CConfigFile.h>
#include <LibDraw/Color.h>
#include <LibDraw/Size.h>
#include <LibGUI/GWidget.h>

class DisplayPropertiesWidget final {
public:
    enum class ButtonOperations {
        Ok,
        Apply,
        Cancel,
    };

    enum TabIndices {
        Wallpaper,
        Settings
    };

public:
    DisplayPropertiesWidget();

    // Apply the settings to the Window Server
    void send_settings_to_window_server(int tabIndex);
    void create_frame();

    inline GWidget* get_root_widget() const { return m_root_widget; }

private:
    void create_wallpaper_list();
    void create_resolution_list();
    void create_root_widget();

private:
    String m_wallpaper_path;
    RefPtr<CConfigFile> m_wm_config;
    GWidget* m_root_widget { nullptr };
    Vector<Size> m_resolutions;
    Vector<String> m_wallpapers;

    Size m_selected_resolution;
    String m_selected_wallpaper;
};