summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-09-08 21:01:58 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-09-08 21:01:58 (GMT)
commitc03635088f26a18cdbd42c2528f00b9ccd8591d9 (patch)
tree9e9476353a137465c1f1595a89d859712df38136 /src
parentd7f0eeafe11369f20f001e43570a58a712af83f2 (diff)
Added a few configuration parameters for the main window.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@400 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src')
-rw-r--r--src/core/params.c6
-rw-r--r--src/core/params.h2
-rw-r--r--src/editor.c9
-rw-r--r--src/glibext/configuration.c2
4 files changed, 18 insertions, 1 deletions
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: