1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

core: add option "balance" for command /window (key: alt+"w" + alt+"b")

This commit is contained in:
Sebastien Helleu
2011-04-23 13:21:10 +02:00
parent 634478dd54
commit 909fe8a2b5
24 changed files with 116 additions and 38 deletions
+2 -1
View File
@@ -1,12 +1,13 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.5-rc1, 2011-04-22
v0.3.5-rc1, 2011-04-23
Version 0.3.5 (under dev!)
--------------------------
* core: add option "balance" for command /window (key: alt+"w" + alt+"b")
* core: add option "swap" for command /window (key: alt+"w" + alt+"s")
(task #11001)
* core: apply new value of option weechat.look.buffer_notify_default to all
+2
View File
@@ -520,6 +520,7 @@ Beispiele:
-1|+1|b#|up|down|left|right
splith|splitv [<pct>]
resize [+/-]<pct>
balance
merge [all]
page_up|page_down
refresh
@@ -538,6 +539,7 @@ Beispiele:
splith: split current window horizontally
splitv: split current window vertically
resize: resize window size, new size is <pct> percentage of parent window
balance: resize all windows to 50%
merge: merge window with another (all = keep only one window)
page_up: scroll one page up
page_down: scroll one page down
+1
View File
@@ -502,6 +502,7 @@ Tastenbefehle für Buffer / Fenster
| @k(A-)@k(w) , @k(A-)@k(←) | wechselt zum linken Fenster | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | wechselt zum rechten Fenster | /window right
// TRANSLATION MISSING
| @k(A-)@k(w) , @k(A-)@k(b) | Resize all windows to 50% | /window balance
| @k(A-)@k(w) , @k(A-)@k(s) | Swap buffers of two windows | /window swap
| @k(A-)@k(z) | Zoom für aktuelles Fenster (nochmals @k(A-)@k(z): stellt die vorherigen Einstellungen wieder her) | /window zoom
| @k(A-)@k(<) | springt zum letzten besuchten Buffer | /input jump_previously_visited_buffer
+2
View File
@@ -520,6 +520,7 @@ Examples:
-1|+1|b#|up|down|left|right
splith|splitv [<pct>]
resize [+/-]<pct>
balance
merge [all]
page_up|page_down
refresh
@@ -538,6 +539,7 @@ Examples:
splith: split current window horizontally
splitv: split current window vertically
resize: resize window size, new size is <pct> percentage of parent window
balance: resize all windows to 50%
merge: merge window with another (all = keep only one window)
page_up: scroll one page up
page_down: scroll one page down
+1
View File
@@ -503,6 +503,7 @@ Keys for buffers / windows
| @k(A-)@k(w) , @k(A-)@k(↓) | Switch to window below | /window down
| @k(A-)@k(w) , @k(A-)@k(←) | Switch to window on the left | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | Switch to window on the right | /window right
| @k(A-)@k(w) , @k(A-)@k(b) | Resize all windows to 50% | /window balance
| @k(A-)@k(w) , @k(A-)@k(s) | Swap buffers of two windows | /window swap
| @k(A-)@k(z) | Zoom on current window (@k(A-)@k(z) again: restore initial windows state, before zoom) | /window zoom
| @k(A-)@k(<) | Switch to previous buffer in list of visited buffers | /input jump_previously_visited_buffer
+2
View File
@@ -520,6 +520,7 @@ Exemples:
-1|+1|b#|up|down|left|right
splith|splitv [<pct>]
resize [+/-]<pct>
balance
merge [all]
page_up|page_down
refresh
@@ -538,6 +539,7 @@ Exemples:
splith: éclater la fenêtre en deux horizontalement
splitv: éclater la fenêtre en deux verticalement
resize: redimensionner une fenêtre, la nouvelle taille est <pct> pourcentage de la fenêtre parent
balance: redimensionner toutes les fenêtres à 50%
merge: fusionner la fenêtre avec une autre
page_up: faire défiler d'une page vers le haut
page_down: faire défiler d'une page vers le bas
+1
View File
@@ -511,6 +511,7 @@ Touches pour les tampons / fenêtres
| @k(A-)@k(w) , @k(A-)@k(↓) | Sauter à la fenêtre en dessous | /window down
| @k(A-)@k(w) , @k(A-)@k(←) | Sauter à la fenêtre de gauche | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | Sauter à la fenêtre de droite | /window right
| @k(A-)@k(w) , @k(A-)@k(b) | Redimensionner toutes les fenêtres à 50% | /window balance
| @k(A-)@k(w) , @k(A-)@k(s) | Echanger les tampons de deux fenêtres | /window swap
| @k(A-)@k(z) | Zoom sur la fenêtre courante (@k(A-)@k(z) de nouveau : restaurer l'état initial des fenêtres, avant le zoom) | /window zoom
| @k(A-)@k(<) | Sauter au tampon précédent dans la liste des tampons visités | /input jump_previously_visited_buffer
+2
View File
@@ -520,6 +520,7 @@ Esempi:
-1|+1|b#|up|down|left|right
splith|splitv [<pct>]
resize [+/-]<pct>
balance
merge [all]
page_up|page_down
refresh
@@ -538,6 +539,7 @@ Esempi:
splith: split current window horizontally
splitv: split current window vertically
resize: resize window size, new size is <pct> percentage of parent window
balance: resize all windows to 50%
merge: merge window with another (all = keep only one window)
page_up: scroll one page up
page_down: scroll one page down
+1
View File
@@ -513,6 +513,7 @@ Tasti per buffer / finestre
| @k(A-)@k(w) , @k(A-)@k(←) | Passa alla finestra sulla sinistra | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | Passa alla finestrs sulla destra | /window right
// TRANSLATION MISSING
| @k(A-)@k(w) , @k(A-)@k(b) | Resize all windows to 50% | /window balance
| @k(A-)@k(w) , @k(A-)@k(s) | Swap buffers of two windows | /window swap
| @k(A-)@k(z) | Ingrandimento sulla finestra attiva (@k(A-)@k(z) di nuovo: ripristina lo stato iniziale della finestra, prima dell'ingrandimento) | /window zoom
| @k(A-)@k(<) | Passa al buffer precedente nella lista dei buffer visitati | /input jump_previously_visited_buffer
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-10 17:32+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1721,8 +1721,8 @@ msgstr "spravuje okna"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
@@ -1745,6 +1745,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+4 -3
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-15 21:04+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1864,8 +1864,8 @@ msgstr "Fenster verwalten"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
@@ -1888,6 +1888,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+4 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-10 17:31+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1760,8 +1760,8 @@ msgstr "gestión de ventanas"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
@@ -1784,6 +1784,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+8 -6
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-22 17:52+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-23 13:10+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -1818,13 +1818,13 @@ msgstr "gestion des fenêtres"
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgid ""
@@ -1841,6 +1841,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
@@ -1884,6 +1885,7 @@ msgstr ""
" splitv: éclater la fenêtre en deux verticalement\n"
" resize: redimensionner une fenêtre, la nouvelle taille est <pct> "
"pourcentage de la fenêtre parent\n"
" balance: redimensionner toutes les fenêtres à 50%\n"
" merge: fusionner la fenêtre avec une autre\n"
" page_up: faire défiler d'une page vers le haut\n"
" page_down: faire défiler d'une page vers le bas\n"
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-10 11:21+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1521,8 +1521,8 @@ msgstr "ablakok kezelése"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
@@ -1543,6 +1543,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-10 17:33+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1811,8 +1811,8 @@ msgstr "gestione finestre"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-] "
@@ -1835,6 +1835,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+4 -3
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-10 17:32+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1766,8 +1766,8 @@ msgstr "zarządza oknami"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
@@ -1790,6 +1790,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-10 11:22+0200\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1750,8 +1750,8 @@ msgstr "gerencia janelas"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
@@ -1774,6 +1774,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+4 -3
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: 2011-04-10 17:33+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1530,8 +1530,8 @@ msgstr "управление окнами"
#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
@@ -1552,6 +1552,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+4 -3
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"POT-Creation-Date: 2011-04-23 13:17+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1332,8 +1332,8 @@ msgstr ""
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"<pct> || balance || merge [all] || page_up|page_down || refresh || scroll|"
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
@@ -1351,6 +1351,7 @@ msgid ""
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> percentage of parent "
"window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one window)\n"
" page_up: scroll one page up\n"
" page_down: scroll one page down\n"
+16 -4
View File
@@ -4477,6 +4477,14 @@ COMMAND_CALLBACK(window)
return WEECHAT_RC_OK;
}
/* balance windows */
if (string_strcasecmp (argv[1], "balance") == 0)
{
if (gui_window_balance (gui_windows_tree))
gui_window_ask_refresh (1);
return WEECHAT_RC_OK;
}
/* merge windows */
if (string_strcasecmp (argv[1], "merge") == 0)
{
@@ -4515,8 +4523,10 @@ COMMAND_CALLBACK(window)
error = NULL;
number = strtol (argv[1] + 1, &error, 10);
if (error && !error[0])
{
gui_window_switch_by_buffer (gui_current_window, number);
return WEECHAT_RC_OK;
return WEECHAT_RC_OK;
}
}
/* switch to previous window */
@@ -5255,6 +5265,7 @@ command_init ()
" || -1|+1|b#|up|down|left|right"
" || splith|splitv [<pct>]"
" || resize [+/-]<pct>"
" || balance"
" || merge [all]"
" || page_up|page_down"
" || refresh"
@@ -5276,6 +5287,7 @@ command_init ()
" splitv: split current window vertically\n"
" resize: resize window size, new size is <pct> "
"percentage of parent window\n"
" balance: resize all windows to 50%\n"
" merge: merge window with another (all = keep only one "
"window)\n"
" page_up: scroll one page up\n"
@@ -5306,9 +5318,9 @@ command_init ()
" scroll to beginning of current day:\n"
" /window scroll -d"),
"list || -1 || +1 || up || down || left || right"
" || splith || splitv || resize || page_up || page_down"
" || refresh || scroll || scroll_up || scroll_down"
" || scroll_top || scroll_bottom"
" || splith || splitv || resize || balance || page_up"
" || page_down || refresh || scroll || scroll_up"
" || scroll_down || scroll_top || scroll_bottom"
" || scroll_previous_highlight || scroll_next_highlight"
" || swap up|down|left|right || zoom || merge all",
&command_window, NULL);
+1
View File
@@ -185,6 +185,7 @@ gui_keyboard_default_bindings ()
BIND(/* m-w,m-right */ "meta-wmeta2-1;3C", "/window right");
BIND(/* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
BIND(/* m-w,m-left */ "meta-wmeta2-1;3D", "/window left");
BIND(/* m-w,m-b */ "meta-wmeta-b", "/window balance");
BIND(/* m-w,m-s */ "meta-wmeta-s", "/window swap");
BIND(/* m-z */ "meta-z", "/window zoom");
BIND(/* m-= */ "meta-=", "/filter toggle");
+25
View File
@@ -1954,6 +1954,31 @@ gui_window_switch_right (struct t_gui_window *window)
}
}
/*
* gui_window_balance: balance windows (set all splits to 50%)
* return 1 if some windows have been balanced
* 0 if nothing was changed
*/
int
gui_window_balance (struct t_gui_window_tree *tree)
{
int balanced;
balanced = 0;
if (tree && tree->child1 && tree->child2)
{
if (tree->split_pct != 50)
{
tree->split_pct = 50;
balanced = 1;
}
balanced |= gui_window_balance (tree->child1);
balanced |= gui_window_balance (tree->child2);
}
return balanced;
}
/*
* gui_window_swap: swap buffers of two windows
* direction can be: 0 = auto (swap with sister)
+15
View File
@@ -791,6 +791,21 @@ gui_window_switch_right (struct t_gui_window *window)
}
}
/*
* gui_window_balance: balance windows (set all splits to 50%)
* return 1 if some windows have been balanced
* 0 if nothing was changed
*/
int
gui_window_balance (struct t_gui_window_tree *tree)
{
(void) tree;
/* TODO: write this function for Gtk */
return 0;
}
/*
* gui_window_swap: swap buffer of two windows
* direction can be: 0 = auto (swap with sister)
+1
View File
@@ -187,6 +187,7 @@ extern void gui_window_switch_up (struct t_gui_window *window);
extern void gui_window_switch_down (struct t_gui_window *window);
extern void gui_window_switch_left (struct t_gui_window *window);
extern void gui_window_switch_right (struct t_gui_window *window);
extern int gui_window_balance (struct t_gui_window_tree *tree);
extern void gui_window_swap (struct t_gui_window *window, int direction);
extern void gui_window_refresh_screen (int full_refresh);
extern void gui_window_set_title (const char *title);