[Solved] Making a sticker with DraftWB

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
Roy_043
Posts: 1545
Joined: Thu Dec 27, 2018 12:28 pm

Re: [Solved] Making a sticker with DraftWB

Postby Roy_043 » Sun Aug 02, 2020 11:04 am

First of all: there is no Std_SetColors command defined in the source code. So that name and the 'Std' prefix are incorrect.

If you search for 'Set colors...' you will find that this context menu item is defined in these files:
FreeCAD-master\src\Mod\Part\Gui\ViewProviderExt.cpp
FreeCAD-master\src\Mod\PartDesign\Gui\ViewProvider.cpp

FreeCAD-master\src\Mod\Part\Gui\ViewProviderExt.cpp:

Code: Select all

void ViewProviderPartExt::setupContextMenu(QMenu* menu, QObject* receiver, const char* member)
{
    Gui::ViewProviderGeometryObject::setupContextMenu(menu, receiver, member);
    QAction* act = menu->addAction(QObject::tr("Set colors..."), receiver, member);
    act->setData(QVariant((int)ViewProvider::Color));
}
Probably the item defined in the Part WB is inherited by the other workbenches that show it in their context menu.

Note that this context item is available if the Draft WB is active and you preselect a Draft object, but cannot in fact be used for such objects.
chrisb
Posts: 25699
Joined: Tue Mar 17, 2015 9:14 am

Re: [Solved] Making a sticker with DraftWB

Postby chrisb » Sun Aug 02, 2020 11:53 am

Roy_043 wrote:
Sun Aug 02, 2020 11:04 am
First of all: there is no Std_SetColors command defined in the source code. So that name and the 'Std' prefix are incorrect.
From a user's perspective this is of course not what counts, but I think the "What's this" hints are directly related to the names used in the code.
catman
Posts: 230
Joined: Fri Jan 11, 2019 10:42 pm

Re: [Solved] Making a sticker with DraftWB

Postby catman » Sun Aug 02, 2020 12:07 pm

chrisb wrote:
Sun Aug 02, 2020 2:55 am
..you have the feeling it should be documented there in PartDesign. I don't say it's wrong, but that holds for the other workbenches as well. And for other commands as well. You can set colors from PartDesign, Part, Draft, Arch, Curves, ... workbenches.

I think it is sufficient to have the page linked above and leave it to the search function.
Well, I agree that it should be on its own page, just as it has it already - maybe with a better name and updated, also formally.
But I think it should have links were it could be found. As it seems that it appears only in context menus, my suggestion is to put a link to all WBs where it appears and link to the main page. So my new section would be reduced down to the link itself (the text moves to the item's page). And there should be similar links in the Context Function page of the other relevant WP's. I hope that is what you meant as well?

chrisb wrote:
Sun Aug 02, 2020 2:55 am
Currently it is the third entry if you search the docs for "Color". That's not bad.
Please forgive me, but I am not really fond of the search function. Whatever I search for, I mostly get pages full of the same hit with all possible translation. That makes it quite hard touse (I personally would even say unusable, compared to other wikis I work with).
But its great to know that it shows up when your search for "color"
User avatar
Roy_043
Posts: 1545
Joined: Thu Dec 27, 2018 12:28 pm

Re: [Solved] Making a sticker with DraftWB

Postby Roy_043 » Sun Aug 02, 2020 1:49 pm

chrisb wrote:
Sun Aug 02, 2020 11:53 am
this is of course not what counts
I disagree. Giving this feature a clear command name, indicative of the WB it belongs to, would help the average user as well as those trying to write the documentation.
chrisb
Posts: 25699
Joined: Tue Mar 17, 2015 9:14 am

Re: [Solved] Making a sticker with DraftWB

Postby chrisb » Sun Aug 02, 2020 3:58 pm

Roy_043 wrote:
Sun Aug 02, 2020 1:49 pm
Giving this feature a clear command name, indicative of the WB it belongs to, would help the average user as well as those trying to write the documentation.
I agree on that, but it doesn't mean that it has to occur in the same way in the source code - of which users as well as documentation writers may be unaware.
chrisb
Posts: 25699
Joined: Tue Mar 17, 2015 9:14 am

Re: [Solved] Making a sticker with DraftWB

Postby chrisb » Sun Aug 02, 2020 5:47 pm

User avatar
uwestoehr
Posts: 1634
Joined: Sun Jan 27, 2019 3:21 am

Re: [Solved] Making a sticker with DraftWB

Postby uwestoehr » Sun Aug 02, 2020 6:39 pm

I already fixed the Wiki page Std_SetColors and made a request to rename it to "Part_FaceColors".

I also fixed some issues with the feature's dialog: https://github.com/FreeCAD/FreeCAD/pull/3770
User avatar
Roy_043
Posts: 1545
Joined: Thu Dec 27, 2018 12:28 pm

Re: [Solved] Making a sticker with DraftWB

Postby Roy_043 » Sun Aug 02, 2020 7:37 pm

uwestoehr wrote:
Sun Aug 02, 2020 6:39 pm
I already fixed
We are going too far off topic here. I'll start a new topic in the the wiki section. We need to talk about the layout.
catman
Posts: 230
Joined: Fri Jan 11, 2019 10:42 pm

Re: [Solved] Making a sticker with DraftWB

Postby catman » Mon Aug 03, 2020 8:20 am

uwestoehr wrote:
Sun Aug 02, 2020 6:39 pm
I also fixed some issues with the feature's dialog: https://github.com/FreeCAD/FreeCAD/pull/3770
I am not sure how easy that would be, but the dialog imho has one other drawback: if you want to define several colors on the same part you have to close the dialog and open it again via the context menu.

An "Apply" button would fix that. Maybe it is even better to name it "Apply Color" button, because that gives a hint that you can apply more than one color (which is not clear from the old dialog design).
User avatar
uwestoehr
Posts: 1634
Joined: Sun Jan 27, 2019 3:21 am

Re: [Solved] Making a sticker with DraftWB

Postby uwestoehr » Thu Aug 06, 2020 12:30 am

catman wrote:
Mon Aug 03, 2020 8:20 am
I am not sure how easy that would be, but the dialog imho has one other drawback: if you want to define several colors on the same part you have to close the dialog and open it again via the context menu.
Good point. I will have a look after my PR went in.