diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp
index c1f1c9974c53de30c48b48c0e29ad5240d86afc9..6f9eca0d73c8acdb26fc9d88f9072fd7c5f7cb71 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-tref.h"
#include "../selection-chemistry.h"
#include "../sp-defs.h"
#include "../sp-rect.h"
#include "../sp-offset.h"
#include <xml/repr.h>
+#define MIN_ONSCREEN_DISTANCE 50
+
using NR::X;
using NR::Y;
// impossible original values to make sure they are read from prefs
static gint x = -1000, y = -1000, w = 0, h = 0;
-static gchar *prefs_path = "dialogs.find";
+static gchar const *prefs_path = "dialogs.find";
-static gboolean 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);
} 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!
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (dlg), "inlayer")))) {
l = all_items (desktop->currentLayer(), l, hidden, locked);
} else {
- l = all_items (SP_DOCUMENT_ROOT (SP_DT_DOCUMENT (desktop)), l, hidden, locked);
+ l = all_items (SP_DOCUMENT_ROOT (sp_desktop_document (desktop)), l, hidden, locked);
}
}
guint all = g_slist_length (l);
count),
count, all, exact? _("exact") : _("partial"));
- Inkscape::Selection *selection = SP_DT_SELECTION (desktop);
+ Inkscape::Selection *selection = sp_desktop_selection (desktop);
selection->clear();
selection->setList(n);
scroll_to_show_item (desktop, SP_ITEM(n->data));
}
{
- GtkWidget *c = sp_find_types_checkbox_indented (vb, "clones", TRUE, tt, _("Search clones"), _("Clones"), NULL, 10);
+ GtkWidget *c = sp_find_types_checkbox_indented (vb, "clones", TRUE, tt, _("Search clones"),
+ //TRANSLATORS: Translate the word "Clones" only. A noun indicating type of object to find
+ Q_("find|Clones"), NULL, 10);
gtk_box_pack_start (GTK_BOX (vb_all), c, FALSE, FALSE, 0);
}
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 (x != 0 || y != 0) {
+
+// if (x<0) x=0;
+// if (y<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;