add some shortcuts to "g" termcmd.

SVN revision: 75539
This commit is contained in:
Gustavo Sverzut Barbieri 2012-08-22 10:57:51 +00:00
parent 0d5b09207c
commit d859563fb7
2 changed files with 47 additions and 6 deletions

5
README
View File

@ -60,7 +60,10 @@ f = Reset font to default settign saved in config
f+ = Increase fontsize
f- = Decreate fontsize
fb = Display big font size (10x20 bitmap, or size 20 with scalable).
gNxM = make terminal NxM chars in size (if possible). e.g. g80x48 g40x20
gNxM = make terminal NxM chars in size (if possible). e.g. g80x48 g40x20.
If just one number is provided, it will use the following shortcuts:
g0=80x40; g1=80x40; g2=80x60; g3=80x80; g4=120x24; g5=120x40; g6=120x60;
g7=120x80; g8=120x120
Mouse controls:

View File

@ -86,17 +86,55 @@ termcmd_do(Evas_Object *obj, Evas_Object *win, Evas_Object *bg, const char *cmd)
}
return EINA_TRUE;
}
if ((cmd[0] == 'g') || (cmd[0] == 'G')) // font size
if ((cmd[0] == 'g') || (cmd[0] == 'G')) // grid size
{
int w = -1, h = -1;
int r = sscanf(cmd, "g%ix%i", &w, &h);
if (sscanf(cmd, "g%ix%i", &w, &h) == 2)
if (r == 1)
{
switch (w)
{
case 0:
w = 80;
h = 24;
break;
case 1:
w = 80;
h = 40;
break;
case 2:
w = 80;
h = 60;
break;
case 3:
w = 80;
h = 80;
break;
case 4:
w = 120;
h = 24;
break;
case 5:
w = 120;
h = 40;
break;
case 6:
w = 120;
h = 60;
break;
case 7:
w = 120;
h = 80;
break;
case 8:
w = 120;
h = 120;
break;
}
}
if ((w > 0) && (h > 0))
{
termio_grid_size_set(obj, w, h);
}
}
return EINA_TRUE;
}
return EINA_FALSE;