1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 08:07:41 +00:00
serenity/Userland/Applications/DisplaySettings/DisplaySettingsWindow.gml
Nico Weber f37f281f89 DisplaySettings: Add UI for switching the scale factor
For now, only support 1x and 2x scale.

I tried doing something "smarter" first where the UI would try
to keep the physical resolution constant when toggling between
1x and 2x, but many of the smaller 1x resolutions map to 2x
logical resolutions that Compositor rejects (e.g. 1024x768 becomes
512x384, which is less than the minimum 640x480 that Compositor
wants) and it felt complicated and overly magical.

So this instead just gives you a 1x/2x toggle and a dropdown
with logical (!) resolutions. That is, 800x600 @ 2x gives you
a physical resolution of 1600x1200.

If we don't like this after trying it for a while, we can change
the UI then.
2021-01-17 08:06:12 +01:00

137 lines
2.6 KiB
Text

@GUI::Widget {
fill_with_background_color: true
layout: @GUI::VerticalBoxLayout {
margins: [4, 4, 4, 4]
}
@DisplaySettings::MonitorWidget {
name: "monitor_widget"
fixed_width: 338
fixed_height: 248
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Label {
text: "Wallpaper:"
text_alignment: "CenterLeft"
fixed_width: 70
}
@GUI::ComboBox {
name: "wallpaper_combo"
}
@GUI::Button {
name: "wallpaper_open_button"
tooltip: "Select wallpaper from file system."
button_style: "CoolBar"
fixed_width: 22
fixed_height: 22
}
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Label {
text: "Modes:"
text_alignment: "CenterLeft"
fixed_width: 70
}
@GUI::ComboBox {
name: "mode_combo"
}
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Label {
text: "Resolution:"
text_alignment: "CenterLeft"
fixed_width: 70
}
@GUI::ComboBox {
name: "resolution_combo"
fixed_width: 90
}
@GUI::Widget {
}
@GUI::Label {
text: "Display scale:"
text_alignment: "CenterLeft"
fixed_width: 75
}
@GUI::RadioButton {
name: "scale_1x"
text: "100%"
}
@GUI::RadioButton {
name: "scale_2x"
text: "200%"
}
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Label {
text: "Color:"
text_alignment: "CenterLeft"
fixed_width: 70
}
@GUI::ColorInput {
name: "color_input"
fixed_width: 90
}
}
@GUI::Widget {
}
@GUI::Widget {
shrink_to_fit: true
layout: @GUI::HorizontalBoxLayout {
}
@GUI::Widget {
}
@GUI::Button {
name: "ok_button"
text: "OK"
fixed_width: 60
}
@GUI::Button {
name: "cancel_button"
text: "Cancel"
fixed_width: 60
}
@GUI::Button {
name: "apply_button"
text: "Apply"
fixed_width: 60
}
}
}