mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
[ScreenRuler]Add setting to show the measurement in an extra unit (#35887)
* display ruler: supporting millimeter and other units * Measurement Tool: UI Setting for an extra unit * Update images * spelling * spelling * suit code style * Fix for code review * remove weird file * rename field
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#pragma comment(lib, "Gdi32.lib")
|
||||
#include <Windows.h>
|
||||
|
||||
#include <compare>
|
||||
@@ -42,6 +43,15 @@ struct Box
|
||||
|
||||
class MonitorInfo
|
||||
{
|
||||
public:
|
||||
typedef struct Size
|
||||
{
|
||||
uint32_t width_logical, height_logical;
|
||||
uint32_t width_physical, height_physical;
|
||||
float width_mm, height_mm;
|
||||
} Size;
|
||||
|
||||
private:
|
||||
HMONITOR handle;
|
||||
MONITORINFOEX info = {};
|
||||
|
||||
@@ -53,8 +63,14 @@ public:
|
||||
}
|
||||
Box GetScreenSize(const bool includeNonWorkingArea) const;
|
||||
bool IsPrimary() const;
|
||||
Size GetSize() const;
|
||||
|
||||
// Returns monitor rects ordered from left to right
|
||||
static std::vector<MonitorInfo> GetMonitors(bool includeNonWorkingArea);
|
||||
static MonitorInfo GetPrimaryMonitor();
|
||||
static MonitorInfo GetFromWindow(HWND);
|
||||
static MonitorInfo GetFromPoint(int32_t, int32_t);
|
||||
|
||||
private:
|
||||
static Size GetSize(const MONITORINFOEX&);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user