diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp
index c5d2e6eed036a2833f521214b4b010b74b92c87c..1418a0212f0f0477b594336384d0c8e26ceb357d 100644 (file)
--- a/src/dialogs/find.cpp
+++ b/src/dialogs/find.cpp
#include "../sp-flowtext.h"
#include "../text-editing.h"
#include "../sp-tspan.h"
#include "../sp-flowtext.h"
#include "../text-editing.h"
#include "../sp-tspan.h"
+#include "../sp-tref.h"
#include "../selection-chemistry.h"
#include "../sp-defs.h"
#include "../sp-rect.h"
#include "../selection-chemistry.h"
#include "../sp-defs.h"
#include "../sp-rect.h"
#include "../sp-offset.h"
#include <xml/repr.h>
#include "../sp-offset.h"
#include <xml/repr.h>
+#define MIN_ONSCREEN_DISTANCE 50
+
using NR::X;
using NR::Y;
using NR::X;
using NR::Y;
-static bool sp_find_dialog_delete(GtkObject *, GdkEvent *, gpointer data)
+static gboolean sp_find_dialog_delete(GtkObject *, GdkEvent *, gpointer /*data*/)
{
gtk_window_get_position (GTK_WINDOW (dlg), &x, &y);
gtk_window_get_size (GTK_WINDOW (dlg), &w, &h);
{
gtk_window_get_position (GTK_WINDOW (dlg), &x, &y);
gtk_window_get_size (GTK_WINDOW (dlg), &w, &h);
} else if (SP_IS_PATH(item) || SP_IS_LINE(item) || SP_IS_POLYLINE(item)) {
return (type_checkbox (widget, "paths"));
} else if (SP_IS_PATH(item) || SP_IS_LINE(item) || SP_IS_POLYLINE(item)) {
return (type_checkbox (widget, "paths"));
- } else if (SP_IS_TEXT(item) || SP_IS_TSPAN(item) || SP_IS_STRING(item)) {
+ } else if (SP_IS_TEXT(item) || SP_IS_TSPAN(item) || SP_IS_TREF(item) || SP_IS_STRING(item)) {
return (type_checkbox (widget, "texts"));
} else if (SP_IS_GROUP(item) && !desktop->isLayer(item) ) { // never select layers!
return (type_checkbox (widget, "texts"));
} else if (SP_IS_GROUP(item) && !desktop->isLayer(item) ) { // never select layers!
GtkWidget *
GtkWidget *
-sp_find_types_checkbox (GtkWidget *w, const gchar *data, bool active,
+sp_find_types_checkbox (GtkWidget *w, const gchar *data, gboolean active,
GtkTooltips *tt, const gchar *tip,
const gchar *label,
void (*toggled)(GtkToggleButton *, gpointer))
GtkTooltips *tt, const gchar *tip,
const gchar *label,
void (*toggled)(GtkToggleButton *, gpointer))
}
GtkWidget *
}
GtkWidget *
-sp_find_types_checkbox_indented (GtkWidget *w, const gchar *data, bool active,
+sp_find_types_checkbox_indented (GtkWidget *w, const gchar *data, gboolean active,
GtkTooltips *tt, const gchar *tip,
const gchar *label,
void (*toggled)(GtkToggleButton *, gpointer), guint indent)
GtkTooltips *tt, const gchar *tip,
const gchar *label,
void (*toggled)(GtkToggleButton *, gpointer), guint indent)
dlg = sp_window_new (title, TRUE);
if (x == -1000 || y == -1000) {
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) {
w = prefs_get_int_attribute (prefs_path, "w", 0);
h = prefs_get_int_attribute (prefs_path, "h", 0);
}
}
if (w ==0 || h == 0) {
w = prefs_get_int_attribute (prefs_path, "w", 0);
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);
}
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;
sp_transientize (dlg);
wd.win = dlg;