mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +02:00
[AlwaysOnTop] Round corners on Windows 11 (#19109)
* check window corners * draw rounded rectangle * draw rounded corners * switch between rounded and not rounded rects * added enabled corners setting * update corner
This commit is contained in:
@@ -18,14 +18,15 @@ public:
|
||||
|
||||
void Show();
|
||||
void Hide();
|
||||
void SetBorderRect(RECT windowRect, COLORREF color, int thickness);
|
||||
void SetBorderRect(RECT windowRect, COLORREF color, int thickness, int radius);
|
||||
|
||||
private:
|
||||
bool CreateRenderTargets(const RECT& clientRect);
|
||||
|
||||
struct DrawableRect
|
||||
{
|
||||
D2D1_RECT_F rect;
|
||||
std::optional<D2D1_RECT_F> rect;
|
||||
std::optional<D2D1_ROUNDED_RECT> roundedRect;
|
||||
D2D1_COLOR_F borderColor;
|
||||
int thickness;
|
||||
};
|
||||
@@ -33,7 +34,8 @@ private:
|
||||
static ID2D1Factory* GetD2DFactory();
|
||||
static IDWriteFactory* GetWriteFactory();
|
||||
static D2D1_COLOR_F ConvertColor(COLORREF color);
|
||||
static D2D1_RECT_F ConvertRect(RECT rect);
|
||||
static D2D1_ROUNDED_RECT ConvertRect(RECT rect, int thickness, int radius);
|
||||
static D2D1_RECT_F ConvertRect(RECT rect, int thickness);
|
||||
void Render();
|
||||
|
||||
HWND m_window = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user