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
|
|
| 144 | 144 | </locale> |
| 145 | 145 | </schema> |
| 146 | 146 | |
| | 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 | |
| 147 | 160 | <schema> |
| 148 | 161 | <key>/schemas/apps/guake/general/use_scrollbar</key> |
| 149 | 162 | <applyto>/apps/guake/general/use_scrollbar</applyto> |
diff --git a/src/guake.py b/src/guake.py
index 08ade24..68c7f63 100644
|
a
|
b
|
|
| 44 | 44 | from common import test_gconf, pixmapfile, gladefile, ShowableError, _ |
| 45 | 45 | from guake_globals import NAME, VERSION, LOCALE_DIR, KEY, GCONF_PATH, \ |
| 46 | 46 | TERMINAL_MATCH_EXPRS, TERMINAL_MATCH_TAGS, \ |
| 47 | | ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER |
| | 47 | ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM |
| 48 | 48 | |
| 49 | 49 | pynotify.init('Guake!') |
| 50 | 50 | |
| … |
… |
|
| 788 | 788 | height = self.client.get_int(KEY('/general/window_height')) |
| 789 | 789 | width = 100 |
| 790 | 790 | halignment = self.client.get_int(KEY('/general/window_halignment')) |
| | 791 | valignment = self.client.get_int(KEY('/general/window_valignment')) |
| 791 | 792 | |
| 792 | 793 | # get the rectangle just from the first/default monitor in the |
| 793 | 794 | # future we might create a field to select which monitor you |
| 794 | 795 | # wanna use |
| 795 | 796 | window_rect = screen.get_monitor_geometry(0) |
| 796 | 797 | total_width = window_rect.width |
| | 798 | total_height = window_rect.height |
| 797 | 799 | window_rect.height = window_rect.height * height / 100 |
| 798 | 800 | window_rect.width = window_rect.width * width / 100 |
| 799 | 801 | |
| … |
… |
|
| 804 | 806 | window_rect.x = 0 |
| 805 | 807 | elif halignment == ALIGN_RIGHT: |
| 806 | 808 | window_rect.x = total_width - window_rect.width |
| | 809 | |
| 807 | 810 | window_rect.y = 0 |
| | 811 | if height < total_height: |
| | 812 | if valignment == ALIGN_BOTTOM: |
| | 813 | window_rect.y = (total_height - window_rect.height) |
| | 814 | |
| 808 | 815 | return window_rect |
| 809 | 816 | |
| 810 | 817 | def get_running_fg_processes(self): |
diff --git a/src/guake_globals.py.in b/src/guake_globals.py.in
index 002e55a..efcd504 100644
|
a
|
b
|
|
| 22 | 22 | __all__ = [ |
| 23 | 23 | 'NAME', 'VERSION', 'IMAGE_DIR', 'GLADE_DIR', 'LOCALE_DIR', |
| 24 | 24 | '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' |
| 26 | 26 | ] |
| 27 | 27 | |
| 28 | 28 | NAME = 'guake' |
| … |
… |
|
| 56 | 56 | |
| 57 | 57 | TERMINAL_MATCH_TAGS = 'schema', 'http', 'email' |
| 58 | 58 | ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT = range(3) |
| | 59 | ALIGN_TOP, ALIGN_BOTTOM = range(2) |