FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

[Gui] Axis colors changeable

Open benj5378 opened this issue 1 year ago • 12 comments

Partiarlly fixes #12208

Make axis colors user definable

benj5378 avatar Oct 03 '24 22:10 benj5378

@benj5378 @PaddleStroke maybe this can already be considered in / for https://github.com/FreeCAD/FreeCAD/pull/16675

maxwxyz avatar Oct 04 '24 04:10 maxwxyz

https://github.com/FreeCAD/FreeCAD/pull/16675 is already a huge PR so perhaps it's best not to overload it. But yes ultimately the new core LCS will need to be customizable same as the others.

PaddleStroke avatar Oct 04 '24 07:10 PaddleStroke

maybe it can be done in this PR here after yours is merged.

maxwxyz avatar Oct 04 '24 07:10 maxwxyz

Yes or the other way around. If this merge first, then @benj5378 can advise me how to set the colors correctly in my pr.

PaddleStroke avatar Oct 04 '24 07:10 PaddleStroke

#16675 is already a huge PR so perhaps it's best not to overload it. But yes ultimately the new core LCS will need to be customizable same as the others.

Using this colors is literally calling Gui::ViewParams::instance()->getAxisXColor() to obtain the color. It won't affect your PR much, this method is already available and the PR should use it before it gets merged. No reason to postopone changes like this for later as the later can never come and we would end up with yet another inconsistency.

@benj5378 as this change affects settings UI can you add screenshot of before and after?

kadet1090 avatar Oct 05 '24 08:10 kadet1090

Ah ok then, I'll check it

On Sat, Oct 5, 2024, 10:46 Kacper Donat @.***> wrote:

#16675 https://github.com/FreeCAD/FreeCAD/pull/16675 is already a huge PR so perhaps it's best not to overload it. But yes ultimately the new core LCS will need to be customizable same as the others.

Using this colors is literally calling Gui::ViewParams::instance()->getAxisXColor() to obtain the color. It won't affect your PR much, this method is already available and the PR should use it before it gets merged. No reason to postopone changes like this for later as the later can never come and we would end up with yet another inconsistency.

— Reply to this email directly, view it on GitHub https://github.com/FreeCAD/FreeCAD/pull/16995#issuecomment-2394984272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEYO6MJYUI5CEWTT5GBUKBTZZ6RNTAVCNFSM6AAAAABPKWVWL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJUHE4DIMRXGI . You are receiving this because you were mentioned.Message ID: @.***>

PaddleStroke avatar Oct 05 '24 12:10 PaddleStroke

Using this colors is literally calling Gui::ViewParams::instance()->getAxisXColor() to obtain the color.

So my PR was already using this actually. So it's already compliant then

PaddleStroke avatar Oct 07 '24 07:10 PaddleStroke

@benj5378 it looks like @adrianinsaval has some unresolved comments above.

chennes avatar Nov 18 '24 17:11 chennes

^ @benj5378 ping and also some conflicts here.

maxwxyz avatar Nov 23 '24 08:11 maxwxyz

@benj5378 ping

maxwxyz avatar Nov 30 '24 20:11 maxwxyz

waiting for feedback

maxwxyz avatar Dec 06 '24 06:12 maxwxyz

bump

maxwxyz avatar Dec 08 '24 19:12 maxwxyz

@benj5378 friendly reminder

maxwxyz avatar Dec 26 '24 12:12 maxwxyz

All comments resolved, @maxwxyz

benj5378 avatar Jan 20 '25 02:01 benj5378

@benj5378 thanks, could you take a look on all the CI fails?

maxwxyz avatar Jan 20 '25 07:01 maxwxyz

@benj5378 which axes colors does this affect?Transform dragger, origin datums, axis cross, the lines on the navi cube and the little one in the corner? grafik

maxwxyz avatar Jan 24 '25 08:01 maxwxyz

@benj5378 which axes colors does this affect?

That's uncertain, and depends on the implementation of getAxisXColor() across the codebase. @maxwxyz

This PR adds UI for setting the axis colors property (returned by getAxisXColor()). It further implements the axis shown beneath to use getAxisXColor().

If there are axis not responding to the preference change, it's because the axis colors have been hardcoded. Depending on implementation in the specific code locations, FreeCAD might need restart for changed axis colors to take effect. @PaddleStroke added functionality, such that datum planes are also using getAxisXColor() and thus affected by this PR.

image image image

benj5378 avatar Jan 24 '25 14:01 benj5378

@kadet1090, good points that I agree with. Let that be another PR.

I guess we are ready for merge then.

benj5378 avatar Feb 03 '25 12:02 benj5378

@chennes I have to say there seems to be some double standards going on recently, I was specifically told that new code wasn't to have C strcmp and that's exactly what has been merged here, if there's rules, fine but they need to be applied to everyone IMHO.

Syres916 avatar Feb 05 '25 15:02 Syres916

@Syres916 much as I hate strcmp and really, really hate to see it in new code, in this particular case the new code is part of a chain of if statements that all use that structure. So rather than forcing this PR to do a big refactoring, we decided to let the strcmp in to maintain consistency in a very local code block. I'd still very much welcome a refactoring-only PR that eliminates the old-school C style calls.

chennes avatar Feb 05 '25 19:02 chennes