Add custom date format and alternating row colors in list view#3741
Open
StefanL38 wants to merge 2 commits intolinuxmint:masterfrom
Open
Add custom date format and alternating row colors in list view#3741StefanL38 wants to merge 2 commits intolinuxmint:masterfrom
StefanL38 wants to merge 2 commits intolinuxmint:masterfrom
Conversation
New features: - Custom date format option in Edit → Preferences → Display - New "Custom…" entry in the Format dropdown - Format tokens: YYYY, YY, MM, DD, HH, hh, mm, SS - Example: YYYY.MM.DD HH:mm → 2026.03.21 11:25 - Changes apply immediately without restart - Auto-fit button: sets all date columns to text width + saved padding - Save padding button: saves current padding as new default - Alternating row colors (white / light gray #ebebeb) in list view - Configurable via Edit → Preferences → Views → List View Defaults - Enabled by default - Implemented via GtkCellRenderer::cell-background (cell data functions) - Full i18n: all new UI strings in English source + German translations in po/de_custom.po Modified files: - libnemo-private/org.nemo.gschema.xml: new keys date-format-custom, date-column-autosize, date-column-padding, list-view-alternating-rows - libnemo-private/nemo-global-preferences.h/.c: new preference constants and cache variable - libnemo-private/nemo-file.h/.c: nemo_custom_date_format_to_strftime(), nemo_file_get_sample_date_string(), NEMO_DATE_FORMAT_CUSTOM case - src/nemo-file-management-properties.c: custom format entry, auto-fit/save-padding buttons, combo change handler - src/nemo-list-view.c: icon_cell_data_func, text_cell_data_func, set_row_background helper; alternating rows via cell-background - gresources/nemo-file-management-properties.glade: new widgets for custom format box and buttons - po/de_custom.po: German translations for all new UI strings
Change checkbox label and tooltip from German to English source strings (following gettext convention: source strings in English, translations in .po files). Add German translations for both strings to de_custom.po.
JosephMcc
reviewed
Mar 21, 2026
| gtk_tree_path_free (path); | ||
|
|
||
| g_object_set (renderer, | ||
| "cell-background", odd ? "#ebebeb" : NULL, |
Contributor
There was a problem hiding this comment.
Hard coding a color is a terrible idea. Ina a dark theme, you would get light text against a light background. This has to be tied to the theme colors to work.
I also wouldn't space your code into columns like you are doing a few places right here. Just use normal spacing.
JosephMcc
reviewed
Mar 21, 2026
| gpointer user_data) | ||
| { | ||
| gint col_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (renderer), "model-column-num")); | ||
| gchar *text = NULL; |
Contributor
There was a problem hiding this comment.
Same here. Don't space things this way just so they line up. It's fine for the function arguments, but not really here.
This file contains hidden or 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
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.
Summary
This PR adds two new features to the Nemo list view:
1. Custom Date Format
A new "Custom…" option in the date format dropdown under
Edit → Preferences → Display.
When selected, a text field appears where the user can enter a
format string using the following tokens:
Example:
YYYY.MM.DD HH:mm→2026.03.21 14:35Changes apply immediately without restarting Nemo.
Two additional buttons allow managing date column widths:
2. Alternating Row Colors
A new checkbox "Alternating row colors (white / light gray)" under
Edit → Preferences → Views → List View Defaults.
When enabled, odd rows are displayed with a light gray background (
#ebebeb) and even rows with the default background. This improves readability in long file lists.Enabled by default.
Implementation note: CSS
nth-childselectors are not reliable forGtkTreeViewrows in GTK3 (row nodes are recycled dynamically). The alternating background is therefore implemented viaGtkCellRenderer::cell-backgroundusing cell data functions, which is the only robust approach in GTK3.Changed files
libnemo-private/org.nemo.gschema.xml– new keys:date-format-custom,date-column-autosize,date-column-padding,list-view-alternating-rowslibnemo-private/nemo-global-preferences.h/.c– new preference constants and cached format stringlibnemo-private/nemo-file.h/.c–nemo_custom_date_format_to_strftime(),nemo_file_get_sample_date_string(),NEMO_DATE_FORMAT_CUSTOMcasesrc/nemo-file-management-properties.c– custom format entry widget, Auto-fit and Save padding buttons, combo change handlersrc/nemo-list-view.c–set_row_background(),icon_cell_data_func(),text_cell_data_func()for alternating rowsgresources/nemo-file-management-properties.glade– new widgets for custom format box, buttons, and alternating rows checkboxpo/de_custom.po– German translations for all new UI strings