Skip to content
Snippets Groups Projects
Commit 7303bfcc authored by deuce's avatar deuce
Browse files

Add a LeftJustify INI-only option.

If the syncterm.ini file has LeftJustify=TRUE in it, non-exact modes
(ie: curses) will print against the left margin, and the sides won't be
filled with blue.

This change really highlights just how bad the term struct is, and this
won't become an official option until after the 1.1 release and a serious
overhaul of this stuff occurs.
parent d312e211
Branches
Tags
No related merge requests found
......@@ -1238,6 +1238,7 @@ void load_settings(struct syncterm_settings *set)
set->scaling_factor=iniReadInteger(inifile,"SyncTERM","ScalingFactor",0);
set->window_width=iniReadInteger(inifile,"SyncTERM","WindowWidth",0);
set->window_height=iniReadInteger(inifile,"SyncTERM","WindowHeight",0);
set->left_just=iniReadBool(inifile,"SyncTERM","LeftJustify",FALSE);
/* Modem settings */
iniReadString(inifile, "SyncTERM", "ModemInit", "AT&F&C1&D2", set->mdm.init_string);
......
......@@ -64,6 +64,7 @@ struct syncterm_settings {
int custom_fontheight;
int window_width;
int window_height;
int left_just;
};
extern char *inpath;
......
......@@ -14,7 +14,7 @@ int drawwin(void)
char str[32];
int x,y,c;
gettextinfo(&txtinfo);
gettextinfo(&txtinfo);
strcpy(str," ");
......@@ -33,15 +33,17 @@ int drawwin(void)
term.height=24;
term.nostatus=1;
}
term.x=(txtinfo.screenwidth-term.width)/2+2;
if (settings.left_just)
term.x = 2;
else
term.x=(txtinfo.screenwidth-term.width)/2+2;
term.y=(txtinfo.screenheight-term.height)/2+2;
if((winbuf=(char *)alloca(txtinfo.screenheight*txtinfo.screenwidth*2))==NULL) {
uifcmsg("Cannot allocate memory for terminal buffer", "`Memory error`\n\n"
"Either your system is dangerously low on resources or your\n"
"window is farking huge!");
"Either your system is dangerously low on resources or your\n"
"window is farking huge!");
return(-1);
}
c=0;
for(y=0;y<txtinfo.screenheight;y++) {
p=str;
......@@ -54,7 +56,10 @@ int drawwin(void)
winbuf[c++]=*(p++);
if(!*p)
p=str;
winbuf[c++]=YELLOW|(BLUE<<4);
if (settings.left_just)
winbuf[c++]=0;
else
winbuf[c++]=YELLOW|(BLUE<<4);
}
}
puttext(1,1,txtinfo.screenwidth,txtinfo.screenheight,winbuf);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment