OrcaSlicer icon indicating copy to clipboard operation
OrcaSlicer copied to clipboard

Best effort for pixel perfect icon rendering

Open Noisyfox opened this issue 1 year ago • 13 comments

This currently requires the toolbar icon to have even size.

Fixes #4328

Before: icon_before

After: icon_after

Toolbar icons should be noticeably sharper.

Noisyfox avatar Mar 18 '24 15:03 Noisyfox

thanks for your efforts on this, i will report results This problem also appears on popup windows of toolbar. especially on these places

  • Emboss > alignment icons
  • Emboss > buttons near Style dropdown menu
  • Other > Keyboard cheat sheet button i guess emboss popup aligns to right of window and bottom of window. icons looks blurry vertically and horizontally

yw4z avatar Mar 18 '24 15:03 yw4z

thanks for your efforts on this, i will report results This problem also appears on popup windows of toolbar. especially on these places

  • Emboss > alignment icons
  • Emboss > buttons near Style dropdown menu
  • Other > Keyboard cheat sheet button i guess emboss popup aligns to right of window and bottom of window. icons looks blurry vertically and horizontally

Not sure if I could do anything about these.

Noisyfox avatar Mar 19 '24 00:03 Noisyfox

@yw4z Also I've noticed your comment about icon size using odd numbers https://github.com/SoftFever/OrcaSlicer/pull/4368#issuecomment-1986544994

Technically you're right but some of the existing code make the assumption that icon sizes are in even numbers and I'm not sure how well it might behave.

If you are planing to use icons with odd numbers, could you try using the binary of this PR and replace with your icons and see if they work well?

Noisyfox avatar Mar 19 '24 02:03 Noisyfox

No i didnt changed their resolution to reduce code changes Screenshot-20240319054512 mostly they have blank 1px line 2 sides I'm adding all required changes in that commit as a to-do list. still changing things but big part of work is done

yw4z avatar Mar 19 '24 02:03 yw4z

@Noisyfox changing this line to int fixed issue for toolbar popup icons. they are pixel perfect now :)

https://github.com/SoftFever/OrcaSlicer/blob/f3b3e927824339bd76346bbb40b417de51aba31c/src/slic3r/GUI/IconManager.cpp#L376

included this to my UI commit

yw4z avatar Mar 23 '24 00:03 yw4z

@Noisyfox changing this line to int fixed issue for toolbar popup icons. they are pixel perfect now :)

https://github.com/SoftFever/OrcaSlicer/blob/f3b3e927824339bd76346bbb40b417de51aba31c/src/slic3r/GUI/IconManager.cpp#L376

included this to my UI commit

Popups? Did you mean those gizmo panels?

Noisyfox avatar Mar 23 '24 01:03 Noisyfox

yes also fixed blur on keyboard cheat sheet button

yw4z avatar Mar 23 '24 01:03 yw4z

@SoftFever Since #4368 has been implemented, this PR should too. 😊 Otherwise the icons look somewhat blurry under Linux (Manjaro GNOME).

discip avatar May 03 '24 08:05 discip

@Noisyfox @SoftFever here is my observations with code changes. i compiled with this changes

trying to make icons pixel perfect is unnecessary with scaling imo. i guess only necessary change is this line because icons already not supports lower resolutions 7673 const int offset = (cnv_width - toolbar_total_width) / 2;

other solutions for preventing scaling on icons

• Removing separators. this will reduce total with -40 px of toolbar commented lines these lines to remove separators

    //if (!_init_separator_toolbar())
    //    return false;

Here is comparison with / without separators Screenshot-20240504150458

• Reducing size of left spacing between sidebar toggle and toolbar

• Moving sidebar toggle to top bar. i guess this change will make a huge difference but requires more code changes

• Moving sidebar toggle to vertically center and exclude from toolbar calculations. Removing sidebar toggle from toolbar calculations saves additional 50px before triggering scaling. i added 2 lines for excluding and preventing rendering toggle button Screenshot-20240504153139

after removing sidebar toggle, separators & left and right spacers. total width reduced by 110px. so scaling not starts before that Screenshot-20240504165429

Preview of sidebar toggle with vertically centered (not included to code changes) Screenshot-20240504165903

i didnt commited because tried completely different route. respect for your efforts some changes can be made with less code i tried to go with experimental way on my branch https://github.com/yw4z/OrcaSlicer/tree/toolbar-width-fix

yw4z avatar May 04 '24 12:05 yw4z

Moving sidebar toggle to vertically center and exclude from toolbar calculations.

This does look better. One sidenote: make sure this won't overlap with the plate list on the preview view.

Noisyfox avatar May 06 '24 08:05 Noisyfox

@yw4z @Noisyfox

What about moving the arrow to the top, but without protruding into the workspace? Something like this: image Maybe the design could be adjusted according to the theme.

discip avatar May 06 '24 09:05 discip

@yw4z @Noisyfox

What about moving the arrow to the top, but without protruding into the workspace? Something like this: image Maybe the design could be adjusted according to the theme.

That's not supported yet.

Noisyfox avatar May 06 '24 12:05 Noisyfox

That's not supported yet.

That's a pity.

discip avatar May 06 '24 21:05 discip