[Xfce4-commits] [apps/xfce4-terminal] 01/01: Allow scales even more smaller and even more larger than the usual Pango ranges, making it equal with gnome-terminal settings.

noreply at xfce.org noreply at xfce.org
Tue Jul 26 12:32:55 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit bda2bb208fdf5c0f684b81be38d9d06ecf26ca44
Author: poma <poma at gmail.com>
Date:   Tue Jul 26 05:25:58 2016 +0200

    Allow scales even more smaller and even more larger than the usual Pango ranges, making it equal with gnome-terminal settings.
    
    Signed-off-by: Igor <f2404 at yandex.ru>
---
 doc/xfce4-terminal.1.xml    |  4 ++--
 terminal/terminal-options.h | 28 +++++++++++++++++-----------
 terminal/terminal-screen.c  | 22 ++++++++++++++--------
 3 files changed, 33 insertions(+), 21 deletions(-)

diff --git a/doc/xfce4-terminal.1.xml b/doc/xfce4-terminal.1.xml
index 4f9d914..62bf0b1 100644
--- a/doc/xfce4-terminal.1.xml
+++ b/doc/xfce4-terminal.1.xml
@@ -472,8 +472,8 @@
           <listitem>
             <para>
               Set the zoom level: the font size will be multiplied by this level. The range
-              is from -4 to 4, default is 0. Each step multiplies the size by 1.2, i.e.
-              level 4 is 2.0736 (1.2^4) times larger than the default size.
+              is from -7 to 7, default is 0. Each step multiplies the size by 1.2, i.e.
+              level 7 is 3.5831808 (1.2^7) times larger than the default size.
             </para>
           </listitem>
         </varlistentry>
