Give more choice for whitespace display
Depends on !48 (merged).
By addressing #44 (closed), this MR extends whitespace display to what GtkSourceView 3.24 allows (so bumping its version in configure.ac.in
):
- four white space types: space, tab, newline, non-breaking space;
- three white space locations: leading, trailing, between words.
To achieve this, I chose to use a GtkPopover
in the preferences dialog, built from a GMenuModel
whose actions lie in MousepadApplication
(since these settings make sense at the application level). This is what it looks like:
The binding with GSettings
is done also in MousepadApplication
, while the view properties are bind to the application properties (one for the space type flags and one for the space location flags).
Merge request reports
Activity
added 1 commit
- f41adc21 - Display whitespace as allowed by GtkSourceView 3.24
mentioned in issue #71 (closed)
Well actually, there are only seven checkboxes of real choices, because the first one in each section is only used to select all. And I figured that since these are choices directly available in GtkSourceView, and since it seems to me that we need to add a submenu anyway so as not to invade the dialog box even more, we might as well offer everything to the user, who can always select everything in two clicks.
But we can reduce the range of choices if you find it's really too much, knowing that the space/newline distinction already existed, and that the initial request in #44 (closed) is to add the distinction for trailing whitespace, which means already four checkboxes.
What do you think of using the popover only for white space locations (three checkboxes), and keeping the current state for the rest? (i.e. "Display line endings" as a separate checkbox in the prefs dialog, and display all white space types indistinctly when checking "Display whitespace")
By the way, if you have better proposals for these descriptions… Don't know if "Between words" is better than "Inside a line of text"…
Edited by Gaël BonithonAnother more customary approach could be to use another row in the vbox below "Display Whitespace", indented with an alignment and contain an hbox of 3 checkboxes for "start", "middle", and "end". Like:
- Show line numbers
-
Display whitespace
- Start - [ ] Middle - [ ] End
- Display line endings
Or perhaps even better would be to just have a single GUI preference that enables displaying all whitespaces and then having a non-GUI setting for advanced users to select specific of the sub-options. Might help keep the Preferences dialog less cluttered.
Edited by Matthew BrushOk, I'll add a commit with a non-GUI setting.
Edited by Gaël Bonithon
added 5 commits
Toggle commit listUpdate to depend on !48 (merged) and restrict choices in the popover to space locations.
Here is what it looks like now:
Edited by Gaël Bonithonadded 9 commits
-
58ad29b9...241438f3 - 4 commits from branch
apps:master
- 6b64b278 - Switch to schema-id format for the setting names
- 64e3012e - Code refactoring around GAction-GSettings binding
- 35d5b668 - Reformulate "Home/End Keys" setting description
- 838bbfcd - Display whitespace as allowed by GtkSourceView 3.24
- 0150130d - Restrict choices to space locations
Toggle commit list-
58ad29b9...241438f3 - 4 commits from branch
added 5 commits
Toggle commit listA small add that will be needed when !49 (merged) is merged.
added 15 commits
-
e5df5e6c...bb660dd0 - 9 commits from branch
apps:master
- afdf4fea - Switch to schema-id format for the setting names
- 2664a1c5 - Code refactoring around GAction-GSettings binding
- 192579f2 - Reformulate "Home/End Keys" setting description
- d37f230b - Display whitespace as allowed by GtkSourceView 3.24
- 5e4f657e - Restrict choices to space locations
- c0944455 - Hide the whitespace location settings
Toggle commit list-
e5df5e6c...bb660dd0 - 9 commits from branch
Resolve conflicts after !49 (merged).
mentioned in merge request !50 (merged)
mentioned in merge request !52 (merged)
added 11 commits
-
c0944455...5e7db169 - 5 commits from branch
apps:master
- c2e4d68c - Switch to schema-id format for the setting names
- dff27d5f - Code refactoring around GAction-GSettings binding
- ce4ccba8 - Reformulate "Home/End Keys" setting description
- 595c3a6f - Display whitespace as allowed by GtkSourceView 3.24
- 9fed3b9b - Restrict choices to space locations
- 04808090 - Hide the whitespace location settings
Toggle commit list-
c0944455...5e7db169 - 5 commits from branch
Resolve conflicts after !52 (merged).
added 9 commits
-
04808090...d75bf668 - 3 commits from branch
apps:master
- 84aa5efc - Switch to schema-id format for the setting names
- 1a3039ca - Code refactoring around GAction-GSettings binding
- 1ebfa38d - Reformulate "Home/End Keys" setting description
- f150e63a - Display whitespace as allowed by GtkSourceView 3.24
- d70c55a1 - Restrict choices to space locations
- 97a2a86a - Hide the whitespace location settings
Toggle commit list-
04808090...d75bf668 - 3 commits from branch
Resolve conflicts after !53 (merged).
added 9 commits
-
97a2a86a...8bdc6696 - 3 commits from branch
apps:master
- fc9007a2 - Switch to schema-id format for the setting names
- ba522c67 - Code refactoring around GAction-GSettings binding
- 7d9f8739 - Reformulate "Home/End Keys" setting description
- 6c599cbf - Display whitespace as allowed by GtkSourceView 3.24
- 51608e2c - Restrict choices to space locations
- 6336a13f - Hide the whitespace location settings
Toggle commit list-
97a2a86a...8bdc6696 - 3 commits from branch
Resolve conflicts after !56 (merged).
mentioned in merge request !58 (merged)
added 16 commits
-
6336a13f...467c26d9 - 10 commits from branch
apps:master
- bf28a515 - Switch to schema-id format for the setting names
- 011efd99 - Code refactoring around GAction-GSettings binding
- 136a4502 - Reformulate "Home/End Keys" setting description
- 7a381e9c - Display whitespace as allowed by GtkSourceView 3.24
- 8cbf017b - Restrict choices to space locations
- 8126e4b5 - Hide the whitespace location settings
Toggle commit list-
6336a13f...467c26d9 - 10 commits from branch
Resolve conflicts after !57 (merged).
added 20 commits
-
f5f26968...b5c2ec80 - 14 commits from branch
apps:master
- 345c1656 - Switch to schema-id format for the setting names
- f1074229 - Code refactoring around GAction-GSettings binding
- 21c3342d - Reformulate "Home/End Keys" setting description
- 4767d7fa - Display whitespace as allowed by GtkSourceView 3.24
- 2227297e - Restrict choices to space locations
- decde365 - Hide the whitespace location settings
Toggle commit list-
f5f26968...b5c2ec80 - 14 commits from branch
Resolve conflicts after !59 (merged).
mentioned in merge request !60 (merged)
added 31 commits
-
decde365...0b3b166c - 28 commits from branch
apps:master
- deacd98a - Display whitespace as allowed by GtkSourceView 3.24
- 972dc92a - Restrict choices to space locations
- 63595898 - Hide the whitespace location settings
Toggle commit list-
decde365...0b3b166c - 28 commits from branch
mentioned in commit 8ca595de
changed milestone to %0.4.90