1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:17:35 +00:00

Applications: Create a display properties manager

An interactive application to modify the current display settings, such as
the current wallpaper as well as the screen resolution. Currently we're
adding the resolutions ourselves, because there's currently no way to
detect was resolutions the current display adapter supports (or at least
I can't see one... Maybe VBE does and I'm stupid). It even comes with
a very nice template'd `ItemList` that can support a vector of any type,
which makes life much simpler.
This commit is contained in:
Jesse Buhagiar 2019-09-03 21:45:02 +10:00 committed by Andreas Kling
parent af14b8dc59
commit ecbc0322c1
15 changed files with 329 additions and 1 deletions

View file

@ -0,0 +1,47 @@
#pragma once
#include <AK/AKString.h>
#include <AK/RefPtr.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;
};