From 0e57fb789795266c3fcb7d82a355028a0233b83b Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 27 Nov 2006 15:01:13 +0000 Subject: non-gtkmm dialogs are now always opened ON-screen (bzr r2045) --- src/dialogs/text-edit.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/dialogs/text-edit.cpp') diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp index 85237c7cb..a44860ee3 100644 --- a/src/dialogs/text-edit.cpp +++ b/src/dialogs/text-edit.cpp @@ -3,11 +3,12 @@ /** * \brief Text editing dialog * - * Author: + * Authors: * Lauris Kaplinski * bulia byak + * Johan Engelen * - * Copyright (C) 1999-2002 Lauris Kaplinski + * Copyright (C) 1999-2006 Authors * Copyright (C) 2000-2001 Ximian, Inc. * * Released under GNU GPL, read the file 'COPYING' for more information @@ -52,6 +53,7 @@ extern "C" { #include #define VB_MARGIN 4 +#define MIN_ONSCREEN_DISTANCE 50 static void sp_text_edit_dialog_selection_modified (Inkscape::Application *inkscape, Inkscape::Selection *sel, guint flags, GtkWidget *dlg); static void sp_text_edit_dialog_selection_changed (Inkscape::Application *inkscape, Inkscape::Selection *sel, GtkWidget *dlg); @@ -143,8 +145,8 @@ sp_text_edit_dialog (void) dlg = sp_window_new (title, TRUE); if (x == -1000 || y == -1000) { - x = prefs_get_int_attribute (prefs_path, "x", 0); - y = prefs_get_int_attribute (prefs_path, "y", 0); + x = prefs_get_int_attribute (prefs_path, "x", -1000); + y = prefs_get_int_attribute (prefs_path, "y", -1000); } if (w ==0 || h == 0) { @@ -152,17 +154,17 @@ sp_text_edit_dialog (void) h = prefs_get_int_attribute (prefs_path, "h", 0); } - if (x<0) x=0; - if (y<0) y=0; +// if (x<0) x=0; +// if (y<0) y=0; - if (x != 0 || y != 0) { + if (w && h) + gtk_window_resize ((GtkWindow *) dlg, w, h); + if (x >= 0 && y >= 0 && (x < (gdk_screen_width()-MIN_ONSCREEN_DISTANCE)) && (y < (gdk_screen_height()-MIN_ONSCREEN_DISTANCE))) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_CENTER); } - if (w && h) - gtk_window_resize ((GtkWindow *) dlg, w, h); sp_transientize (dlg); wd.win = dlg; -- cgit v1.2.3