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

make the default color of cells configurable #408

Merged
merged 6 commits into from
May 7, 2024
Merged

make the default color of cells configurable #408

merged 6 commits into from
May 7, 2024

Conversation

dlax
Copy link
Member

@dlax dlax commented Mar 22, 2024

Fix #407

@dlax dlax force-pushed the color-config branch 3 times, most recently from 482a477 to 8e5a1f3 Compare March 29, 2024 08:27
@dlax dlax marked this pull request as ready for review March 29, 2024 08:33
@dlax dlax requested a review from blogh March 29, 2024 08:33
@dlax dlax force-pushed the color-config branch 2 times, most recently from fe4419c to 647cfaf Compare April 9, 2024 13:23
Copy link
Collaborator

@blogh blogh left a comment

Choose a reason for hiding this comment

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

LGTM

dlax added 6 commits May 7, 2024 11:45
We get rid of the colors.FIELD_BY_MODE dict and:
- define PINNED_COLOR and FOCUSED_COLOR when rows are pinned or focused;
- let the functions in colors module return the color name directly,
  instead of previously indirecting to FIELD_BY_MODE dict;
- move default color values UI.make() body.

Also, the methods and attributes of types.Column are changed a bit: now
'default_color' holds the default color (or None when "normal" should be
used, but we don't repeat it there) and value_color() is the callable
(typically a function from 'colors' module), previously name
color_key().
We need to use a real class, not a dict anymore; but we keep the mapping
interface.
This only applies to columns with a fixed color, i.e. that does not
depend on the value (like do the 'time' or 'state' columns).

Although this limitation is not handled in the Configuration class, we
intercept invalid 'color' option in column configuration while loading
the types.UI object and still return a ConfigurationError so that the
user experience is quite similar.
@dlax dlax merged commit 2feac0e into master May 7, 2024
6 checks passed
@dlax dlax deleted the color-config branch May 7, 2024 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

columns not visible with terminal in GNOME dark or similar
2 participants