PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

make the edge of always on top look better when the edge is thin (Windows11)

Open unuing opened this issue 3 years ago • 13 comments

Description of the new feature / enhancement

currently when it is thin, it does not look pretty (the radius of the corner of the edge is too small): image

Scenario when this would be used?

anytime using always on top

unuing avatar Jul 17 '22 03:07 unuing

and when the thickness is set to 1px to 3px, there is an area between the corner of the window and the corner of the edge image

unuing avatar Jul 17 '22 11:07 unuing

I think the corner of the edge of AoT and the corner of the edge of the window should use the same center of circle (pardon my bad english)

unuing avatar Jul 17 '22 14:07 unuing

Something configuration wise is off. What build of PowerToys are you on? For me this looks correct in 0.60.1 and i'm on Windows Insider build 25145. Wondering if some type of scaling or something.

Here is the corner of Edge. You should see white bleed through like yours but it hugs correctly. image

/needinfo /reportbug

crutkas avatar Jul 19 '22 20:07 crutkas

Hi there!

We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks!
Report Bug

msftbot[bot] avatar Jul 19 '22 20:07 msftbot[bot]

The other oddity is the X for closing has jaggied near the top, something is weird. The first screenshot i can't see anything that seems off, the second shot i can but like i said, i can't repro this.

crutkas avatar Jul 19 '22 20:07 crutkas

I'm on powertoys 0.60.1 and on windows11 stable build 22000 PowerToysReport_2022-07-20-09-35-04.zip

unuing avatar Jul 20 '22 01:07 unuing

The first screenshot i can't see anything that seems off,

I just meant that it doesn’t look pretty.

unuing avatar Jul 20 '22 06:07 unuing

The other oddity is the X for closing has jaggied near the top, something is weird.

It is just because of the screenshot tool, I cannot see that on my screen, but in the screenshot, so there's no need to care about it

unuing avatar Jul 20 '22 13:07 unuing

and when the thickness is set to 1px to 3px, there is an area between the corner of the window and the corner of the edge image

I'm getting this too, happy to provide my bug report zip if needed. Bit harder to see on mine due to the colours but definitely there. image

HeyItsJono avatar Jul 21 '22 05:07 HeyItsJono

@SeraphimaZykova the display scaling (aka dpi) isn't correctly calculated for the actual radius. Notice this on my SP4 when changing from (default) 200% to 100% (with 1px thickness)

  • Aside from the radius, we should also bump the minimum thickness from 0 to 1. A few tickmarks on the slider would be nice too.

  • ~Though a nit, when I (slowly) increase the thickness I see the border expanding both away from the window and below the window, with the middle staying on the window edge. I see this is intentional, but why? For me personally, I would expect thickness to move outward only.~

Jay-o-Way avatar Jul 22 '22 09:07 Jay-o-Way

Aside from the radius, we should also bump the minimum thickness from 0 to 1. A few tickmarks on the slider would be nice too.

I think we should have a choise to set it to zero.

unuing avatar Jul 22 '22 12:07 unuing

Using zero == switching the border to off

Jay-o-Way avatar Jul 22 '22 12:07 Jay-o-Way

I didn't realize that.

unuing avatar Jul 22 '22 12:07 unuing

@SeraphimaZykova I realise it's low prio, but think this is an easy fix? [dpi-aware radius; min-thinkness; centralized/outward]

I see why "The border stroke is centered on the line" and drawn double-width, but (if we use the correct values for the radius) we can remove this and draw the line fully outside of the window edges.

Suggestion to re-write as:

border-corner-radius = thickness / 2 + window-radius // (usually 8px, but do check with window)
// to draw middle of border:
  border.left = window.left - thickness / 2
  border.top = window.top - thickness / 2
  border.right = window.right + thickness / 2
  border.bottom = window.bottom + thickness / 2
// alternative (un-used)
  border.width = window.width + thickness
  border.height = window.height + thickness

image

Question:

D2D1_ROUNDED_RECT structure Even when both radiuX and radiusY are zero, the rounded rectangle is different from a rectangle., When stroked, the corners of the rounded rectangle are roundly joined, not mitered (square).

(link)

My opinion is we can use only this function (and scratch the sharp corners) because then it'll look more like the window-shadow does. I think it's much prettier :)

Jay-o-Way avatar Aug 24 '22 10:08 Jay-o-Way

@SeraphimaZykova I love the way it is now! 😄

Jay-o-Way avatar Oct 05 '22 21:10 Jay-o-Way