Ticket #102: 0003-2010-03-25-added-ability-to-slide-from-bottom-or-top.patch

File 0003-2010-03-25-added-ability-to-slide-from-bottom-or-top.patch, 3.4 KB (added by urys, 2 years ago)

git format-patch

  • data/guake.schemas

    From c7a56e2707c9957b1497d412b518c33ad270070f Mon Sep 17 00:00:00 2001
    From: urys <irychtar@gmail.com>
    Date: Thu, 25 Mar 2010 18:34:41 +0100
    Subject: [PATCH 3/3] 2010-03-25 added ability to slide from bottom or top
    
    ---
     data/guake.schemas      |   13 +++++++++++++
     src/guake.py            |    9 ++++++++-
     src/guake_globals.py.in |    3 ++-
     3 files changed, 23 insertions(+), 2 deletions(-)
    
    diff --git a/data/guake.schemas b/data/guake.schemas
    index da82d34..f8f811b 100644
    a b  
    144144            </locale> 
    145145        </schema> 
    146146 
     147        <schema> 
     148            <key>/schemas/apps/guake/general/window_valignment</key> 
     149            <applyto>/apps/guake/general/window_valignment</applyto> 
     150            <owner>guake</owner> 
     151            <type>int</type> 
     152            <default>0</default> 
     153            <locale name="C"> 
     154            <short>Window vertical alignment.</short> 
     155            <long>Place Guake at: 
     156                  0: top, 1: bottom</long> 
     157            </locale> 
     158        </schema> 
     159 
    147160        <schema> 
    148161            <key>/schemas/apps/guake/general/use_scrollbar</key> 
    149162            <applyto>/apps/guake/general/use_scrollbar</applyto> 
  • src/guake.py

    diff --git a/src/guake.py b/src/guake.py
    index 08ade24..68c7f63 100644
    a b  
    4444from common import test_gconf, pixmapfile, gladefile, ShowableError, _ 
    4545from guake_globals import NAME, VERSION, LOCALE_DIR, KEY, GCONF_PATH, \ 
    4646    TERMINAL_MATCH_EXPRS, TERMINAL_MATCH_TAGS, \ 
    47     ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER 
     47    ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM 
    4848 
    4949pynotify.init('Guake!') 
    5050 
     
    788788        height = self.client.get_int(KEY('/general/window_height')) 
    789789        width = 100 
    790790        halignment = self.client.get_int(KEY('/general/window_halignment')) 
     791        valignment = self.client.get_int(KEY('/general/window_valignment')) 
    791792 
    792793        # get the rectangle just from the first/default monitor in the 
    793794        # future we might create a field to select which monitor you 
    794795        # wanna use 
    795796        window_rect = screen.get_monitor_geometry(0) 
    796797        total_width = window_rect.width 
     798        total_height = window_rect.height 
    797799        window_rect.height = window_rect.height * height / 100 
    798800        window_rect.width = window_rect.width * width / 100 
    799801 
     
    804806                window_rect.x = 0 
    805807            elif halignment == ALIGN_RIGHT: 
    806808                window_rect.x = total_width - window_rect.width 
     809 
    807810        window_rect.y = 0 
     811        if height < total_height: 
     812            if valignment == ALIGN_BOTTOM: 
     813                window_rect.y = (total_height - window_rect.height) 
     814 
    808815        return window_rect 
    809816 
    810817    def get_running_fg_processes(self): 
  • src/guake_globals.py.in

    diff --git a/src/guake_globals.py.in b/src/guake_globals.py.in
    index 002e55a..efcd504 100644
    a b  
    2222__all__ = [ 
    2323    'NAME', 'VERSION', 'IMAGE_DIR', 'GLADE_DIR', 'LOCALE_DIR', 
    2424    'GCONF_PATH', 'KEY', 'TERMINAL_MATCH_EXPRS', 'TERMINAL_MATCH_TAGS', 
    25     'ALIGN_CENTER', 'ALIGN_RIGHT', 'ALIGN_LEFT', 
     25    'ALIGN_CENTER', 'ALIGN_RIGHT', 'ALIGN_LEFT', 'ALIGN_TOP', 'ALIGN_BOTTOM' 
    2626    ] 
    2727 
    2828NAME = 'guake' 
     
    5656 
    5757TERMINAL_MATCH_TAGS = 'schema', 'http', 'email' 
    5858ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT = range(3) 
     59ALIGN_TOP, ALIGN_BOTTOM = range(2)