diff --git a/terminal/terminal-options.h b/terminal/terminal-options.h
index 9a540f5..e426bf4 100644
--- a/terminal/terminal-options.h
+++ b/terminal/terminal-options.h
@@ -38,17 +38,23 @@ enum _TerminalVisibility
 
 enum _TerminalZoomLevel
 {
-  TERMINAL_ZOOM_LEVEL_XXX_SMALL = -4,
-  TERMINAL_ZOOM_LEVEL_XX_SMALL  = -3,
-  TERMINAL_ZOOM_LEVEL_X_SMALL   = -2,
-  TERMINAL_ZOOM_LEVEL_SMALL     = -1,
-  TERMINAL_ZOOM_LEVEL_MEDIUM    = 0,
-  TERMINAL_ZOOM_LEVEL_LARGE     = +1,
-  TERMINAL_ZOOM_LEVEL_X_LARGE   = +2,
-  TERMINAL_ZOOM_LEVEL_XX_LARGE  = +3,
-  TERMINAL_ZOOM_LEVEL_XXX_LARGE = +4,
-  TERMINAL_ZOOM_LEVEL_MINIMUM   = TERMINAL_ZOOM_LEVEL_XXX_SMALL,
-  TERMINAL_ZOOM_LEVEL_MAXIMUM   = TERMINAL_ZOOM_LEVEL_XXX_LARGE,
+  TERMINAL_ZOOM_LEVEL_XXXXXX_SMALL = -7,
+  TERMINAL_ZOOM_LEVEL_XXXXX_SMALL  = -6,
+  TERMINAL_ZOOM_LEVEL_XXXX_SMALL   = -5,
+  TERMINAL_ZOOM_LEVEL_XXX_SMALL    = -4,
+  TERMINAL_ZOOM_LEVEL_XX_SMALL     = -3,
+  TERMINAL_ZOOM_LEVEL_X_SMALL      = -2,
+  TERMINAL_ZOOM_LEVEL_SMALL        = -1,
+  TERMINAL_ZOOM_LEVEL_MEDIUM       = 0,
+  TERMINAL_ZOOM_LEVEL_LARGE        = +1,
+  TERMINAL_ZOOM_LEVEL_X_LARGE      = +2,
+  TERMINAL_ZOOM_LEVEL_XX_LARGE     = +3,
+  TERMINAL_ZOOM_LEVEL_XXX_LARGE    = +4,
+  TERMINAL_ZOOM_LEVEL_XXXX_LARGE   = +5,
+  TERMINAL_ZOOM_LEVEL_XXXXX_LARGE  = +6,
+  TERMINAL_ZOOM_LEVEL_XXXXXX_LARGE = +7,
+  TERMINAL_ZOOM_LEVEL_MINIMUM   = TERMINAL_ZOOM_LEVEL_XXXXXX_SMALL,
+  TERMINAL_ZOOM_LEVEL_MAXIMUM   = TERMINAL_ZOOM_LEVEL_XXXXXX_LARGE,
   TERMINAL_ZOOM_LEVEL_DEFAULT   = TERMINAL_ZOOM_LEVEL_MEDIUM,
 };
 
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 5b2aabe..b8d6f10 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1512,14 +1512,20 @@ gchar* terminal_screen_zoom_font (TerminalScreen *screen,
 
   switch (zoom)
    {
-     case TERMINAL_ZOOM_LEVEL_XXX_SMALL: scale = PANGO_SCALE_XX_SMALL/1.2; break;
-     case TERMINAL_ZOOM_LEVEL_XX_SMALL:  scale = PANGO_SCALE_XX_SMALL;     break;
-     case TERMINAL_ZOOM_LEVEL_X_SMALL:   scale = PANGO_SCALE_X_SMALL;      break;
-     case TERMINAL_ZOOM_LEVEL_SMALL:     scale = PANGO_SCALE_SMALL;        break;
-     case TERMINAL_ZOOM_LEVEL_LARGE:     scale = PANGO_SCALE_LARGE;        break;
-     case TERMINAL_ZOOM_LEVEL_X_LARGE:   scale = PANGO_SCALE_X_LARGE;      break;
-     case TERMINAL_ZOOM_LEVEL_XX_LARGE:  scale = PANGO_SCALE_XX_LARGE;     break;
-     case TERMINAL_ZOOM_LEVEL_XXX_LARGE: scale = PANGO_SCALE_XX_LARGE*1.2; break;
+     case TERMINAL_ZOOM_LEVEL_XXXXXX_SMALL: scale = PANGO_SCALE_XX_SMALL/1.2/1.2/1.2/1.2; break;
+     case TERMINAL_ZOOM_LEVEL_XXXXX_SMALL:  scale = PANGO_SCALE_XX_SMALL/1.2/1.2/1.2;     break;
+     case TERMINAL_ZOOM_LEVEL_XXXX_SMALL:   scale = PANGO_SCALE_XX_SMALL/1.2/1.2;         break;
+     case TERMINAL_ZOOM_LEVEL_XXX_SMALL:    scale = PANGO_SCALE_XX_SMALL/1.2;             break;
+     case TERMINAL_ZOOM_LEVEL_XX_SMALL:     scale = PANGO_SCALE_XX_SMALL;                 break;
+     case TERMINAL_ZOOM_LEVEL_X_SMALL:      scale = PANGO_SCALE_X_SMALL;                  break;
+     case TERMINAL_ZOOM_LEVEL_SMALL:        scale = PANGO_SCALE_SMALL;                    break;
+     case TERMINAL_ZOOM_LEVEL_LARGE:        scale = PANGO_SCALE_LARGE;                    break;
+     case TERMINAL_ZOOM_LEVEL_X_LARGE:      scale = PANGO_SCALE_X_LARGE;                  break;
+     case TERMINAL_ZOOM_LEVEL_XX_LARGE:     scale = PANGO_SCALE_XX_LARGE;                 break;
+     case TERMINAL_ZOOM_LEVEL_XXX_LARGE:    scale = PANGO_SCALE_XX_LARGE*1.2;             break;
+     case TERMINAL_ZOOM_LEVEL_XXXX_LARGE:   scale = PANGO_SCALE_XX_LARGE*1.2*1.2;         break;
+     case TERMINAL_ZOOM_LEVEL_XXXXX_LARGE:  scale = PANGO_SCALE_XX_LARGE*1.2*1.2*1.2;     break;
+     case TERMINAL_ZOOM_LEVEL_XXXXXX_LARGE: scale = PANGO_SCALE_XX_LARGE*1.2*1.2*1.2*1.2; break;
      default:
        return font_name;
    }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list