Skip to content

Commit

Permalink
Gui: Do not use hard-coded blue color in tree
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Aug 20, 2019
1 parent b32f094 commit 5a00419
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Gui/propertyeditor/PropertyItem.cpp
Expand Up @@ -561,7 +561,7 @@ QVariant PropertyItem::data(int column, int role) const
return toolTip(propertyItems[0]);
else if( role == Qt::TextColorRole) {
if(hasExpression())
return QVariant::fromValue(QColor(0,0,255.0));
return QVariant::fromValue(QApplication::palette().color(QPalette::Link));
return QVariant();
} else
return QVariant();
Expand Down

5 comments on commit 5a00419

@realthunder
Copy link
Collaborator

Choose a reason for hiding this comment

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

QPalette::Link seems not working for me here with Qt5 Conda Linux. Shall we use a fc parameter for that?

@yorikvanhavre
Copy link
Member Author

Choose a reason for hiding this comment

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

How strange, I'm on Linux/Qt5 too. But Qt is known to be a bit annoying with theming... Yes, if the above doesn't work well on some platforms, the best solution is probably to use a fc parameter. Too bad there doesn't seem to be a way to use a fallback color with qpalette colors...

The main reason why I changed yours is because I use a dark theme and the blue color is almost illegible. Later I also need to change the yellow background color you used in the properties editor 😄

@yorikvanhavre
Copy link
Member Author

Choose a reason for hiding this comment

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

Also, I had changed this color a while back to use Preferences->Editor->Current line color but it seems to have been changed back to yellow, which is unreadable on dark bg... But I cannot find anymore where it happens...
Screenshot from 2019-08-27 17-33-19

@realthunder
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably overwritten by my big patch. Maybe it is better to have two default settings for light and dark theme, in addition to a preference entry?

@yorikvanhavre
Copy link
Member Author

Choose a reason for hiding this comment

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

There are also special high-contrast themes for people with visual disability, and the qss themes that are provided with FreeCAD... So all these colors should stay themable or configurable somehow...
I would suggest using Preferences->Editor->Current line color for all the situations where a line of text is highlighted, I think that makes sense... As for the link color, maybe we could use the blue color as a fallback if a qpalette color is not available? Not sure if it's possible to detect that case...

Please sign in to comment.