simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Aug 1 19:56:41 BST 2022


TL;DR:
  932f6f53 windows/pageant.rc: add missing symbolic constant.
  3e7274fd Windows Pageant: use an owner-drawn list box for the key list.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2022-08-01 19:56:41

commit 932f6f5387fd3e7fe84d00a30d91d9105d212f42
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=932f6f5387fd3e7fe84d00a30d91d9105d212f42;hp=b66c56f44129817540086c1c64e4d3e6631c31f4
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Aug 1 17:32:40 2022 +0100

    windows/pageant.rc: add missing symbolic constant.
    
    The main list box in the Pageant key list window was identified by a
    numeric control id, even though pageant-rc.h has a nice meaningful
    macro name for it (and pageant.c uses that).

 windows/pageant.rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 3e7274fdad91069022994c1a3aa43c4aef6ef713
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3e7274fdad91069022994c1a3aa43c4aef6ef713;hp=932f6f5387fd3e7fe84d00a30d91d9105d212f42
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Aug 1 17:45:55 2022 +0100

    Windows Pageant: use an owner-drawn list box for the key list.
    
    The main key list control in the Pageant window was previously an
    ordinary LBS_HASSTRINGS list box, with tab characters aligning the
    various parts of the key information into different columns. This was
    fragile because any mistake in the font metrics could have overflowed
    a tab stop and forced the text to move on to the next one.
    
    Now I've switched the list box into LBS_OWNERDRAWFIXED mode, which
    means that in place of a string for each list item I store a struct of
    my choice, and I have to draw the list-box entries myself by
    responding to WM_DRAWITEM. So now I'm drawing each component of the
    key information as a separate call to ExtTextOut (plus one
    TabbedTextOut to put the '(encrypted)' suffix on the end), which means
    that the tab stops are now guaranteed to appear where I tell them to.
    
    No functional change, for the moment: this is pure refactoring. As
    closely as I can tell, the appearance of the list box is
    pixel-for-pixel what it was before this commit. But it opens the door
    for two further improvements (neither one done in this commit): I can
    dynamically choose the tab stop locations based on querying the text
    metrics of the strings that will actually need to fit in the columns,
    and also, whatever reorganisation I need to do to make certificates
    fit sensibly in this list box can now be done without worrying about
    breaking anything terribly fragile.

 windows/pageant.c  | 215 +++++++++++++++++++++++++++++++++++++++--------------
 windows/pageant.rc |   2 +-
 2 files changed, 159 insertions(+), 58 deletions(-)



More information about the tartarus-commits mailing list