jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 68 forks source link

Light Fg for `Properties` is unusable #514

Closed robertmlinden closed 6 years ago

robertmlinden commented 6 years ago

...because then the checkmarks adopt the light color as well, not just the lettering. The checkbox background is unaffected, so it's light on light.

checked

robertmlinden commented 6 years ago

In that image, B is checked, I believe

robertmlinden commented 6 years ago

On the right, the ListBox works fine with the same Bg and Fg colours applied.

jarvisteach commented 6 years ago

I can just about make it out!

On my Mac, the OS overrides some of the widgets - I can't change buttons or tick boxes, it uses the Mac's built-in widgets, so as you can see here they are always blue, with a white tick.

I'll need to boot up one of my other machines to investigate.

Could you post a snippet of text that reproduces it?

robertmlinden commented 6 years ago

Oh I see, I actually had the fg color set to #eeeeee, not fs, so that's why. However, I'm working with non-technical users here and I'm sure they would not find this satisfactory. I mean, I didn't even see it.

                     self.openSubWindow(self.detail_subwindow)
        self.setLabelBg(self.spreadsheet_header_row_num_label, self.dark_greyed_bg)
        self.setEntryBg(self.spreadsheet_header_row_num_entry, self.dark_greyed_bg)     
        self.setPropertiesBg(self.primary_columns_id, self.dark_greyed_bg)      
        self.setLabelBg(self.static_columns_label, self.dark_greyed_bg)     
        self.setListBoxBg(self.static_columns_id, self.dark_greyed_bg)
        self.setLabelFg(self.spreadsheet_header_row_num_label, self.light_fg_text)
        self.setEntryFg(self.spreadsheet_header_row_num_entry, self.light_fg_text)      
        self.setPropertiesFg(self.primary_columns_id, self.light_fg_text)       
        self.setLabelFg(self.static_columns_label, self.light_fg_text)      
        self.setListBoxFg(self.static_columns_id, self.light_fg_text)
        self.setBg(self.dark)
        self.stopSubWindow()

This code is used to change the theme, where what is being displayed is a snippet from dark.

robertmlinden commented 6 years ago
    self.dark = '#4f4f4f'

    self.dark_greyed_bg = '#747474'

    self.light_fg_text = '#eeeeee'
jarvisteach commented 6 years ago

Turns out this is a feature of tkinter. The text and tick share the same colour, you can't set them to be different.

So, the only option, if you want light coloured text, is to change the background colour of the tick box to a dark colour.

This can be done with the selectcolor property on regular checkboxes, but will need to be added to the code for a properties widget.

jarvisteach commented 6 years ago

Ok, I've added support for 'selectcolor' (and some other fields) in the properties widget.

Now you can do either:

props = app.addProperties('name', values)
props.config(selectcolor='black')

Or if you're using the new accessors: app.properties('name', values, selectcolor='black')

jarvisteach commented 6 years ago

Also included a `app.setPropertiesSelectColour('name', 'colour')

And an additional set of params, where, instead of selectcolor/selectColour you can use boxing

So, you can now use:

props = app.addProperties('name', values)
props.config(boxbg='black')
# or
app.properties('name', values, boxbg='black')
# or
app.setPropertiesBoxBg('nam', 'black')