diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-05-13 20:25:08 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-05-13 20:25:08 (GMT) |
commit | 8802a479f37dde99f2709af50cf15e595e32b47e (patch) | |
tree | 862c87ade243603a6eeca1804df42ca9f574678b /src/gui | |
parent | ee0954cd4f25cbd926f9b4e4ba121c34877b1cb4 (diff) |
Handled positions for both sides of paned widgets.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/editor.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/editor.c b/src/gui/editor.c index f29ffe7..22c6df9 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -152,7 +152,7 @@ static void switch_panel_node_into_paned(panel_node *, bool, bool); static void attach_panel_node_to_paned(panel_node *, panel_node *, bool); /* Met à jour en cascade les chemins d'accès aux noeuds. */ -static void update_path_of_paned_nodes(panel_node *, const char *); +static void update_path_of_paned_nodes(panel_node *, const char *, const char *); /* Détermine la plus grande longueur commune entre éléments. */ static size_t compute_path_common_length(const panel_node *, const char *); @@ -641,7 +641,7 @@ static void attach_panel_node_to_paned(panel_node *parent, panel_node *node, boo { gtk_container_add(GTK_CONTAINER(_support), node->widget); - update_path_of_paned_nodes(node, ""); + update_path_of_paned_nodes(node, "", "R"); } @@ -665,7 +665,7 @@ static void attach_panel_node_to_paned(panel_node *parent, panel_node *node, boo /* Mise à jour des chemins */ - update_path_of_paned_nodes(node, parent->path); + update_path_of_paned_nodes(node, parent->path, first ? "1" : "2"); } @@ -676,6 +676,7 @@ static void attach_panel_node_to_paned(panel_node *parent, panel_node *node, boo * * * Paramètres : node = noeud dont le chemin est à mettre à jour. * * root = chemin menant au niveau précédent. * +* sub = sous-chemin vers lequel l'orientation penche. * * * * Description : Met à jour en cascade les chemins d'accès aux noeuds. * * * @@ -685,7 +686,7 @@ static void attach_panel_node_to_paned(panel_node *parent, panel_node *node, boo * * ******************************************************************************/ -static void update_path_of_paned_nodes(panel_node *node, const char *root) +static void update_path_of_paned_nodes(panel_node *node, const char *root, const char *sub) { GtkOrientation orientation; /* Orientation du support */ char *key; /* Clef d'accès à un paramètre */ @@ -699,6 +700,7 @@ static void update_path_of_paned_nodes(panel_node *node, const char *root) free(node->path); node->path = strdup(root); + node->path = stradd(node->path, sub); orientation = gtk_orientable_get_orientation(GTK_ORIENTABLE(node->paned)); @@ -719,10 +721,10 @@ static void update_path_of_paned_nodes(panel_node *node, const char *root) /* Propagation de la mise à jour */ if (node->first) - update_path_of_paned_nodes(node->first, node->path); + update_path_of_paned_nodes(node->first, node->path, "1"); if (node->second != NULL) - update_path_of_paned_nodes(node->second, node->path); + update_path_of_paned_nodes(node->second, node->path, "2"); } |