1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

core: fix balance of windows

This commit is contained in:
Sebastien Helleu
2011-05-07 17:30:22 +02:00
parent 5fde03f7fc
commit 8c9ba6b563
20 changed files with 132 additions and 95 deletions
+31 -31
View File
@@ -528,42 +528,42 @@ Beispiele:
swap [up|down|left|right]
zoom
list: listet die geöffneten Fenster (ohne Angabe von Parametern wird diese Funktion aufgerufen)
-1: springt zum vorherigen Fenster
+1: springt zum nächsten Fenster
b#: springt zum nächsten Fenster, welches die Buffer Nummer # besitzt
up: wechselt zum Fenster über dem aktuellen
down: wechselt zum Fenster unter dem aktuellen
left: wechselt zum linken Fenster
right: wechselt zum rechten Fenster
splith: teilt das aktuelle Fenster horizontal
splitv: teilt das aktuelle Fenster vertikal
resize: verändert die Größe des aktuellen Fensters. Die neue Größe des Fensters ist prozentual <pct> zum Stammfensters groß
balance: Größe aller Fenster auf 50% ändern
merge: vereinigt Fenster miteinander (all = alle Fenster vereinigen)
page_up: Scrollt eine Seite nach oben
page_down: Scrollt eine Seite nach unten
refresh: Seite wird neu aufgebaut
scroll: Scrollt eine Anzahl an Zeilen (+/-N) oder zu einer gewissen Zeit: s=Sekunden, m=Minuten, h=Stunden, d=Tage, M=Monate, y=Jahre
scroll_up: Scrollt ein paar Zeilen nach oben
scroll_down: Scrollt ein paar Zeilen nach unten
scroll_top: Scrollt zum Anfang des Buffers
scroll_bottom: Scrollt zum Ende des Buffers
scroll_previous_highlight: Scrollt zum vorherigen Hightlight
scroll_next_highlight: Scrollt zum nächsten Highlight
swap: tauscht die Buffer von zwei Fenstern (mit optionaler Angabe für das Zielfenster)
zoom: vergrößert auf Fenster
list: list opened windows (without argument, this list is displayed)
-1: jump to previous window
+1: jump to next window
b#: jump to next window displaying buffer number #
up: switch to window above current one
down: switch to window below current one
left: switch to window on the left
right: switch to window on the right
splith: split current window horizontally
splitv: split current window vertically
resize: resize window size, new size is <pct> percentage of parent window
balance: balance the sizes of all windows
merge: merge window with another (all = keep only one window)
page_up: scroll one page up
page_down: scroll one page down
refresh: refresh screen
scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years
scroll_up: scroll a few lines up
scroll_down: scroll a few lines down
scroll_top: scroll to top of buffer
scroll_bottom: scroll to bottom of buffer
scroll_previous_highlight: scroll to previous highlight
scroll_next_highlight: scroll to next highlight
swap: swap buffers of two windows (with optional direction for target window)
zoom: zoom on window
Bei splith und splitv gibt "pct" die neue Größe des Fensters im Verhältnis zur aktuellen Größe an. Zum Beispiel würde der Wert 25 bedeuten, dass das neue Fenster nur noch ein Viertel der Größe des alten Fensters hat.
For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
Beispiele:
Springt zum Fenster mit dem Buffer #1:
Examples:
jump to window displaying buffer #1:
/window b1
Scrollt zwei Zeilen hoch:
scroll 2 lines up:
/window scroll -2
Scrollt zwei Tage hoch: /window scroll -2d
scroll 2 days up:
/window scroll -2d
Scrollt zum Beginn des aktuellen Tages:
scroll to beginning of current day:
/window scroll -d
........................................
+2 -1
View File
@@ -501,7 +501,8 @@ Tastenbefehle für Buffer / Fenster
| @k(A-)@k(w) , @k(A-)@k(↓) | wechselt zum unteren Fenster | /window down
| @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
| @k(A-)@k(w) , @k(A-)@k(b) | Größenanpassung aller Fenster auf 50% | /window balance
// TRANSLATION MISSING
| @k(A-)@k(w) , @k(A-)@k(b) | Balance the sizes of all windows | /window balance
| @k(A-)@k(w) , @k(A-)@k(s) | Wechselt Buffer von zwei Fenstern | /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
+1 -1
View File
@@ -539,7 +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%
balance: balance the sizes of all windows
merge: merge window with another (all = keep only one window)
page_up: scroll one page up
page_down: scroll one page down
+1 -1
View File
@@ -503,7 +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(b) | Balance the sizes of all windows | /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
+1 -1
View File
@@ -539,7 +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%
balance: équilibrer la taille de toutes les fenêtres
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 -1
View File
@@ -511,7 +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(b) | Equilibrer la taille de toutes les fenêtres | /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
+32 -32
View File
@@ -528,42 +528,42 @@ Esempi:
swap [up|down|left|right]
zoom
list: elenca le finestre aperte (senza argomento, questa lista viene visualizzata)
-1: salta alla finestra precedente
+1: salta alla finestra successiva
b#: salta alla finestra successiva che visualizza il buffer numero #
up: passa alla finestra superiore a quella corrente
down: passa alla finestra inferiore a quella attiva
left: passa alla finestra a sinistra
right: passa alla finestra a destra
splith: divide la finestra attiva orizzontalmente
splitv: divide la finestra attiva verticalmente
resize: ridimensiona finestra, la nuova dimensione è <pct> percentuale della finestra genitore
balance: ridimensiona tutte le finestre al 50%
merge: unisce la finestra con un'altra (all = mantiente una sola finestra)
page_up: scorre di una pagina in alto
page_down: scorre di una pagina in basso
refresh: aggiorna lo schermo
scroll: scorre di un numero di righe (+/-N) o in base al tempo: s=secondi, m=minuti, h=ore, d=giorni, M=mesi, y=anni
scroll_up: scorre di alcune righe in alto
scroll_down: scorre di alcune righe in basso
scroll_top: scorre fino all'inizio del buffer
scroll_bottom: scorre fino alla fine del buffer buffer
scroll_previous_highlight: passa all'evento precedente
scroll_next_highlight: passa all'evento successivo
swap: scambia i buffer di due finestra (con direzione opzionale per la finestra di destinazione)
zoom: ingrandimento sulla finestra
list: list opened windows (without argument, this list is displayed)
-1: jump to previous window
+1: jump to next window
b#: jump to next window displaying buffer number #
up: switch to window above current one
down: switch to window below current one
left: switch to window on the left
right: switch to window on the right
splith: split current window horizontally
splitv: split current window vertically
resize: resize window size, new size is <pct> percentage of parent window
balance: balance the sizes of all windows
merge: merge window with another (all = keep only one window)
page_up: scroll one page up
page_down: scroll one page down
refresh: refresh screen
scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years
scroll_up: scroll a few lines up
scroll_down: scroll a few lines down
scroll_top: scroll to top of buffer
scroll_bottom: scroll to bottom of buffer
scroll_previous_highlight: scroll to previous highlight
scroll_next_highlight: scroll to next highlight
swap: swap buffers of two windows (with optional direction for target window)
zoom: zoom on window
Per splith e splitv, pct è una percentuale che rappresenta la dimensione della nuova finestra, calcolata con la finestra attiva come riferimento per la dimensione. Per esempio 25 vuol dire creare una finestra di dimensione = dimensione_attuale / 4
For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
Esempi:
salta alla finestra che visualizza il buffer #1:
Examples:
jump to window displaying buffer #1:
/window b1
scorre di due righe in alto:
scroll 2 lines up:
/window scroll -2
scorre all'indietro di due giorni:
scroll 2 days up:
/window scroll -2d
scorre all'inizio del giorno attuale:
/window scroll -d
scroll to beginning of current day:
/window scroll -d
........................................
+2 -1
View File
@@ -510,7 +510,8 @@ Tasti per buffer / finestre
| @k(A-)@k(w) , @k(A-)@k(↓) | Passa alla finestra in basso | /window down
| @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
| @k(A-)@k(w) , @k(A-)@k(b) | Ridimensione tutte le finestre al 50% | /window balance
// TRANSLATION MISSING
| @k(A-)@k(w) , @k(A-)@k(b) | Balance the sizes of all windows | /window balance
| @k(A-)@k(w) , @k(A-)@k(s) | Scambia i buffer di due finestra | /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
+2 -2
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-28 14:19+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+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"
@@ -1745,7 +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"
" balance: balance the sizes of all windows\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"
+3 -2
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-05-02 18:26+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+0200\n"
"PO-Revision-Date: 2011-04-29 13:06+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1872,6 +1872,7 @@ msgstr ""
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1886,7 +1887,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"
" balance: balance the sizes of all windows\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"
+2 -2
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-28 14:19+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+0200\n"
"PO-Revision-Date: 2011-04-28 14:24+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1784,7 +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"
" balance: balance the sizes of all windows\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 -4
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-28 14:19+0200\n"
"PO-Revision-Date: 2011-04-28 14:20+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+0200\n"
"PO-Revision-Date: 2011-05-07 17:27+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -1841,7 +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"
" balance: balance the sizes of all windows\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"
@@ -1885,7 +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"
" balance: équilibrer la taille de toutes les fenêtres\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"
+2 -2
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-28 14:19+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+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"
@@ -1543,7 +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"
" balance: balance the sizes of all windows\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"
+3 -2
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-05-02 18:26+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+0200\n"
"PO-Revision-Date: 2011-05-02 18:05+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1818,6 +1818,7 @@ msgstr ""
"scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || swap [up|down|left|right] || zoom"
#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1832,7 +1833,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"
" balance: balance the sizes of all windows\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"
+2 -2
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-28 14:19+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+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"
@@ -1790,7 +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"
" balance: balance the sizes of all windows\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"
+2 -2
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-28 14:19+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+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"
@@ -1774,7 +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"
" balance: balance the sizes of all windows\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"
+2 -2
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-28 14:19+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+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"
@@ -1552,7 +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"
" balance: balance the sizes of all windows\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"
+2 -2
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-28 14:19+0200\n"
"POT-Creation-Date: 2011-05-07 17:26+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"
@@ -1351,7 +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"
" balance: balance the sizes of all windows\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"
+1 -1
View File
@@ -5287,7 +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"
" balance: balance the sizes of all windows\n"
" merge: merge window with another (all = keep only one "
"window)\n"
" page_up: scroll one page up\n"
+36 -3
View File
@@ -1955,6 +1955,33 @@ gui_window_switch_right (struct t_gui_window *window)
}
}
/*
* gui_window_balance_count: count number of windows in a tree with a given
* split, for balancing windows
*/
int
gui_window_balance_count (struct t_gui_window_tree *tree, int split_horizontal)
{
int count;
count = 0;
if (tree)
{
if (!tree->window && (tree->split_horizontal == split_horizontal))
{
if ((tree->child1 && tree->child1->window)
|| (tree->child2 && tree->child2->window))
{
count++;
}
}
count += gui_window_balance_count (tree->child1, split_horizontal);
count += gui_window_balance_count (tree->child2, split_horizontal);
}
return count;
}
/*
* gui_window_balance: balance windows (set all splits to 50%)
* return 1 if some windows have been balanced
@@ -1964,14 +1991,20 @@ gui_window_switch_right (struct t_gui_window *window)
int
gui_window_balance (struct t_gui_window_tree *tree)
{
int balanced;
int balanced, count_left, count_right, new_split;
balanced = 0;
if (tree && tree->child1 && tree->child2)
{
if (tree->split_pct != 50)
count_left = gui_window_balance_count (tree->child1, tree->split_horizontal) + 1;
count_right = gui_window_balance_count (tree->child2, tree->split_horizontal) + 1;
if (count_right > count_left)
new_split = 100 - ((count_left * 100) / (count_left + count_right));
else
new_split = (count_right * 100) / (count_left + count_right);
if (tree->split_pct != new_split)
{
tree->split_pct = 50;
tree->split_pct = new_split;
balanced = 1;
}
balanced |= gui_window_balance (tree->child1);