aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-08-22 10:57:51 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-08-22 10:57:51 +0000
commitd859563fb7d076edffef62d065cb8e9702692a17 (patch)
tree372c0afe566a3e413d597e652137ff29db604adc
parentdocument g command. (diff)
downloadterminology-d859563fb7d076edffef62d065cb8e9702692a17.tar.gz
add some shortcuts to "g" termcmd.
SVN revision: 75539
-rw-r--r--README5
-rw-r--r--src/bin/termcmd.c48
2 files changed, 47 insertions, 6 deletions
diff --git a/README b/README
index b46cb4e..c2bd568 100644
--- a/README
+++ b/README
@@ -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:
diff --git a/src/bin/termcmd.c b/src/bin/termcmd.c
index 4489a5b..97c7952 100644
--- a/src/bin/termcmd.c
+++ b/src/bin/termcmd.c
@@ -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;
-
- if (sscanf(cmd, "g%ix%i", &w, &h) == 2)
+ int r = sscanf(cmd, "g%ix%i", &w, &h);
+
+ if (r == 1)
{
- if ((w > 0) && (h > 0))
+ switch (w)
{
- termio_grid_size_set(obj, w, h);
+ 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;