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

Graphic layers focus #409

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

shakenov-chinga
Copy link

Please, refer to #406

Implemented support for netlines, footprint, via and plane.
@ubruhin
Copy link
Member

ubruhin commented Jan 27, 2019

Hi @shakenov-chinga,

I just tried it out, this is really an awesome feature! 😃

Regarding your comment at #408 (comment):

I weren't able to find any connection between PrimitivePathGraphicsItem and Board. It can be hard-coded, passing Board instance via constructor, but all of my inner self is refusing to do so smiley.

Yeah that shouldn't be done, PrimitivePathGraphicsItem is in the librepcbcommon library which must not have a dependency to librepcbproject, where Board is located.

But I just had another idea: If the focused layer would be a property of the GraphicsLayer class, all graphics items no longer need the dependency to Board to determine the focused layer. Basically following things would need to be done:

  • GraphicsLayer needs an additional property, e.g. called mIsActive or so (similar to mIsVisible). Per default, all layers are set as active.
  • To also avoid the hardcoded color of unfocused layers, GraphicsLayer could also have a new property mColorInactive, similar to mColorHighlighted (for simplicity, the same color can be used for all layers, but theoretically we have the option to use individual colors).
  • If the user wants to focus on one specific layer, the board layer stack sets all layers to inactive, except the layer which should be focused. All graphics items are repainted automatically because they are registered to the graphics layers and thus get notified about the activity change.
  • With this concept, it would even be possible to focus on multiple layers, for example by pressing CTRL or SHIFT while selecting layers in the layer dock. This would be nice for example to focus on all layers which are printed on silkscreen (outlines/names/values) to see how the whole silkscreen looks like.

What do you think about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants