Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: update hardcoded XPMs to .svg files. Updated .svg icons for clarity. #13110

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

maxwxyz
Copy link
Collaborator

@maxwxyz maxwxyz commented Mar 23, 2024

See files for overview.
fix partially #6765
fix partially #12992

@github-actions github-actions bot added Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB Part Design Related to the Part Design Workbench WB Part Related to the Part Workbench WB Sketcher Related to the Sketcher Workbench WB Mesh Related to the Mesh Workbench labels Mar 23, 2024
@maxwxyz maxwxyz marked this pull request as ready for review March 25, 2024 17:23
".######.",
"..####.."};
static QPixmap forbidden_icon(forbidden_xpm);
static QPixmap forbidden_icon(Gui::BitmapFactory().pixmapFromSvg("forbidden", QSize(8, 8)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you can use a size of 24x24 or 32x32 as otherwise the overlay icon will be too small.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the icon will be displayed too large then. When I scale it down after a higher resolution with .scaled
Do I need to call the get dpr every time then, if #13176 is in?

Copy link
Contributor

@wwmayer wwmayer Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using 8x8 then the overlay icon is extremely tiny. With 24x24 or 32x32 the size is sensible for me. Not sure why because in the past 8x8 was OK.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how it looks with 8x8 (XPM and SVG):
forbidden_8x8
and this with 24x24:
forbidden_24x24

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows it looks like the bottom one with the 10x10 or 8x8

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can at least use it in DocumentObjectItem::testStatus() where you can access the tree widget.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but overlay icons are set from almost all WBs. Could this be integrated in pixmapFromSvg() instead? If no DPR is given, calculate it there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, as this only makes no sense. On systems with several monitors it's possible that widgets have different DPR and pixmapFromSvg() doesn't know anything about the context a pixmap is used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is it working with toolbar icons? On my second monitor DPI they also look good. dragging them from one to another monitor updates them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I guess Qt does it automatically.

@wwmayer wwmayer merged commit 6ca8b2d into FreeCAD:main Mar 30, 2024
6 of 9 checks passed
@maxwxyz maxwxyz deleted the tree-overlay-icons branch March 30, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Issue or PR touches core sections (App, Gui, Base) of FreeCAD WB Mesh Related to the Mesh Workbench WB Part Design Related to the Part Design Workbench WB Part Related to the Part Workbench WB Sketcher Related to the Sketcher Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants