mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
scroll to right location when account is expanded
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@172 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
243464af30
commit
6f2d330f1c
@ -300,6 +300,7 @@ expandListCB( Widget mw, XtPointer pClientData, XtPointer cb)
|
||||
{
|
||||
XmAnyCallbackStruct *info = (XmAnyCallbackStruct *) cb;
|
||||
Account *acc = (Account *)pClientData;
|
||||
int i, nrows;
|
||||
|
||||
/* a "fix" to avoid double invocation */
|
||||
switch ( info->reason ) {
|
||||
@ -330,8 +331,28 @@ expandListCB( Widget mw, XtPointer pClientData, XtPointer cb)
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* finally, redraw the main window */
|
||||
/* redraw the main window */
|
||||
refreshMainWindow ();
|
||||
|
||||
/* find the selected account in the new window,
|
||||
* and scroll to it. */
|
||||
XtVaGetValues( accountlist, XmNrows, &nrows, NULL );
|
||||
|
||||
for (i=0; i<nrows; i++) {
|
||||
Account * racc;
|
||||
racc = (Account *) XbaeMatrixGetRowUserData (accountlist, i);
|
||||
if (racc == acc) {
|
||||
Boolean isviz;
|
||||
isviz = XbaeMatrixIsRowVisible (accountlist, i);
|
||||
if (False == isviz) {
|
||||
/* scroll to bottom first, so that during rewind,
|
||||
* sub-accounts become visible too */
|
||||
XbaeMatrixMakeCellVisible (accountlist, nrows-1, 0);
|
||||
XbaeMatrixMakeCellVisible (accountlist, i, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
|
Loading…
Reference in New Issue
Block a user