summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-05-13 20:25:08 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-05-13 20:25:08 (GMT)
commit8802a479f37dde99f2709af50cf15e595e32b47e (patch)
tree862c87ade243603a6eeca1804df42ca9f574678b /src
parentee0954cd4f25cbd926f9b4e4ba121c34877b1cb4 (diff)
Handled positions for both sides of paned widgets.
Diffstat (limited to 'src')
-rw-r--r--src/glibext/configuration.c2
-rw-r--r--src/gui/editor.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/glibext/configuration.c b/src/glibext/configuration.c
index a8f8af3..29d6f49 100644
--- a/src/glibext/configuration.c
+++ b/src/glibext/configuration.c
@@ -1020,7 +1020,7 @@ static void g_config_group_load(GCfgGroup *group, GGenConfig *config, xmlXPathCo
for (i = 0; i < XPATH_OBJ_NODES_COUNT(xpathObj); i++)
{
- asprintf(&key, "gui.panels.positions.%s", NODE_FROM_PATH_OBJ(xpathObj, i)->name);
+ asprintf(&key, "%s.%s", group->root, NODE_FROM_PATH_OBJ(xpathObj, i)->name);
param = g_config_param_new(key, CPT_INTEGER, -1);
_g_generic_config_add_param(config, param, false);
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");
}