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
Allow themes to draw treeview rows in alternating colours #42
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds one or two of three style classes to each cell in a GtkTreeView. Cells in odd-numbered rows have an `.odd` style class, whereas even rows have an `.even` style class added to them. A cell in a column that is used to sort the GtkTreeView gets the `.sorted` style class. This way, themes can add special rules for `.even` rows so that they are darkened slightly compared to `.odd` rows, and cells in a `.sorted` column are shaded even further, perhaps. Example: ``` treeview.view { background-color: #ffffff; } treeview.view.even, treeview.view.sorted.odd { background-color: #e0e0e0; } treeview.view.sorted.even { background-color: #d0d0d0; } ```
lah7
approved these changes
Dec 30, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks! Nice to see its return after all these years!
I looked over a few themes, and created a wiki page with snippets for users to append. I'll add this to the README.
This is a must have! |
lah7
added a commit
to lah7/Ambiant-MATE-Colours
that referenced
this pull request
Jan 27, 2022
Appends CSS for alternating treeview row colours, which will be visible when gtk3-classic is installed. Only added for Ambiant-MATE & Radiant-MATE themes, not Yaru-MATE. Thanks again to: lah7/gtk3-classic#42
powerory
added a commit
to atins-dev/gtk
that referenced
this pull request
Jan 18, 2023
powerory
added a commit
to atins-dev/gtk
that referenced
this pull request
Jul 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #41
This commit adds one or two of three style classes to each cell in a GtkTreeView. Cells in odd-numbered rows have an
.odd
style class, whereas even rows have an.even
style class added to them. A cell in a column that is used to sort the GtkTreeView gets the.sorted
style class. This way, themes can add special rules for.even
rows so that they are darkened slightly compared to.odd
rows, and cells in a.sorted
column are shaded even further, perhaps.Example:
Here's an example of GTK+ 3.24.30 with this patch applied and an appropriate theme: