DispHdrLocation settings changed

This commit is contained in:
Ianos Gnatiuc
2005-11-08 23:50:34 +00:00
parent 3fdeadf9d2
commit beaff94ac6
6 changed files with 41 additions and 15 deletions

View File

@@ -487,12 +487,18 @@ void CfgDisphdrdateset() {
void CfgDisphdrlocation()
{
if (strieql("RIGHT", val))
CFG->disphdrlocation = TRIGHT;
else if (strieql("CENTER", val))
CFG->disphdrlocation = TCENTER;
else
CFG->disphdrlocation = GetYesno(val) ? TRIGHT : NO;
char* key;
getkeyval(&key, &val);
CFG->disphdrlocation = GetYesno(key);
if (CFG->disphdrlocation != NO)
{
if (strieql("CENTER", val))
CFG->disphdrlocation = CFG->disphdrlocation + (TCENTER << 16);
else
CFG->disphdrlocation = CFG->disphdrlocation + (TRIGHT << 16);
}
}
// ------------------------------------------------------------------

View File

@@ -219,7 +219,12 @@ void GMsgList::ReadMlst(int n) {
void GMsgList::do_delayed() {
// Update header and statusline
if(AA->Msglistheader()) {
if(AA->Msglistheader())
{
int disphdrlocation = CFG->disphdrlocation;
if ((CFG->disphdrlocation & 0xFFFF) == YES)
CFG->disphdrlocation = NO;
ReadMlst(index);
AA->LoadMsg(&msg, mlst[index]->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
mlst[index]->goldmark = goldmark;
@@ -231,6 +236,8 @@ void GMsgList::do_delayed() {
HeaderView->Use(AA, &msg);
HeaderView->Paint();
wactiv_(mlstwh);
CFG->disphdrlocation = disphdrlocation;
}
if(CFG->switches.get(msglistviewsubj)) {
@@ -750,7 +757,12 @@ void GThreadlist::update_title() {
void GThreadlist::do_delayed() {
// Update header and statusline
if(AA->Msglistheader()) {
if(AA->Msglistheader())
{
int disphdrlocation = CFG->disphdrlocation;
if ((CFG->disphdrlocation & 0xFFFF) == YES)
CFG->disphdrlocation = NO;
AA->LoadMsg(&msg, list[index].msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
for(std::vector<Node>::iterator x = CFG->username.begin(); x != CFG->username.end(); x++) {
if(strieql(msg.By(), x->name)) {
@@ -767,6 +779,8 @@ void GThreadlist::do_delayed() {
HeaderView->Use(AA, &msg);
HeaderView->Paint();
wactiv_(mlstwh);
CFG->disphdrlocation = disphdrlocation;
}
if(CFG->switches.get(msglistviewsubj)) {

View File

@@ -350,7 +350,7 @@ void GMsgHeaderView::Paint() {
{
loc += " ";
int pos = window.width() - loc.length();
pos = (CFG->disphdrlocation == TCENTER) ? pos/2 : pos-1;
pos = ((CFG->disphdrlocation >> 16) == TCENTER) ? pos/2 : pos-1;
window.prints(5, pos, location_color, loc.c_str());
}
}