set minimal size to 620x440, default size to 900x600, added command line option -m or --no-msgwin to disable message window at startup

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@250 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2006-03-15 23:19:45 +00:00
parent a67c5f8acb
commit 504017aeea
4 changed files with 17 additions and 8 deletions

View File

@ -54,6 +54,8 @@
#endif
// for detailed description look in the documentation, things are not
// listed in the documentation should not be changed ;-)
#define GEANY_HOME_DIR g_get_home_dir()
#define GEANY_FIFO_NAME "geany_fifo.0"
#define GEANY_CODENAME "Nivers"
@ -64,9 +66,12 @@
#define GEANY_CHECK_FILE_DELAY 30
#define GEANY_WORDCHARS "_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
#define GEANY_MAX_AUTOCOMPLETE_WORDS 30
#define GEANY_MSGWIN_HEIGHT 240
#define GEANY_STRING_UNTITLED _("untitled")
#define GEANY_MSGWIN_HEIGHT 208
#define GEANY_WINDOW_MINIMAL_WIDTH 620
#define GEANY_WINDOW_MINIMAL_HEIGHT 440
#define GEANY_WINDOW_DEFAULT_WIDTH 900
#define GEANY_WINDOW_DEFAULT_HEIGHT 600
#ifndef DOCDIR
# define DOCDIR PACKAGE_DATA_DIR"/doc/"PACKAGE"/html/"

View File

@ -201,7 +201,6 @@ create_window1 (void)
accel_group = gtk_accel_group_new ();
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_size_request (window1, 900, 600);
gtk_window_set_title (GTK_WINDOW (window1), _("Geany"));
vbox1 = gtk_vbox_new (FALSE, 0);

View File

@ -248,9 +248,10 @@ gboolean configuration_load(void)
app->geometry[2] = geo[2];
app->geometry[3] = geo[3];
}
hpan_position = utils_get_setting_integer(config, PACKAGE, "treeview_position", -1);
vpan_position = utils_get_setting_integer(config, PACKAGE, "msgwindow_position",
(geo) ? (geo[3] - GEANY_MSGWIN_HEIGHT) : -1);
hpan_position = utils_get_setting_integer(config, PACKAGE, "treeview_position", 156);
vpan_position = utils_get_setting_integer(config, PACKAGE, "msgwindow_position", (geo) ?
(GEANY_MSGWIN_HEIGHT + geo[3] - 440) :
(GEANY_MSGWIN_HEIGHT + GEANY_WINDOW_DEFAULT_HEIGHT - 440));
app->pref_editor_tab_width = utils_get_setting_integer(config, PACKAGE, "pref_editor_tab_width", 4);
@ -465,7 +466,7 @@ void configuration_read_filetype_extensions(void)
}
}
// add comment, if it doesn't exist
comment = g_key_file_get_comment(config, "Extensions", NULL, NULL);
comment = g_key_file_get_comment(config, NULL, NULL, NULL);
if (!comment || strlen(comment) == 0)
{
g_key_file_set_comment(config, "Extensions", NULL, "Filetype extension configuration file for Geany\nInsert as many items as you want, seperate them with a \";\".\nIf you want to get the default for a key, just delete it and\nthen it will be appended next time you start Geany.", NULL);

View File

@ -56,6 +56,7 @@ static gboolean ignore_fifo = FALSE;
#endif
static gboolean debug_mode = FALSE;
static gboolean ignore_global_tags = FALSE;
static gboolean no_msgwin = FALSE;
static gboolean no_vte = FALSE;
static gboolean show_version = FALSE;
static gchar *alternate_config = NULL;
@ -70,6 +71,7 @@ static GOptionEntry entries[] =
{ "no-pipe", 'p', 0, G_OPTION_ARG_NONE, &ignore_fifo, "don't open files in a running instance, force opening a new instance", NULL },
#endif
{ "config", 'c', 0, G_OPTION_ARG_FILENAME, &alternate_config, "use an alternate configuration directory", NULL },
{ "no-msgwin", 'm', 0, G_OPTION_ARG_NONE, &no_msgwin, "don't show message window at startup", NULL },
{ "no-terminal", 't', 0, G_OPTION_ARG_NONE, &no_vte, "don't load terminal support", NULL },
#ifdef HAVE_VTE
{ "vte-lib", 'l', 0, G_OPTION_ARG_FILENAME, &lib_vte, "filename of libvte.so", NULL },
@ -109,7 +111,7 @@ static void apply_settings(void)
gtk_widget_hide(app->toolbar);
app->toolbar_visible = FALSE;
}
if (! app->msgwindow_visible)
if (! app->msgwindow_visible || no_msgwin)
{
// I know this is a bit confusing, but it works
app->msgwindow_visible = TRUE;
@ -473,6 +475,8 @@ gint main(gint argc, gchar **argv)
gtk_init(&argc, &argv);
main_init();
gtk_widget_set_size_request(app->window, GEANY_WINDOW_MINIMAL_WIDTH, GEANY_WINDOW_MINIMAL_HEIGHT);
gtk_window_set_default_size(GTK_WINDOW(app->window), GEANY_WINDOW_DEFAULT_WIDTH, GEANY_WINDOW_DEFAULT_HEIGHT);
configuration_load();
templates_init();
encodings_init();