jwm icon indicating copy to clipboard operation
jwm copied to clipboard

Enhancement : Authorize leading space in menu label

Open htopkill opened this issue 8 years ago • 6 comments

hi, Enhancement request In menu, it's better when you can put a space between icon and item label.(openbox enable it) In jwm, you remove the leading space of the item label Can you just NOT remove the leading space for menu label? Thanks

htopkill avatar Mar 12 '17 10:03 htopkill

If I’m understanding this correctly, the issue is that JWM strips the whitespace off the beginning of labels for menus. I agree that JWM should let you have whitespace there if you want. The issue is that the parser strips off the white space. So fixing this is fairly easy, but somewhat scary because it could affect more than just menus. Another option is to add an addition attribute for the spacing between the icon and the text. I’m not sure which is the best approach, but I’ll give it some thought.

joewing avatar Mar 24 '17 01:03 joewing

hello, Sorry , i'm not a native english speaker. your understanding is correct. Try to keep it simple; in openbox, to add space, you just define menu label as " xxx" with a space in the string. It really gives a better look to the menu. ( PS: You have done good job : JWM is simple to configure in comparison to openbox. Keep it simple, Don't put too many useless options. If i want a full-featured window manager, i go to openbox)

htopkill avatar Mar 24 '17 07:03 htopkill

@joewing If you are going to be poking at the parser anyhow, jwm's lack of support for single-quoted properties caused me hours of frustration at one point. What if using single quotes preserved the spacing the way it does on the command line. I know it isn't the XML standard way, but more of a *nix-ism that would seem obvious to most non-beginners. This way existing config files would continue working as before, jwm could handle a larger subset of XML and the downstream projects would have another tool in their toolbox.

technosaurus avatar Mar 24 '17 14:03 technosaurus

Oops, I mistakenly assumed the trimming of white space happend in lex.c, but the lexer already preserves whitespace which is later trim()-ed using the function in misc.c. In this case labels, tooltips etc could have a preserve_whitespace property that is set to true if single quotes are used and then the trim() function could just do something like this pseudo code if (!object.preserve_whitespace){...}

technosaurus avatar Mar 27 '17 06:03 technosaurus

I'm strongly against any XML violations. Why? Because XML already supports all the needed things. Just use XML entities - e.g.   (space) and you're fine.

The current JWM XML parser shall support them. What might be an issue is the readability and human-friendliness while editing - therefore my proposal to add support for CDATA.

dumblob avatar Jul 02 '17 09:07 dumblob

XML entities does not work

codesardine avatar Dec 14 '17 05:12 codesardine