/* * Copyright (c) 2019-2020, Jesse Buhagiar * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include "MonitorWidget.h" #include #include #include #include #include #include #include namespace DisplaySettings { class MonitorSettingsWidget final : public GUI::SettingsWindow::Tab { C_OBJECT(MonitorSettingsWidget); public: ~MonitorSettingsWidget() override { if (m_showing_screen_numbers) show_screen_numbers(false); } virtual void apply_settings() override; void show_screen_numbers(bool); protected: void show_event(GUI::ShowEvent& event) override; void hide_event(GUI::HideEvent& event) override; private: MonitorSettingsWidget(); void create_frame(); void create_resolution_list(); void load_current_settings(); void selected_screen_index_or_resolution_changed(); size_t m_selected_screen_index { 0 }; WindowServer::ScreenLayout m_screen_layout; Vector m_screens; Vector> m_screen_edids; Vector m_resolutions; Vector m_resolution_strings; RefPtr m_monitor_widget; RefPtr m_screen_combo; RefPtr m_resolution_combo; RefPtr m_display_scale_radio_1x; RefPtr m_display_scale_radio_2x; RefPtr m_dpi_label; bool m_showing_screen_numbers { false }; }; }