From c28c7a27f01729302e284d907eaa526733ab73de Mon Sep 17 00:00:00 2001
From: Stefano Tortarolo <stefano.tortarolo@gmail.com>
Date: Mon, 20 Jul 2009 19:49:21 +0200
Subject: [PATCH 3/3] Allow window alignment to be customized
---
data/guake.schemas | 13 +++
data/prefs.glade | 261 +++++++++++++++++++++++++++++++----------------
src/guake.py | 27 +++++-
src/guake_globals.py.in | 2 +
src/prefs.py | 29 +++++-
5 files changed, 241 insertions(+), 91 deletions(-)
diff --git a/data/guake.schemas b/data/guake.schemas
index 6273c7c..b6b27b6 100644
|
a
|
b
|
|
| 118 | 118 | </locale> |
| 119 | 119 | </schema> |
| 120 | 120 | |
| | 121 | <schema> |
| | 122 | <key>/schemas/apps/guake/general/window_halignment</key> |
| | 123 | <applyto>/apps/guake/general/window_halignment</applyto> |
| | 124 | <owner>guake</owner> |
| | 125 | <type>int</type> |
| | 126 | <default>0</default> |
| | 127 | <locale name="C"> |
| | 128 | <short>Window horizontal alignment.</short> |
| | 129 | <long>Place Guake at: |
| | 130 | 0: center, 1: left, 2: right</long> |
| | 131 | </locale> |
| | 132 | </schema> |
| | 133 | |
| 121 | 134 | <schema> |
| 122 | 135 | <key>/schemas/apps/guake/general/use_scrollbar</key> |
| 123 | 136 | <applyto>/apps/guake/general/use_scrollbar</applyto> |
diff --git a/data/prefs.glade b/data/prefs.glade
index 798585f..01761c1 100644
|
a
|
b
|
|
| 1 | 1 | <?xml version="1.0"?> |
| 2 | 2 | <glade-interface> |
| | 3 | <!-- interface-requires gtk+ 2.16 --> |
| | 4 | <!-- interface-naming-policy toplevel-contextual --> |
| 3 | 5 | <widget class="GtkWindow" id="config-window"> |
| 4 | | <property name="default_width">460</property> |
| 5 | 6 | <property name="title" translatable="yes">Guake Preferences</property> |
| 6 | 7 | <property name="resizable">False</property> |
| 7 | | <property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property> |
| | 8 | <property name="window_position">center-always</property> |
| | 9 | <property name="default_width">460</property> |
| 8 | 10 | <property name="urgency_hint">True</property> |
| 9 | 11 | <child> |
| 10 | 12 | <widget class="GtkVBox" id="vbox4"> |
| … |
… |
|
| 14 | 16 | <property name="visible">True</property> |
| 15 | 17 | <child> |
| 16 | 18 | <widget class="GtkEventBox" id="eventbox-title"> |
| 17 | | <property name="visible">True</property> |
| 18 | 19 | <property name="height_request">70</property> |
| | 20 | <property name="visible">True</property> |
| 19 | 21 | <child> |
| 20 | 22 | <widget class="GtkHBox" id="hbox29"> |
| 21 | 23 | <property name="visible">True</property> |
| … |
… |
|
| 30 | 32 | <packing> |
| 31 | 33 | <property name="expand">False</property> |
| 32 | 34 | <property name="fill">False</property> |
| | 35 | <property name="position">0</property> |
| 33 | 36 | </packing> |
| 34 | 37 | </child> |
| 35 | 38 | <child> |
| … |
… |
|
| 43 | 46 | <property name="label" translatable="yes"><span size="18000" color="black"><b>Guake properties</b></span></property> |
| 44 | 47 | <property name="use_markup">True</property> |
| 45 | 48 | </widget> |
| | 49 | <packing> |
| | 50 | <property name="position">0</property> |
| | 51 | </packing> |
| 46 | 52 | </child> |
| 47 | 53 | <child> |
| 48 | 54 | <widget class="GtkLabel" id="label4825"> |
| … |
… |
|
| 66 | 72 | </widget> |
| 67 | 73 | <packing> |
| 68 | 74 | <property name="expand">False</property> |
| | 75 | <property name="position">0</property> |
| 69 | 76 | </packing> |
| 70 | 77 | </child> |
| 71 | 78 | <child> |
| … |
… |
|
| 81 | 88 | <packing> |
| 82 | 89 | <property name="expand">False</property> |
| 83 | 90 | <property name="fill">False</property> |
| | 91 | <property name="position">0</property> |
| 84 | 92 | </packing> |
| 85 | 93 | </child> |
| 86 | 94 | <child> |
| … |
… |
|
| 100 | 108 | <widget class="GtkFrame" id="frame5"> |
| 101 | 109 | <property name="visible">True</property> |
| 102 | 110 | <property name="label_xalign">0</property> |
| 103 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 111 | <property name="shadow_type">none</property> |
| 104 | 112 | <child> |
| 105 | 113 | <widget class="GtkAlignment" id="alignment5"> |
| 106 | 114 | <property name="visible">True</property> |
| … |
… |
|
| 124 | 132 | <packing> |
| 125 | 133 | <property name="expand">False</property> |
| 126 | 134 | <property name="fill">False</property> |
| | 135 | <property name="position">0</property> |
| 127 | 136 | </packing> |
| 128 | 137 | </child> |
| 129 | 138 | <child> |
| … |
… |
|
| 137 | 146 | </packing> |
| 138 | 147 | </child> |
| 139 | 148 | </widget> |
| | 149 | <packing> |
| | 150 | <property name="position">0</property> |
| | 151 | </packing> |
| 140 | 152 | </child> |
| 141 | 153 | <child> |
| 142 | 154 | <widget class="GtkCheckButton" id="use_login_shell"> |
| | 155 | <property name="label" translatable="yes">_Run command as a login shell</property> |
| 143 | 156 | <property name="visible">True</property> |
| 144 | 157 | <property name="can_focus">True</property> |
| | 158 | <property name="receives_default">False</property> |
| 145 | 159 | <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> |
| 146 | | <property name="label" translatable="yes">_Run command as a login shell</property> |
| 147 | 160 | <property name="use_underline">True</property> |
| 148 | | <property name="response_id">0</property> |
| 149 | 161 | <property name="draw_indicator">True</property> |
| 150 | 162 | <signal name="toggled" handler="on_use_login_shell_toggled"/> |
| 151 | 163 | </widget> |
| … |
… |
|
| 169 | 181 | </packing> |
| 170 | 182 | </child> |
| 171 | 183 | </widget> |
| | 184 | <packing> |
| | 185 | <property name="position">0</property> |
| | 186 | </packing> |
| 172 | 187 | </child> |
| 173 | 188 | <child> |
| 174 | 189 | <widget class="GtkFrame" id="frame7"> |
| 175 | 190 | <property name="visible">True</property> |
| 176 | 191 | <property name="label_xalign">0</property> |
| 177 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 192 | <property name="shadow_type">none</property> |
| 178 | 193 | <child> |
| 179 | 194 | <widget class="GtkAlignment" id="alignment8"> |
| 180 | 195 | <property name="visible">True</property> |
| … |
… |
|
| 186 | 201 | <property name="homogeneous">True</property> |
| 187 | 202 | <child> |
| 188 | 203 | <widget class="GtkCheckButton" id="use_trayicon"> |
| | 204 | <property name="label" translatable="yes">Show tray icon</property> |
| 189 | 205 | <property name="visible">True</property> |
| 190 | 206 | <property name="can_focus">True</property> |
| | 207 | <property name="receives_default">False</property> |
| 191 | 208 | <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> |
| 192 | | <property name="label" translatable="yes">Show tray icon</property> |
| 193 | | <property name="response_id">0</property> |
| 194 | 209 | <property name="draw_indicator">True</property> |
| 195 | 210 | <signal name="toggled" handler="on_use_trayicon_toggled"/> |
| 196 | 211 | </widget> |
| | 212 | <packing> |
| | 213 | <property name="position">0</property> |
| | 214 | </packing> |
| 197 | 215 | </child> |
| 198 | 216 | <child> |
| 199 | 217 | <widget class="GtkCheckButton" id="use_popup"> |
| | 218 | <property name="label" translatable="yes">Enable popup notifications on startup</property> |
| 200 | 219 | <property name="visible">True</property> |
| 201 | 220 | <property name="can_focus">True</property> |
| | 221 | <property name="receives_default">False</property> |
| 202 | 222 | <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> |
| 203 | | <property name="label" translatable="yes">Enable popup notifications on startup</property> |
| 204 | | <property name="response_id">0</property> |
| 205 | 223 | <property name="draw_indicator">True</property> |
| 206 | 224 | <signal name="toggled" handler="on_use_popup_toggled"/> |
| 207 | 225 | </widget> |
| … |
… |
|
| 233 | 251 | <widget class="GtkFrame" id="frame4"> |
| 234 | 252 | <property name="visible">True</property> |
| 235 | 253 | <property name="label_xalign">0</property> |
| 236 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 254 | <property name="shadow_type">none</property> |
| 237 | 255 | <child> |
| 238 | 256 | <widget class="GtkAlignment" id="alignment4"> |
| 239 | 257 | <property name="visible">True</property> |
| … |
… |
|
| 245 | 263 | <property name="homogeneous">True</property> |
| 246 | 264 | <child> |
| 247 | 265 | <widget class="GtkCheckButton" id="window_ontop"> |
| 248 | | <property name="visible">True</property> |
| 249 | 266 | <property name="label" translatable="yes">Stay on top</property> |
| | 267 | <property name="visible">True</property> |
| | 268 | <property name="can_focus">False</property> |
| | 269 | <property name="receives_default">False</property> |
| 250 | 270 | <property name="use_underline">True</property> |
| 251 | 271 | <property name="focus_on_click">False</property> |
| 252 | | <property name="response_id">0</property> |
| 253 | 272 | <property name="active">True</property> |
| 254 | 273 | <property name="draw_indicator">True</property> |
| 255 | 274 | <signal name="toggled" handler="on_window_ontop_toggled"/> |
| 256 | 275 | </widget> |
| 257 | 276 | <packing> |
| 258 | 277 | <property name="expand">False</property> |
| | 278 | <property name="position">0</property> |
| 259 | 279 | </packing> |
| 260 | 280 | </child> |
| 261 | 281 | <child> |
| 262 | 282 | <widget class="GtkCheckButton" id="window_losefocus"> |
| | 283 | <property name="label" translatable="yes">Hide on lose focus</property> |
| 263 | 284 | <property name="visible">True</property> |
| 264 | 285 | <property name="can_focus">True</property> |
| 265 | | <property name="label" translatable="yes">Hide on lose focus</property> |
| | 286 | <property name="receives_default">False</property> |
| 266 | 287 | <property name="use_underline">True</property> |
| 267 | | <property name="response_id">0</property> |
| 268 | 288 | <property name="active">True</property> |
| 269 | 289 | <property name="draw_indicator">True</property> |
| 270 | 290 | <signal name="toggled" handler="on_window_losefocus_toggled"/> |
| … |
… |
|
| 277 | 297 | </child> |
| 278 | 298 | <child> |
| 279 | 299 | <widget class="GtkCheckButton" id="window_tabbar"> |
| | 300 | <property name="label" translatable="yes">Show tab bar</property> |
| 280 | 301 | <property name="visible">True</property> |
| 281 | 302 | <property name="can_focus">True</property> |
| | 303 | <property name="receives_default">False</property> |
| 282 | 304 | <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> |
| 283 | | <property name="label" translatable="yes">Show tab bar</property> |
| 284 | | <property name="response_id">0</property> |
| 285 | 305 | <property name="draw_indicator">True</property> |
| 286 | 306 | <signal name="toggled" handler="on_window_tabbar_toggled"/> |
| 287 | 307 | </widget> |
| … |
… |
|
| 313 | 333 | <widget class="GtkFrame" id="frame11"> |
| 314 | 334 | <property name="visible">True</property> |
| 315 | 335 | <property name="label_xalign">0</property> |
| 316 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 336 | <property name="shadow_type">none</property> |
| 317 | 337 | <child> |
| 318 | 338 | <widget class="GtkAlignment" id="alignment11"> |
| 319 | 339 | <property name="visible">True</property> |
| … |
… |
|
| 322 | 342 | <widget class="GtkHScale" id="window_height"> |
| 323 | 343 | <property name="visible">True</property> |
| 324 | 344 | <property name="can_focus">True</property> |
| 325 | | <property name="update_policy">GTK_UPDATE_DISCONTINUOUS</property> |
| | 345 | <property name="update_policy">discontinuous</property> |
| 326 | 346 | <property name="adjustment">50 10 110 10 10 10</property> |
| 327 | 347 | <property name="digits">0</property> |
| 328 | 348 | <property name="draw_value">False</property> |
| 329 | | <property name="value_pos">GTK_POS_RIGHT</property> |
| | 349 | <property name="value_pos">right</property> |
| 330 | 350 | <signal name="value_changed" handler="on_window_height_value_changed"/> |
| 331 | 351 | </widget> |
| 332 | 352 | </child> |
| … |
… |
|
| 352 | 372 | <widget class="GtkFrame" id="frame12"> |
| 353 | 373 | <property name="visible">True</property> |
| 354 | 374 | <property name="label_xalign">0</property> |
| 355 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 375 | <property name="shadow_type">none</property> |
| 356 | 376 | <child> |
| 357 | 377 | <widget class="GtkAlignment" id="alignment12"> |
| 358 | 378 | <property name="visible">True</property> |
| … |
… |
|
| 361 | 381 | <widget class="GtkHScale" id="window_width"> |
| 362 | 382 | <property name="visible">True</property> |
| 363 | 383 | <property name="can_focus">True</property> |
| 364 | | <property name="update_policy">GTK_UPDATE_DISCONTINUOUS</property> |
| | 384 | <property name="update_policy">discontinuous</property> |
| 365 | 385 | <property name="adjustment">50 10 110 10 10 10</property> |
| 366 | 386 | <property name="digits">0</property> |
| 367 | 387 | <property name="draw_value">False</property> |
| 368 | | <property name="value_pos">GTK_POS_RIGHT</property> |
| | 388 | <property name="value_pos">right</property> |
| 369 | 389 | <signal name="value_changed" handler="on_window_width_value_changed"/> |
| 370 | 390 | </widget> |
| 371 | 391 | </child> |
| … |
… |
|
| 387 | 407 | <property name="position">4</property> |
| 388 | 408 | </packing> |
| 389 | 409 | </child> |
| | 410 | <child> |
| | 411 | <widget class="GtkFrame" id="frame13"> |
| | 412 | <property name="visible">True</property> |
| | 413 | <property name="label_xalign">0</property> |
| | 414 | <property name="shadow_type">none</property> |
| | 415 | <child> |
| | 416 | <widget class="GtkAlignment" id="alignment13"> |
| | 417 | <property name="visible">True</property> |
| | 418 | <property name="left_padding">12</property> |
| | 419 | <child> |
| | 420 | <widget class="GtkComboBox" id="window_halignment"> |
| | 421 | <property name="visible">True</property> |
| | 422 | <property name="items" translatable="yes"></property> |
| | 423 | <signal name="changed" handler="on_window_halignment_changed"/> |
| | 424 | </widget> |
| | 425 | </child> |
| | 426 | </widget> |
| | 427 | </child> |
| | 428 | <child> |
| | 429 | <widget class="GtkLabel" id="label26"> |
| | 430 | <property name="visible">True</property> |
| | 431 | <property name="ypad">6</property> |
| | 432 | <property name="label" translatable="yes"><b>Main Window horizontal alignment</b></property> |
| | 433 | <property name="use_markup">True</property> |
| | 434 | </widget> |
| | 435 | <packing> |
| | 436 | <property name="type">label_item</property> |
| | 437 | </packing> |
| | 438 | </child> |
| | 439 | </widget> |
| | 440 | <packing> |
| | 441 | <property name="position">5</property> |
| | 442 | </packing> |
| | 443 | </child> |
| 390 | 444 | </widget> |
| 391 | 445 | </child> |
| 392 | 446 | <child> |
| … |
… |
|
| 407 | 461 | <widget class="GtkFrame" id="frame6"> |
| 408 | 462 | <property name="visible">True</property> |
| 409 | 463 | <property name="label_xalign">0</property> |
| 410 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 464 | <property name="shadow_type">none</property> |
| 411 | 465 | <child> |
| 412 | 466 | <widget class="GtkAlignment" id="alignment6"> |
| 413 | 467 | <property name="visible">True</property> |
| … |
… |
|
| 419 | 473 | <property name="homogeneous">True</property> |
| 420 | 474 | <child> |
| 421 | 475 | <widget class="GtkCheckButton" id="use_scrollbar"> |
| | 476 | <property name="label" translatable="yes">Show scrollbar</property> |
| 422 | 477 | <property name="visible">True</property> |
| 423 | 478 | <property name="can_focus">True</property> |
| | 479 | <property name="receives_default">False</property> |
| 424 | 480 | <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> |
| 425 | | <property name="label" translatable="yes">Show scrollbar</property> |
| 426 | | <property name="response_id">0</property> |
| 427 | 481 | <property name="draw_indicator">True</property> |
| 428 | 482 | <signal name="toggled" handler="on_use_scrollbar_toggled"/> |
| 429 | 483 | </widget> |
| | 484 | <packing> |
| | 485 | <property name="position">0</property> |
| | 486 | </packing> |
| 430 | 487 | </child> |
| 431 | 488 | <child> |
| 432 | 489 | <widget class="GtkHBox" id="hbox2"> |
| … |
… |
|
| 442 | 499 | <packing> |
| 443 | 500 | <property name="expand">False</property> |
| 444 | 501 | <property name="fill">False</property> |
| | 502 | <property name="position">0</property> |
| 445 | 503 | </packing> |
| 446 | 504 | </child> |
| 447 | 505 | <child> |
| … |
… |
|
| 482 | 540 | </widget> |
| 483 | 541 | <packing> |
| 484 | 542 | <property name="expand">False</property> |
| | 543 | <property name="position">0</property> |
| 485 | 544 | </packing> |
| 486 | 545 | </child> |
| 487 | 546 | <child> |
| 488 | 547 | <widget class="GtkFrame" id="frame8"> |
| 489 | 548 | <property name="visible">True</property> |
| 490 | 549 | <property name="label_xalign">0</property> |
| 491 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 550 | <property name="shadow_type">none</property> |
| 492 | 551 | <child> |
| 493 | 552 | <widget class="GtkAlignment" id="alignment7"> |
| 494 | 553 | <property name="visible">True</property> |
| … |
… |
|
| 500 | 559 | <property name="homogeneous">True</property> |
| 501 | 560 | <child> |
| 502 | 561 | <widget class="GtkCheckButton" id="scroll_output"> |
| | 562 | <property name="label" translatable="yes">On output</property> |
| 503 | 563 | <property name="visible">True</property> |
| 504 | 564 | <property name="can_focus">True</property> |
| | 565 | <property name="receives_default">False</property> |
| 505 | 566 | <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> |
| 506 | | <property name="label" translatable="yes">On output</property> |
| 507 | | <property name="response_id">0</property> |
| 508 | 567 | <property name="draw_indicator">True</property> |
| 509 | 568 | <signal name="toggled" handler="on_scroll_output_toggled"/> |
| 510 | 569 | </widget> |
| | 570 | <packing> |
| | 571 | <property name="position">0</property> |
| | 572 | </packing> |
| 511 | 573 | </child> |
| 512 | 574 | <child> |
| 513 | 575 | <widget class="GtkCheckButton" id="scroll_keystroke"> |
| | 576 | <property name="label" translatable="yes">On key stroke</property> |
| 514 | 577 | <property name="visible">True</property> |
| 515 | 578 | <property name="can_focus">True</property> |
| | 579 | <property name="receives_default">False</property> |
| 516 | 580 | <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> |
| 517 | | <property name="label" translatable="yes">On key stroke</property> |
| 518 | | <property name="response_id">0</property> |
| 519 | 581 | <property name="draw_indicator">True</property> |
| 520 | 582 | <signal name="toggled" handler="on_scroll_keystroke_toggled"/> |
| 521 | 583 | </widget> |
| … |
… |
|
| 569 | 631 | <widget class="GtkFrame" id="frame1"> |
| 570 | 632 | <property name="visible">True</property> |
| 571 | 633 | <property name="label_xalign">0</property> |
| 572 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 634 | <property name="shadow_type">none</property> |
| 573 | 635 | <child> |
| 574 | 636 | <widget class="GtkAlignment" id="alignment1"> |
| 575 | 637 | <property name="visible">True</property> |
| … |
… |
|
| 580 | 642 | <property name="spacing">6</property> |
| 581 | 643 | <child> |
| 582 | 644 | <widget class="GtkCheckButton" id="use_default_font"> |
| | 645 | <property name="label" translatable="yes">Use system defaults</property> |
| 583 | 646 | <property name="visible">True</property> |
| 584 | 647 | <property name="can_focus">True</property> |
| 585 | | <property name="label" translatable="yes">Use system defaults</property> |
| 586 | | <property name="response_id">0</property> |
| | 648 | <property name="receives_default">False</property> |
| 587 | 649 | <property name="draw_indicator">True</property> |
| 588 | 650 | <signal name="toggled" handler="on_use_default_font_toggled"/> |
| 589 | 651 | <signal name="toggled" handler="toggle_style_sensitivity"/> |
| 590 | 652 | </widget> |
| | 653 | <packing> |
| | 654 | <property name="position">0</property> |
| | 655 | </packing> |
| 591 | 656 | </child> |
| 592 | 657 | <child> |
| 593 | 658 | <widget class="GtkHBox" id="hbox5"> |
| … |
… |
|
| 603 | 668 | <packing> |
| 604 | 669 | <property name="expand">False</property> |
| 605 | 670 | <property name="fill">False</property> |
| | 671 | <property name="position">0</property> |
| 606 | 672 | </packing> |
| 607 | 673 | </child> |
| 608 | 674 | <child> |
| 609 | 675 | <widget class="GtkFontButton" id="font_style"> |
| 610 | 676 | <property name="visible">True</property> |
| | 677 | <property name="can_focus">False</property> |
| | 678 | <property name="receives_default">False</property> |
| 611 | 679 | <property name="focus_on_click">False</property> |
| 612 | | <property name="response_id">0</property> |
| 613 | 680 | <property name="title" translatable="yes">Choose some font</property> |
| 614 | 681 | <signal name="font_set" handler="on_font_style_font_set"/> |
| 615 | 682 | </widget> |
| … |
… |
|
| 636 | 703 | <packing> |
| 637 | 704 | <property name="expand">False</property> |
| 638 | 705 | <property name="fill">False</property> |
| | 706 | <property name="position">0</property> |
| 639 | 707 | </packing> |
| 640 | 708 | </child> |
| 641 | 709 | <child> |
| 642 | 710 | <widget class="GtkColorButton" id="font_color"> |
| 643 | 711 | <property name="visible">True</property> |
| 644 | | <property name="response_id">0</property> |
| | 712 | <property name="can_focus">False</property> |
| | 713 | <property name="receives_default">False</property> |
| 645 | 714 | <property name="title" translatable="yes">Choose some color</property> |
| 646 | 715 | <signal name="color_set" handler="on_font_color_color_set"/> |
| 647 | 716 | </widget> |
| … |
… |
|
| 672 | 741 | </widget> |
| 673 | 742 | <packing> |
| 674 | 743 | <property name="expand">False</property> |
| | 744 | <property name="position">0</property> |
| 675 | 745 | </packing> |
| 676 | 746 | </child> |
| 677 | 747 | <child> |
| 678 | 748 | <widget class="GtkFrame" id="frame2"> |
| 679 | 749 | <property name="visible">True</property> |
| 680 | 750 | <property name="label_xalign">0</property> |
| 681 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 751 | <property name="shadow_type">none</property> |
| 682 | 752 | <child> |
| 683 | 753 | <widget class="GtkAlignment" id="alignment2"> |
| 684 | 754 | <property name="visible">True</property> |
| … |
… |
|
| 701 | 771 | <packing> |
| 702 | 772 | <property name="expand">False</property> |
| 703 | 773 | <property name="fill">False</property> |
| | 774 | <property name="position">0</property> |
| 704 | 775 | </packing> |
| 705 | 776 | </child> |
| 706 | 777 | <child> |
| 707 | 778 | <widget class="GtkColorButton" id="background_color"> |
| 708 | 779 | <property name="visible">True</property> |
| 709 | | <property name="response_id">0</property> |
| | 780 | <property name="can_focus">False</property> |
| | 781 | <property name="receives_default">False</property> |
| 710 | 782 | <property name="title" translatable="yes">Choose some color</property> |
| 711 | 783 | <signal name="color_set" handler="on_background_color_color_set"/> |
| 712 | 784 | </widget> |
| … |
… |
|
| 718 | 790 | <packing> |
| 719 | 791 | <property name="expand">False</property> |
| 720 | 792 | <property name="fill">False</property> |
| | 793 | <property name="position">0</property> |
| | 794 | </packing> |
| | 795 | </child> |
| | 796 | <child> |
| | 797 | <widget class="GtkHBox" id="hbox7"> |
| | 798 | <property name="visible">True</property> |
| | 799 | <child> |
| | 800 | <widget class="GtkLabel" id="labelx1"> |
| | 801 | <property name="width_request">140</property> |
| | 802 | <property name="visible">True</property> |
| | 803 | <property name="xalign">0</property> |
| | 804 | <property name="label" translatable="yes">Transparency:</property> |
| | 805 | <property name="use_markup">True</property> |
| | 806 | </widget> |
| | 807 | <packing> |
| | 808 | <property name="expand">False</property> |
| | 809 | <property name="fill">False</property> |
| | 810 | <property name="position">0</property> |
| | 811 | </packing> |
| | 812 | </child> |
| | 813 | <child> |
| | 814 | <widget class="GtkHScale" id="background_transparency"> |
| | 815 | <property name="visible">True</property> |
| | 816 | <property name="can_focus">True</property> |
| | 817 | <property name="adjustment">0 0 100 1 10 10</property> |
| | 818 | <property name="draw_value">False</property> |
| | 819 | <property name="value_pos">right</property> |
| | 820 | <signal name="value_changed" handler="on_transparency_value_changed"/> |
| | 821 | </widget> |
| | 822 | <packing> |
| | 823 | <property name="position">1</property> |
| | 824 | </packing> |
| | 825 | </child> |
| | 826 | </widget> |
| | 827 | <packing> |
| | 828 | <property name="expand">False</property> |
| | 829 | <property name="position">1</property> |
| 721 | 830 | </packing> |
| 722 | 831 | </child> |
| 723 | 832 | <child> |
| … |
… |
|
| 734 | 843 | <packing> |
| 735 | 844 | <property name="expand">False</property> |
| 736 | 845 | <property name="fill">False</property> |
| | 846 | <property name="position">0</property> |
| 737 | 847 | </packing> |
| 738 | 848 | </child> |
| 739 | 849 | <child> |
| … |
… |
|
| 745 | 855 | <property name="visible">True</property> |
| 746 | 856 | <signal name="selection_changed" handler="on_background_image_changed"/> |
| 747 | 857 | </widget> |
| | 858 | <packing> |
| | 859 | <property name="position">0</property> |
| | 860 | </packing> |
| 748 | 861 | </child> |
| 749 | 862 | <child> |
| 750 | 863 | <widget class="GtkButton" id="button2"> |
| 751 | 864 | <property name="visible">True</property> |
| 752 | 865 | <property name="can_focus">True</property> |
| 753 | 866 | <property name="receives_default">True</property> |
| 754 | | <property name="response_id">0</property> |
| 755 | 867 | <signal name="clicked" handler="clear_background_image"/> |
| 756 | 868 | <child> |
| 757 | 869 | <widget class="GtkImage" id="image1"> |
| 758 | 870 | <property name="visible">True</property> |
| 759 | 871 | <property name="stock">gtk-clear</property> |
| 760 | | <property name="icon_size">1</property> |
| | 872 | <property name="icon-size">1</property> |
| 761 | 873 | </widget> |
| 762 | 874 | </child> |
| 763 | 875 | </widget> |
| … |
… |
|
| 778 | 890 | <property name="position">2</property> |
| 779 | 891 | </packing> |
| 780 | 892 | </child> |
| 781 | | <child> |
| 782 | | <widget class="GtkHBox" id="hbox7"> |
| 783 | | <property name="visible">True</property> |
| 784 | | <child> |
| 785 | | <widget class="GtkLabel" id="labelx1"> |
| 786 | | <property name="width_request">140</property> |
| 787 | | <property name="visible">True</property> |
| 788 | | <property name="xalign">0</property> |
| 789 | | <property name="label" translatable="yes">Transparency:</property> |
| 790 | | <property name="use_markup">True</property> |
| 791 | | </widget> |
| 792 | | <packing> |
| 793 | | <property name="expand">False</property> |
| 794 | | <property name="fill">False</property> |
| 795 | | </packing> |
| 796 | | </child> |
| 797 | | <child> |
| 798 | | <widget class="GtkHScale" id="background_transparency"> |
| 799 | | <property name="visible">True</property> |
| 800 | | <property name="can_focus">True</property> |
| 801 | | <property name="adjustment">0 0 100 1 10 10</property> |
| 802 | | <property name="draw_value">False</property> |
| 803 | | <property name="value_pos">GTK_POS_RIGHT</property> |
| 804 | | <signal name="value_changed" handler="on_transparency_value_changed"/> |
| 805 | | </widget> |
| 806 | | <packing> |
| 807 | | <property name="position">1</property> |
| 808 | | </packing> |
| 809 | | </child> |
| 810 | | </widget> |
| 811 | | <packing> |
| 812 | | <property name="expand">False</property> |
| 813 | | <property name="position">1</property> |
| 814 | | </packing> |
| 815 | | </child> |
| 816 | 893 | </widget> |
| 817 | 894 | </child> |
| 818 | 895 | </widget> |
| … |
… |
|
| 859 | 936 | <widget class="GtkScrolledWindow" id="scrolledwindow1"> |
| 860 | 937 | <property name="visible">True</property> |
| 861 | 938 | <property name="can_focus">True</property> |
| 862 | | <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> |
| 863 | | <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> |
| 864 | | <property name="shadow_type">GTK_SHADOW_IN</property> |
| | 939 | <property name="hscrollbar_policy">automatic</property> |
| | 940 | <property name="vscrollbar_policy">automatic</property> |
| | 941 | <property name="shadow_type">in</property> |
| 865 | 942 | <child> |
| 866 | 943 | <widget class="GtkTreeView" id="treeview-keys"> |
| 867 | 944 | <property name="visible">True</property> |
| … |
… |
|
| 870 | 947 | </widget> |
| 871 | 948 | </child> |
| 872 | 949 | </widget> |
| | 950 | <packing> |
| | 951 | <property name="position">0</property> |
| | 952 | </packing> |
| 873 | 953 | </child> |
| 874 | 954 | </widget> |
| 875 | 955 | <packing> |
| … |
… |
|
| 892 | 972 | <property name="visible">True</property> |
| 893 | 973 | <property name="border_width">10</property> |
| 894 | 974 | <property name="label_xalign">0</property> |
| 895 | | <property name="shadow_type">GTK_SHADOW_NONE</property> |
| | 975 | <property name="shadow_type">none</property> |
| 896 | 976 | <child> |
| 897 | 977 | <widget class="GtkAlignment" id="alignment3"> |
| 898 | 978 | <property name="visible">True</property> |
| … |
… |
|
| 912 | 992 | </widget> |
| 913 | 993 | <packing> |
| 914 | 994 | <property name="expand">False</property> |
| | 995 | <property name="position">0</property> |
| 915 | 996 | </packing> |
| 916 | 997 | </child> |
| 917 | 998 | <child> |
| … |
… |
|
| 957 | 1038 | <property name="xalign">0</property> |
| 958 | 1039 | <property name="label" translatable="yes">_Backspace key generates:</property> |
| 959 | 1040 | <property name="use_underline">True</property> |
| 960 | | <property name="justify">GTK_JUSTIFY_CENTER</property> |
| | 1041 | <property name="justify">center</property> |
| 961 | 1042 | <property name="mnemonic_widget">backspace-binding-combobox</property> |
| 962 | 1043 | </widget> |
| 963 | 1044 | <packing> |
| … |
… |
|
| 971 | 1052 | <property name="xalign">0</property> |
| 972 | 1053 | <property name="label" translatable="yes">_Delete key generates:</property> |
| 973 | 1054 | <property name="use_underline">True</property> |
| 974 | | <property name="justify">GTK_JUSTIFY_CENTER</property> |
| | 1055 | <property name="justify">center</property> |
| 975 | 1056 | <property name="mnemonic_widget">delete-binding-combobox</property> |
| 976 | 1057 | </widget> |
| 977 | 1058 | <packing> |
| … |
… |
|
| 995 | 1076 | <property name="yscale">0</property> |
| 996 | 1077 | <child> |
| 997 | 1078 | <widget class="GtkButton" id="reset-compat-defaults-button"> |
| | 1079 | <property name="label" translatable="yes">_Reset Compatibility Options to Defaults</property> |
| 998 | 1080 | <property name="visible">True</property> |
| 999 | 1081 | <property name="can_focus">True</property> |
| 1000 | | <property name="label" translatable="yes">_Reset Compatibility Options to Defaults</property> |
| | 1082 | <property name="receives_default">False</property> |
| 1001 | 1083 | <property name="use_underline">True</property> |
| 1002 | | <property name="response_id">0</property> |
| 1003 | 1084 | <signal name="clicked" handler="on_reset_compat_defaults_clicked"/> |
| 1004 | 1085 | <signal name="clicked" handler="reload_erase_combos"/> |
| 1005 | 1086 | </widget> |
| … |
… |
|
| 1046 | 1127 | <packing> |
| 1047 | 1128 | <property name="expand">False</property> |
| 1048 | 1129 | <property name="fill">False</property> |
| | 1130 | <property name="position">0</property> |
| 1049 | 1131 | </packing> |
| 1050 | 1132 | </child> |
| 1051 | 1133 | <child> |
| 1052 | 1134 | <widget class="GtkHButtonBox" id="hbuttonbox1"> |
| 1053 | 1135 | <property name="visible">True</property> |
| 1054 | | <property name="layout_style">GTK_BUTTONBOX_END</property> |
| | 1136 | <property name="layout_style">end</property> |
| 1055 | 1137 | <child> |
| 1056 | 1138 | <widget class="GtkButton" id="button1"> |
| | 1139 | <property name="label">gtk-close</property> |
| 1057 | 1140 | <property name="visible">True</property> |
| 1058 | 1141 | <property name="can_focus">True</property> |
| 1059 | | <property name="label">gtk-close</property> |
| | 1142 | <property name="receives_default">False</property> |
| 1060 | 1143 | <property name="use_stock">True</property> |
| 1061 | | <property name="response_id">0</property> |
| 1062 | 1144 | <signal name="clicked" handler="gtk_widget_destroy" object="config-window"/> |
| 1063 | 1145 | </widget> |
| | 1146 | <packing> |
| | 1147 | <property name="expand">False</property> |
| | 1148 | <property name="fill">False</property> |
| | 1149 | <property name="position">0</property> |
| | 1150 | </packing> |
| 1064 | 1151 | </child> |
| 1065 | 1152 | </widget> |
| 1066 | 1153 | <packing> |
diff --git a/src/guake.py b/src/guake.py
index 270ad48..cb7afd4 100644
|
a
|
b
|
|
| 42 | 42 | from dbusiface import DbusManager, DBUS_NAME, DBUS_PATH |
| 43 | 43 | from common import test_gconf, pixmapfile, gladefile, ShowableError, _ |
| 44 | 44 | from guake_globals import NAME, VERSION, LOCALE_DIR, KEY, GCONF_PATH, \ |
| 45 | | TERMINAL_MATCH_EXPRS, TERMINAL_MATCH_TAGS |
| | 45 | TERMINAL_MATCH_EXPRS, TERMINAL_MATCH_TAGS, \ |
| | 46 | ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER |
| 46 | 47 | |
| 47 | 48 | pynotify.init('Guake!') |
| 48 | 49 | |
| … |
… |
|
| 95 | 96 | notify_add(KEY('/general/use_trayicon'), self.trayicon_toggled) |
| 96 | 97 | notify_add(KEY('/general/window_ontop'), self.ontop_toggled) |
| 97 | 98 | notify_add(KEY('/general/window_tabbar'), self.tabbar_toggled) |
| | 99 | notify_add(KEY('/general/window_halignment'), self.alignment_changed) |
| 98 | 100 | notify_add(KEY('/general/window_width'), self.size_changed) |
| 99 | 101 | notify_add(KEY('/general/window_height'), self.size_changed) |
| 100 | 102 | |
| … |
… |
|
| 145 | 147 | else: |
| 146 | 148 | self.guake.toolbar.hide() |
| 147 | 149 | |
| | 150 | def alignment_changed(self, client, connection_id, entry, data): |
| | 151 | """If the gconf var window_halignment be changed, this method will |
| | 152 | be called and will call the move function in guake. |
| | 153 | """ |
| | 154 | window_rect = self.guake.get_final_window_rect() |
| | 155 | self.guake.window.move(window_rect.x, window_rect.y) |
| | 156 | |
| 148 | 157 | def size_changed(self, client, connection_id, entry, data): |
| 149 | 158 | """If the gconf var window_height or window_width are changed, |
| 150 | 159 | this method will be called and will call the resize function |
| 151 | 160 | in guake. |
| 152 | 161 | """ |
| 153 | 162 | window_rect = self.guake.get_final_window_rect() |
| | 163 | self.guake.window.move(window_rect.x, window_rect.y) |
| 154 | 164 | self.guake.window.resize(window_rect.width, window_rect.height) |
| 155 | 165 | |
| 156 | 166 | def scrollbar_toggled(self, client, connection_id, entry, data): |
| … |
… |
|
| 740 | 750 | |
| 741 | 751 | def get_final_window_rect(self): |
| 742 | 752 | """Gets the final size of the main window of guake. The height |
| 743 | | is the window_height property, while width is window_width. |
| | 753 | is the window_height property, width is window_width and the |
| | 754 | horizontal alignment is given by window_alignment. |
| 744 | 755 | """ |
| 745 | 756 | screen = self.window.get_screen() |
| 746 | 757 | height = self.client.get_int(KEY('/general/window_height')) |
| 747 | 758 | width = self.client.get_int(KEY('/general/window_width')) |
| | 759 | halignment = self.client.get_int(KEY('/general/window_halignment')) |
| 748 | 760 | |
| 749 | 761 | # get the rectangle just from the first/default monitor in the |
| 750 | 762 | # future we might create a field to select which monitor you |
| 751 | 763 | # wanna use |
| 752 | 764 | window_rect = screen.get_monitor_geometry(0) |
| 753 | | |
| | 765 | total_width = window_rect.width |
| 754 | 766 | window_rect.height = window_rect.height * height / 100 |
| 755 | 767 | window_rect.width = window_rect.width * width / 100 |
| | 768 | |
| | 769 | if width < total_width: |
| | 770 | if halignment == ALIGN_CENTER: |
| | 771 | window_rect.x = (total_width - window_rect.width) / 2 |
| | 772 | elif halignment == ALIGN_LEFT: |
| | 773 | window_rect.x = 0 |
| | 774 | elif halignment == ALIGN_RIGHT: |
| | 775 | window_rect.x = total_width - window_rect.width |
| | 776 | window_rect.y = 0 |
| 756 | 777 | return window_rect |
| 757 | 778 | |
| 758 | 779 | # -- configuration -- |
diff --git a/src/guake_globals.py.in b/src/guake_globals.py.in
index 06e366c..002e55a 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 | 26 | ] |
| 26 | 27 | |
| 27 | 28 | NAME = 'guake' |
| … |
… |
|
| 54 | 55 | ] |
| 55 | 56 | |
| 56 | 57 | TERMINAL_MATCH_TAGS = 'schema', 'http', 'email' |
| | 58 | ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT = range(3) |
diff --git a/src/prefs.py b/src/prefs.py
index 88daed2..92b6293 100644
|
a
|
b
|
|
| 25 | 25 | import gconf |
| 26 | 26 | |
| 27 | 27 | from simplegladeapp import SimpleGladeApp |
| 28 | | from guake_globals import GCONF_PATH, KEY |
| | 28 | from guake_globals import GCONF_PATH, KEY, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER |
| 29 | 29 | from common import * |
| 30 | 30 | import globalhotkeys |
| 31 | 31 | |
| … |
… |
|
| 150 | 150 | val = hscale.get_value() |
| 151 | 151 | self.client.set_int(KEY('/general/window_height'), int(val)) |
| 152 | 152 | |
| | 153 | def on_window_halignment_changed(self, combo): |
| | 154 | """Changes the activity of window_alignment in gconf |
| | 155 | """ |
| | 156 | citer = combo.get_active_iter() |
| | 157 | if not citer: |
| | 158 | return |
| | 159 | alignment = combo.get_model().get_value(citer, 1) |
| | 160 | self.client.set_int(KEY('/general/window_halignment'), alignment) |
| | 161 | |
| 153 | 162 | # scrolling tab |
| 154 | 163 | |
| 155 | 164 | def on_use_scrollbar_toggled(self, chk): |
| … |
… |
|
| 279 | 288 | treeview.append_column(column) |
| 280 | 289 | |
| 281 | 290 | self.populate_shell_combo() |
| | 291 | self.populate_halignment_combo() |
| 282 | 292 | self.populate_keys_tree() |
| 283 | 293 | self.load_configs() |
| 284 | 294 | self.get_widget('config-window').hide() |
| … |
… |
|
| 411 | 421 | value = float(self.client.get_int(KEY('/general/window_height'))) |
| 412 | 422 | self.get_widget('window_height').set_value(value) |
| 413 | 423 | |
| | 424 | # horizontal alignment |
| | 425 | combo = self.get_widget('window_halignment') |
| | 426 | for i in combo.get_model(): |
| | 427 | if i[1] == self.client.get_int(KEY('/general/window_halignment')): |
| | 428 | combo.set_active_iter(i.iter) |
| | 429 | |
| 414 | 430 | # scrollbar |
| 415 | 431 | value = self.client.get_bool(KEY('/general/use_scrollbar')) |
| 416 | 432 | self.get_widget('use_scrollbar').set_active(value) |
| … |
… |
|
| 506 | 522 | 3, True) |
| 507 | 523 | self.get_widget('treeview-keys').expand_all() |
| 508 | 524 | |
| | 525 | def populate_halignment_combo(self): |
| | 526 | """Fill combo model with alignment possible values. |
| | 527 | """ |
| | 528 | model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_INT) |
| | 529 | for row in ( |
| | 530 | ("Center", ALIGN_CENTER), |
| | 531 | ("Left", ALIGN_LEFT), |
| | 532 | ("Right", ALIGN_RIGHT)): |
| | 533 | model.append(row) |
| | 534 | self.get_widget('window_halignment').set_model(model) |
| | 535 | |
| 509 | 536 | # -- key handling -- |
| 510 | 537 | |
| 511 | 538 | def on_key_edited(self, renderer, path, keycode, mask, keyval, model): |