diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | src/core/params.c | 6 | ||||
-rw-r--r-- | src/core/params.h | 2 | ||||
-rw-r--r-- | src/editor.c | 9 | ||||
-rw-r--r-- | src/glibext/configuration.c | 2 |
5 files changed, 28 insertions, 1 deletions
@@ -1,3 +1,13 @@ +14-09-08 Cyrille Bagard <nocbos@gmail.com> + + * src/core/params.c: + * src/core/params.h: + * src/editor.c: + Add a few configuration parameters for the main window. + + * src/glibext/configuration.c: + Fix a bug: detect when a boolean parameter has changed properly. + 14-09-05 Cyrille Bagard <nocbos@gmail.com> * src/gtkext/graph/node.c: diff --git a/src/core/params.c b/src/core/params.c index fdcbe3f..5e91faf 100644 --- a/src/core/params.c +++ b/src/core/params.c @@ -138,9 +138,15 @@ bool load_main_config_parameters(void) param = g_generic_config_create_param(config, MPK_FORMAT_NO_NAME, CPT_BOOLEAN, false); if (param == NULL) return false; + param = g_generic_config_create_param(config, MPK_TITLE_BAR, CPT_BOOLEAN, true); + if (param == NULL) return false; + param = g_generic_config_create_param(config, MPK_LAST_PROJECT, CPT_STRING, NULL); if (param == NULL) return false; + param = g_generic_config_create_param(config, MPK_MAXIMIZED, CPT_BOOLEAN, true); + if (param == NULL) return false; + param = g_generic_config_create_param(config, MPK_ELLIPSIS_HEADER, CPT_INTEGER, 54); if (param == NULL) return false; diff --git a/src/core/params.h b/src/core/params.h index 3e78945..6f8d62f 100644 --- a/src/core/params.h +++ b/src/core/params.h @@ -40,7 +40,9 @@ #define MPK_LOCAL_PORT "cdb.network.local.port" #define MPK_SERVER_BACKLOG "cdb.network.server.backlog" #define MPK_FORMAT_NO_NAME "format.symbols.use_phy_instead_of_virt" +#define MPK_TITLE_BAR "gui.editor.hide_titlebar" #define MPK_LAST_PROJECT "gui.editor.last_project" +#define MPK_MAXIMIZED "gui.editor.start_maximized" #define MPK_ELLIPSIS_HEADER "gui.editor.panels.ellipsis_header" #define MPK_ELLIPSIS_TAB "gui.editor.panels.ellipsis_tab" #define MPK_KEYBINDINGS_EDIT "gui.key_bindings.global.edit" diff --git a/src/editor.c b/src/editor.c index 17468e3..ea5ecb3 100644 --- a/src/editor.c +++ b/src/editor.c @@ -29,6 +29,7 @@ #include "project.h" +#include "core/params.h" #include "gtkext/easygtk.h" #include "gtkext/gtkdockstation.h" #include "gtkext/support.h" @@ -130,6 +131,8 @@ static GList *build_editor_icons_list(void) GtkWidget *create_editor(void) { GtkWidget *result; /* Fenêtre à renvoyer */ + bool hide; /* Cachette de la barre ? */ + bool maximized; /* Affichage en plein écran ? */ GList *icons; /* Liste d'images dimensionnées*/ GObject *ref; /* Version de référence */ GEditorItem *editem; /* Menus réactifs principaux */ @@ -154,6 +157,12 @@ GtkWidget *create_editor(void) gtk_container_set_border_width(GTK_CONTAINER(result), 4); gtk_window_set_title(GTK_WINDOW(result), _("Chrysalide")); + g_generic_config_get_value(get_main_configuration(), MPK_TITLE_BAR, &hide); + gtk_window_set_hide_titlebar_when_maximized(GTK_WINDOW(result), hide); + + g_generic_config_get_value(get_main_configuration(), MPK_MAXIMIZED, &maximized); + gtk_window_maximize(GTK_WINDOW(result)); + icons = build_editor_icons_list(); gtk_window_set_icon_list(GTK_WINDOW(result), icons); g_list_free_full(icons, (GDestroyNotify)g_object_unref); diff --git a/src/glibext/configuration.c b/src/glibext/configuration.c index 30cbcaf..3becaaa 100644 --- a/src/glibext/configuration.c +++ b/src/glibext/configuration.c @@ -574,7 +574,7 @@ ConfigParamState g_config_param_get_state(GCfgParam *param) switch (param->type) { case CPT_BOOLEAN: - param->cached_state = (param->def.boolean && param->cur.boolean ? CPS_DEFAULT : CPS_CHANGED); + param->cached_state = (param->def.boolean == param->cur.boolean ? CPS_DEFAULT : CPS_CHANGED); break; case CPT_INTEGER: |