tGtkCLists should now work properly when horizontal scrolling is in effect; a problem with incorrect padding when columns are right-aligned is fixed. - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 31b67956f91c9db95e46973696942f6dca401ab3
(DIR) parent bb56cfb8e9e21dfe39ac6819b2276389814fbd7f
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Mon, 26 Aug 2002 12:50:06 +0000
GtkCLists should now work properly when horizontal scrolling is in effect;
a problem with incorrect padding when columns are right-aligned is fixed.
Diffstat:
M src/gtkport/clist.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/src/gtkport/clist.c b/src/gtkport/clist.c
t@@ -246,7 +246,14 @@ void gtk_clist_draw_row(GtkCList *clist, LPDRAWITEMSTRUCT lpdis)
FillRect(lpdis->hDC, &lpdis->rcItem, bkgrnd);
if (lpdis->itemID >= 0 && lpdis->itemID < clist->rows) {
+ int width;
row = (GtkCListRow *)g_slist_nth_data(clist->rowdata, lpdis->itemID);
+ lpdis->rcItem.left = 0;
+ width = 0;
+ for (i = 0; i < clist->cols; i++) {
+ width += clist->coldata[i].width;
+ }
+ lpdis->rcItem.right = MAX(lpdis->rcItem.right, width);
CurrentX = lpdis->rcItem.left;
rcCol.top = lpdis->rcItem.top;
rcCol.bottom = lpdis->rcItem.bottom;
t@@ -257,10 +264,10 @@ void gtk_clist_draw_row(GtkCList *clist, LPDRAWITEMSTRUCT lpdis)
rcCol.right = CurrentX - LISTITEMHPACK;
if (rcCol.left > lpdis->rcItem.right)
rcCol.left = lpdis->rcItem.right;
- if (rcCol.right > lpdis->rcItem.right)
- rcCol.right = lpdis->rcItem.right;
+ if (rcCol.right > lpdis->rcItem.right - LISTITEMHPACK)
+ rcCol.right = lpdis->rcItem.right - LISTITEMHPACK;
if (i == clist->cols - 1)
- rcCol.right = lpdis->rcItem.right;
+ rcCol.right = lpdis->rcItem.right - LISTITEMHPACK;
if (row->text[i]) {
UINT align;
switch(clist->coldata[i].justification) {