FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

X11: support tabbed menu columns by chasonr · Pull Request #1661 · NetHack/NetHack · GitHub

X11: support tabbed menu columns - #1661

Closed
chasonr wants to merge 6 commits into
NetHack:NetHack-5.0from
chasonr:x11-tabbed-columns
Closed

X11: support tabbed menu columns#1661
chasonr wants to merge 6 commits into
NetHack:NetHack-5.0from
chasonr:x11-tabbed-columns

Conversation

chasonr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Set iflags.menu_tab_sep and respond to tabs in menu items. Change the default menu font to sans-10.

chasonr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Marking this draft for the moment.

It has one glitch that bugs me somewhat: headings get aligned with the item names rather than the left margin. That isn't the thing I'm after right now. I checked the Qt interface to see if it has the same problem, which it does, but also noticed that the menu had been changed to a fixed width font. This was commit c96a9ff. I specifically remembered supporting proportional fonts in Qt 4; it began its existence in nethack-i18n, which, as discussed in #1656, has to support tabbed columns.

So the problem that led to the Qt menus being made fixed width will apply to X11 (and Win32) also.

chasonr marked this pull request as draft August 20, 2026 02:58

chasonr commented Aug 20, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

Changing the relevant menu (doextlist()) solved that problem, and created another. The command listings at the top become entirely part of the first column, causing the actual help listing to have a very wide first column. This affects both X11 and Qt.

The text window is assumed to use a monospaced font.
If a line in the menu has fewer columns than the others, the last one
is deemed to extend to the right margin, and does not count toward the
maximum width of that column.

Also, revert the change to NetHack.font_menu.

chasonr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

A modest change to the column width algorithm seems to resolve the issue, as far as the X11 interface itself is concerned. The last column of a line is deemed to extend to the right margin, and does not extend the width of that same column in other lines.

I have confirmed that a tabified extended command list displays correctly with a proportional font. But I have reverted the change of NetHack.font_menu. Tabifying the menus will affect the Qt and win32 ports. I will leave that for another pull request.

This pull request, as it now stands, should have no obvious effect on the X11 interface unless you change font_menu to a proportional font, whether in NetHack.ad or in .nethackrc.

chasonr marked this pull request as ready for review August 20, 2026 06:01

paxed commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Is it intentional that the inventory and stats block in the character reroll window are indented? I'm not saying it's necessarily bad, just different from what it was before.

chasonr commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

I've done the before and after on that menu and I see what you mean. No, it isn't intentional. But there are cases where we would want to indent a line without a selector; say, in the options menu, which displays options that can't be selected. I would need to know which lines should be indented.

paxed commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This is in the pipeline.

chasonr commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Closing this; the changes are in the mainline now.

chasonr closed this Aug 24, 2026
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL