billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=033840c4c4e2f59095fe040e32d6dc1831cf9748

commit 033840c4c4e2f59095fe040e32d6dc1831cf9748
Author: Boris Faure <[email protected]>
Date:   Sat Feb 15 17:31:10 2020 +0100

    main: add --scale option to set scale factor
    
    Useful for my tests :)
---
 man/terminology.1 |  7 ++++++-
 src/bin/main.c    | 11 +++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/man/terminology.1 b/man/terminology.1
index 868961d..6617a5e 100644
--- a/man/terminology.1
+++ b/man/terminology.1
@@ -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.
 .
diff --git a/src/bin/main.c b/src/bin/main.c
index 49f904a..0b4f4c2 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -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;
 

-- 


Reply via email to