plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

Restore ability to change background color of class/entity header #980

Closed alfredporter closed 2 years ago

alfredporter commented 2 years ago

@arnaudroques Test A0005 is now failing because the header.BackgroundColor style is changing both the page header and the header of the two classes. Are my changes correct and this would become the new expected result or should the background color of the classes not be affected by the global header style?

arnaudroques commented 2 years ago

I guess that you are trying to fix something like the following example (which is not completely working):

@startuml
<style>
document {
  header {
    FontColor red
    BackgroundColor lightGray
  }
}

  class {
      FontColor blue
      BackgroundColor yellow

      header {
        FontSize 20
        FontColor green
        BackgroundColor red
      }
}
</style>

header some page header

class Foo {
  dummy
}
@enduml

The "Foo" background should be red, and it is not. We're going to have a look on this.

arnaudroques commented 2 years ago

You are right about Test A0005. We have change it because the style part was not correct there..

Your pull request was very helpful, but we have implemented is slightly differently.

Tell us if does not solve your issue.

Thanks again for your contribution!

alfredporter commented 2 years ago

It does solve my issue, and I see the short-comings in my original commit. Thank you for the corrections, and for the great work on PlantUML!

The-Lum commented 2 years ago

Hello all,

@startuml
<style>
document {
  header {
    FontColor red
    BackgroundColor lightGray
  }
}

object {
  FontColor blue
  BackgroundColor yellow

  header {
    FontSize 20
    FontColor green
    BackgroundColor red
  }
}
</style>

header some page header

Object Foo {
  dummy
}
@enduml

Regards.

arnaudroques commented 2 years ago

Good idea! It's done for object.

Thanks for the suggestion

The-Lum commented 2 years ago

Good 👍... (But always more...) Then, next steps:


  1. Could you do the same thing for map and header of map ? See request here:

  1. Could you do the same thing for fields of class or methods of class? See request here:

[Have a good night]

jongracecox commented 1 year ago

This issue appears to have regressed in v1.2022.6. The header background color no longer works. Testing using the following code (taken from above) I get:

@startuml
<style>
document {
  header {
    FontColor red
    BackgroundColor lightGray
  }
}

object {
  FontColor blue
  BackgroundColor yellow

  header {
    FontSize 20
    FontColor green
    BackgroundColor red
  }
}
</style>

header some page header

Object Foo {
  dummy
}
@enduml

image

Is this still an issue or have I done something wrong?

arnaudroques commented 1 year ago

This is strange. It seems to work with online version.

Could you double check the version you are using? Thanks!

jongracecox commented 1 year ago

This is also strange as I think I was using the online version. If it's working online then this probably isn't broken. I will re-test later.