main: add --scale option to set scale factor

Useful for my tests :)
This commit is contained in:
Boris Faure 2020-02-15 17:31:10 +01:00
parent daf5e03406
commit 033840c4c4
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
2 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,5 @@
.\" Manpage for Terminology
.TH TERMINOLOGY 1 "Nov 16, 2019" "1.6.0" "Terminology man page"
.TH TERMINOLOGY 1 "Feb 15, 2020" "1.7.0" "Terminology man page"
.SH NAME
Terminology \- Terminal Emulator written with EFL (Enlightenment Foundation Libraries).
.SH SYNOPSIS
@ -167,6 +167,11 @@ Do not display the wizard on start up.
Type: BOOL.
.
.TP
.B \-\-scale=SCALE
Scaling factor to use on the UI.
Type: DOUBLE.
.
.TP
.B \-V, \-\-version
Show program version.
.

View File

@ -502,6 +502,8 @@ static Ecore_Getopt options = {
gettext_noop("Force single executable if multi-instance is enabled.")),
ECORE_GETOPT_STORE_TRUE('2', "256color",
gettext_noop("Set TERM to 'xterm-256color' instead of 'xterm'.")),
ECORE_GETOPT_STORE_DOUBLE('\0', "scale",
gettext_noop("Set scaling factor.")),
ECORE_GETOPT_STORE_BOOL('\0', "active-links",
gettext_noop("Highlight links.")),
ECORE_GETOPT_STORE_BOOL('\0', "no-wizard",
@ -801,6 +803,7 @@ elm_main(int argc, char **argv)
Eina_Bool single = EINA_FALSE;
Eina_Bool no_wizard = EINA_FALSE;
Eina_Bool cmd_options = EINA_FALSE;
double scale = NAN; /* unset */
Ipc_Instance instance = {
.login_shell = 0xff, /* unset */
.active_links = 0xff, /* unset */
@ -838,6 +841,7 @@ elm_main(int argc, char **argv)
ECORE_GETOPT_VALUE_BOOL(instance.hold),
ECORE_GETOPT_VALUE_BOOL(single),
ECORE_GETOPT_VALUE_BOOL(instance.xterm_256color),
ECORE_GETOPT_VALUE_DOUBLE(scale),
ECORE_GETOPT_VALUE_BOOL(instance.active_links),
ECORE_GETOPT_VALUE_BOOL(no_wizard),
@ -911,6 +915,13 @@ elm_main(int argc, char **argv)
goto end;
}
if (!isnan(scale))
{
elm_config_scale_set(scale);
elm_config_all_flush();
instance.config->temporary = EINA_TRUE;
}
if (no_wizard)
need_scale_wizard = EINA_FALSE;