From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46217 invoked by alias); 2 Mar 2015 13:55:47 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 46148 invoked by uid 89); 2 Mar 2015 13:55:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: rgout06.bt.lon5.cpcloud.co.uk Received: from rgout06.bt.lon5.cpcloud.co.uk (HELO rgout06.bt.lon5.cpcloud.co.uk) (65.20.0.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2015 13:55:45 +0000 X-OWM-Source-IP: 31.51.205.191(GB) X-OWM-Env-Sender: jonturney@btinternet.com X-CTCH-RefID: str=0001.0A090202.54F46BDD.000D,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-Junkmail-Premium-Raw: score=27/50,refid=2.7.2:2015.2.26.105422:17:27.888,ip=31.51.205.191,rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __SUBJ_ALPHA_END, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __IN_REP_TO, __REFERENCES, __ANY_URI, __URI_NO_WWW, __URI_NO_PATH, BODY_SIZE_1900_1999, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, __URI_NS, SXL_IP_DYNAMIC[191.205.51.31.fur], HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, RDNS_SUSP, BODY_SIZE_2000_LESS, BODY_SIZE_7000_LESS, REFERENCES X-CTCH-Spam: Unknown Received: from localhost.localdomain (31.51.205.191) by rgout06.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as jonturney@btinternet.com) id 54EE0C8F00A90DDD; Mon, 2 Mar 2015 13:55:40 +0000 From: Jon TURNEY To: cygwin-apps@cygwin.com Cc: Jon TURNEY Subject: [PATCH setup 1/4] Fix truncation of "Bin?" and "Src?" column headers Date: Mon, 02 Mar 2015 13:55:00 -0000 Message-Id: <1425304525-12268-2-git-send-email-jon.turney@dronecode.org.uk> In-Reply-To: <1425304525-12268-1-git-send-email-jon.turney@dronecode.org.uk> References: <1425304525-12268-1-git-send-email-jon.turney@dronecode.org.uk> X-SW-Source: 2015-03/txt/msg00007.txt.bz2 It seems that the the "Bin?" and "Src? columns in the PickView are usually not quite wide enough, and display truncated with an ellipsis, e.g. 'B...' and 'S...', which is completely unintelligible. Try to more correctly size these colums. 3*GetSystemMetrics(SM_CXEDGE) seems to be documented as the default value for the margin of a header control, so text length + twice that is the minimum header width needed. ChangeLog: 2015-03-02 Jon TURNEY * PickView.cc (init_headers): More correctly size "Bin?" and "Src?" columns. Signed-off-by: Jon TURNEY --- PickView.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/PickView.cc b/PickView.cc index 00a3c3a..4630ee9 100644 --- a/PickView.cc +++ b/PickView.cc @@ -441,13 +441,15 @@ PickView::init_headers (HDC dc) headers[i].x = 0; } - // accomodate widths of the 'bin' and 'src' checkbox columns - // FIXME: What's up with the "0"? It's probably a mistake, and should be - // "". It used to be written as 0, and was subject to a bizarre implicit - // conversion by the unwise String(int) constructor. - note_width (headers, dc, "0", HMARGIN + 11, bintick_col); - note_width (headers, dc, "0", HMARGIN + 11, srctick_col); - + // A margin of 3*GetSystemMetrics(SM_CXEDGE) is used at each side of the + // header text. (Probably should use that rather than hard-coding HMARGIN + // everywhere) + int addend = 2*3*GetSystemMetrics(SM_CXEDGE); + + // accommodate widths of the 'bin' and 'src' checkbox columns + note_width (headers, dc, headers[bintick_col].text, addend, bintick_col); + note_width (headers, dc, headers[srctick_col].text, addend, srctick_col); + // accomodate the width of each category name packagedb db; for (packagedb::categoriesType::iterator n = packagedb::categories.begin(); -- 2.1.4