Allow changing resolution

This commit is contained in:
Kamil Trzciński 2022-11-18 15:20:35 +01:00
parent 15369826f9
commit a3bb9e19ff
3 changed files with 128 additions and 2 deletions

View file

@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Navigation;
using static PowerControl.Helpers.PhysicalMonitorBrightnessController;
namespace PowerControl
{
@ -50,6 +51,29 @@ namespace PowerControl
}
},
new Menu.MenuItemWithOptions()
{
Name = "Resolution",
ApplyDelay = 1000,
OptionsValues = delegate()
{
var resolutions = Helpers.PhysicalMonitorBrightnessController.GetAllResolutions();
if (resolutions.Count() > 1)
return resolutions.Select(item => (object)item).ToArray();
return null;
},
CurrentValue = delegate()
{
return Helpers.PhysicalMonitorBrightnessController.GetResolution();
},
ApplyValue = delegate(object selected)
{
Helpers.PhysicalMonitorBrightnessController.SetResolution((DisplayResolution)selected);
Root["Refresh Rate"].Update(); // force refresh Refresh Rate
Root["FPS Limit"].Update(); // force refresh FPS limit
return Helpers.PhysicalMonitorBrightnessController.GetResolution();
}
},
new Menu.MenuItemWithOptions()
{
Name = "Refresh Rate",
ApplyDelay = 1000,