Changeset d126a19


Ignore:
Timestamp:
Jan 23, 2012, 5:27:43 PM (12 years ago)
Author:
Jason Gross <jgross@mit.edu>
Branches:
master, release-1.10, release-1.9
Children:
b43035e, bf70350, 7483942, 9a2dd0c
Parents:
219f52c
git-author:
Jason Gross <jgross@mit.edu> (07/22/11 03:54:51)
git-committer:
Jason Gross <jgross@mit.edu> (01/23/12 17:27:43)
Message:
Flush the fmttext cache and redisplay on setting colorztext

This fixes trac-#147.

owl_function_calculate_topmsg should probably hang off the mainwin.
Currently, the implementation relies on the existence of the current
view and recwinlines (which relies on the existence of the global
mainpanel).  The global mainpanel is guarenteed to exist if the mainwin
has been created.  The scrollmode variable must also have already been
created (it is currently safe to assume that if the mainwin exists, then
all the variables have been created).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    rf271129 rd126a19  
    116116               "both,in,out"),
    117117
    118   OWLVAR_BOOL( "colorztext" /* %OwlVarStub */, 1,
    119                "allow @color() in zephyrs to change color",
    120                "Note that only messages received after this variable\n"
    121                "is set will be affected." ),
     118  OWLVAR_BOOL_FULL( "colorztext" /* %OwlVarStub */, 1,
     119                    "allow @color() in zephyrs to change color",
     120                    NULL, NULL, owl_variable_colorztext_set, NULL),
    122121
    123122  OWLVAR_BOOL( "fancylines" /* %OwlVarStub */, 1,
     
    496495  }
    497496  return owl_variable_bool_set_default(v, newval);
     497}
     498
     499int owl_variable_colorztext_set(owl_variable *v, const void *newval)
     500{
     501  int ret = owl_variable_bool_set_default(v, newval);
     502  /* flush the format cache so that we see the update, but only if we're done initializing BarnOwl */
     503  if (owl_global_get_msglist(&g) != NULL)
     504    owl_messagelist_invalidate_formats(owl_global_get_msglist(&g));
     505  if (owl_global_get_mainwin(&g) != NULL) {
     506    owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
     507    owl_mainwin_redisplay(owl_global_get_mainwin(&g));
     508  }
     509  return ret;
    498510}
    499511
Note: See TracChangeset for help on using the changeset viewer.