Skip to content

Commit

Permalink
Active container (light gray) and edit (yellow) colors in Tree view a…
Browse files Browse the repository at this point in the history
…re now changeable in prefs->display->colors
  • Loading branch information
yorikvanhavre committed Apr 19, 2018
1 parent 869b5c8 commit 10e33d0
Show file tree
Hide file tree
Showing 3 changed files with 269 additions and 215 deletions.
4 changes: 4 additions & 0 deletions src/Gui/DlgSettingsViewColor.cpp
Expand Up @@ -67,6 +67,8 @@ void DlgSettingsViewColor::saveSettings()
HighlightColor->onSave();
SelectionColor->onSave();
spinPickRadius->onSave();
TreeEditColor->onSave();
TreeActiveColor->onSave();
}

void DlgSettingsViewColor::loadSettings()
Expand All @@ -83,6 +85,8 @@ void DlgSettingsViewColor::loadSettings()
HighlightColor->onRestore();
SelectionColor->onRestore();
spinPickRadius->onRestore();
TreeEditColor->onRestore();
TreeActiveColor->onRestore();
}

/**
Expand Down

5 comments on commit 10e33d0

@pgilfernandez
Copy link
Contributor

@pgilfernandez pgilfernandez commented on 10e33d0 May 12, 2018

Choose a reason for hiding this comment

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

Hi Yorik,

IMHO these colors might be controled by default by the stylesheets and, if user wants to, set a new one. Not only background colors but also the text color itself...
Could you make them "reachable" by stylesheets with an ID or something similar?

Thanks!

@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.

Sure, but I don't know what needs to be done for that... I can investigate, but if you know the answer, please tell ;)

@pgilfernandez
Copy link
Contributor

@pgilfernandez pgilfernandez commented on 10e33d0 May 31, 2018

Choose a reason for hiding this comment

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

It's pretty easy: I just need you to "mark" the active text with an ID and tell me what kind of Qt object it is.
For example: it's a QLineText and the unique ID is #ActiveObject, then I create a line in the stylesheet like the following:
QLineText#ActiveObject { color: red }
Anyway, maybe the more flexible setup would be to let the stylesheet to style it as I have just suggested but let the user override this default in the FC Preferences so that they can change it if they want a different one...

@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.

Ok the problem is this: that widget is a QTreeViewItem. It has no background color normally. So I think what we need to do, is to add a class ID to it at the same time that we change its color, and remove that class ID when we set it back to normal. I'll have a look at how to do that...

@pgilfernandez
Copy link
Contributor

Choose a reason for hiding this comment

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

Other approach would be to keep the ID always added to the class and on the default option (no background color) write it as rgba(0,0,0,0) which adds the RGB color (any) and the alpha value to 0 which is 100% transparent.
Do you think this could work?

Please sign in to comment.