mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
1b7e2eb970
This enables changing monitor settings for each monitor individually. In the event that changing a resolution causes screens to overlap we now try to disperse the screens, although the algorithm currently implemented may result in some rather unexpected layouts in certain cases. We can still improve this logic, and eventually we're going to have a widget where the screens can be arranged as desired.
55 lines
1.3 KiB
C++
55 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) 2019-2020, Jesse Buhagiar <jooster669@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "MonitorWidget.h"
|
|
#include <LibCore/Timer.h>
|
|
#include <LibGUI/ColorInput.h>
|
|
#include <LibGUI/ComboBox.h>
|
|
#include <LibGUI/RadioButton.h>
|
|
#include <WindowServer/ScreenLayout.h>
|
|
|
|
namespace DisplaySettings {
|
|
|
|
class MonitorSettingsWidget : public GUI::Widget {
|
|
C_OBJECT(MonitorSettingsWidget);
|
|
|
|
public:
|
|
~MonitorSettingsWidget() override
|
|
{
|
|
if (m_showing_screen_numbers)
|
|
show_screen_numbers(false);
|
|
}
|
|
|
|
void apply_settings();
|
|
void show_screen_numbers(bool);
|
|
|
|
private:
|
|
MonitorSettingsWidget();
|
|
|
|
void create_frame();
|
|
void create_resolution_list();
|
|
void load_current_settings();
|
|
void selected_screen_index_changed();
|
|
|
|
size_t m_selected_screen_index { 0 };
|
|
|
|
WindowServer::ScreenLayout m_screen_layout;
|
|
Vector<String> m_screens;
|
|
Vector<Gfx::IntSize> m_resolutions;
|
|
|
|
RefPtr<DisplaySettings::MonitorWidget> m_monitor_widget;
|
|
RefPtr<GUI::ComboBox> m_screen_combo;
|
|
RefPtr<GUI::ComboBox> m_resolution_combo;
|
|
RefPtr<GUI::RadioButton> m_display_scale_radio_1x;
|
|
RefPtr<GUI::RadioButton> m_display_scale_radio_2x;
|
|
|
|
bool m_showing_screen_numbers { false };
|
|
};
|
|
|
|
}
|