kkujansuu / gramps

MIT License
1 stars 1 forks source link

Foreground & background colors need to be Dark theme compatible #9

Closed emyoulation closed 2 years ago

emyoulation commented 2 years ago

Colors for foreground text and backgrounds conflict when Dark Themes are selected. See Experimental FilterParams add-on, Dark themes and Glade; Post 5: image

Chris Horn's experimental LinkedView Relationships view mode add-on has been adjusted for more color than most Gramps GUIs and adapted to Light/Dark theme switching. The Configuration interface is not necessary for a Tools like it is for a view mode, but perhaps the source will give a lead for using color palettes that work with the Theming. image

emyoulation commented 2 years ago

Did not care for the equally unpleasant colors for Light&Dark modes that Dave found last December. So I've been letting the color selection problem "percolate" for a while. Finally got back to it today.

I tried leveraging the alpha channel part of the RGBa system. Decided the 1st level was too prominent. So bumped that first level down from a color highlight to a brightness change highlight. Also re-ordered the colors according to the how they are arranged on a color wheel.

The alpha channel works well for both Light & dark themes. It should probably survive other CSS incarnations. And the highlighting seems a bit more subtle to me.

image image

modified Line 138 as follows:

        self.categories_translated = [_(cat) for cat in self.categories]
        self.colors = [
             Gdk.RGBA(0.75,0.75,0.75, 0.250),
             Gdk.RGBA(0.75,0.75,0.99, 0.250),
             Gdk.RGBA(0.75,0.99,0.99, 0.250),
             Gdk.RGBA(0.75,0.99,0.75, 0.250),
             Gdk.RGBA(0.99,0.99,0.75, 0.250),
             Gdk.RGBA(0.99,0.75,0.75, 0.250),
             Gdk.RGBA(0.99,0.75,0.99, 0.250),
        ]

GUI screen captures generated with the following custom_filters.xml chunk :

<?xml version="1.0" encoding="utf-8"?>
<filters>
  <object type="Person">
    <filter name="Persons at Events in Place X" function="and" comment="Who was at any Event in a Place">
      <rule class="MatchesEventFilter" use_regex="False">
        <arg value="MatchesEventFilter"/>
      </rule>
    </filter>
  </object>
  <object type="Place">
    <filter name="IsEnclosedBy" function="and" comment="Places enclosed">
      <rule class="IsEnclosedBy" use_regex="False">
        <arg value="P0003"/>
        <arg value="0"/>
      </rule>
    </filter>
    <filter name="MatchesPlaceFilter" function="and">
      <rule class="MatchesFilter" use_regex="False">
        <arg value="IsEnclosedBy"/>
      </rule>
    </filter>
  </object>
  <object type="Event">
    <filter name="MatchesEventFilter" function="and" comment="Events in a Place">
      <rule class="MatchesPlaceFilter" use_regex="False">
        <arg value="IsEnclosedBy"/>
      </rule>
    </filter>
  </object>
</filters>

Although for a FULL illustration, this Custom Filter probably ought to include multi-rule as well as the 4 level multi-stage. Maybe add an Active Person or Home Person rule? image

Well THAT would NOT work. Forgot to set the multi-rule to "At least one rule" instead of "all rules" image

kkujansuu commented 2 years ago

Thanks very much!

emyoulation commented 2 years ago

I don't know if my having increased the self.colors array from 6 to 7 makes a difference/problem elsewhere? (Perhaps it will be a problem if a multi-stage Custom Filter goes so deep as to have to start again?)

kkujansuu commented 2 years ago

i have now updated the colors as you suggested. Change is in version 1.1.0.

emyoulation commented 2 years ago

works in v.1.1.0 version. (thank you)

Please close