summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a77e2e9)
raw | patch | inline | side by side (parent: a77e2e9)
author | Jon A. Cruz <jon@joncruz.org> | |
Sun, 25 Jul 2010 03:57:50 +0000 (20:57 -0700) | ||
committer | Jon A. Cruz <jon@joncruz.org> | |
Sun, 25 Jul 2010 03:57:50 +0000 (20:57 -0700) |
src/preferences-skeleton.h | patch | blob | history | |
src/ui/dialog/icon-preview.cpp | patch | blob | history | |
src/ui/dialog/icon-preview.h | patch | blob | history |
index 283960b807a055fe634b36549fa32f142802a83d..e117e85a5c7471fdf33e951cf7e67a259af30cfe 100644 (file)
" <group\n"
" id=\"iconpreview\"\n"
" pack=\"1\"\n"
+" selectionHold=\"0\"\n"
" selectionOnly=\"0\">\n"
" <group\n"
" id=\"sizes\">\n"
index 7be667383a82b1c6f445065cae1f8168284a5849..d3a28d96ff3bb4b5485b0b527d05da6804a5730f 100644 (file)
document(0),
timer(0),
pending(false),
+ targetId(),
hot(1),
selectionButton(0),
desktopChangeConn(),
// Do not refresh too quickly
queueRefresh();
} else if ( desktop ) {
+ bool hold = Inkscape::Preferences::get()->getBool("/iconpreview/selectionHold", false);
if ( selectionButton && selectionButton->get_active() )
{
- Inkscape::Selection * sel = sp_desktop_selection(desktop);
- if ( sel ) {
- //g_message("found a selection to play with");
-
- GSList const *items = sel->itemList();
- SPObject *target = 0;
- while ( items && !target ) {
- SPItem* item = SP_ITEM( items->data );
- SPObject * obj = SP_OBJECT(item);
- gchar const *id = obj->getId();
- if ( id ) {
- target = obj;
+ SPObject *target = (hold && !targetId.empty()) ? desktop->doc()->getObjectById( targetId.c_str() ) : 0;
+ if ( !target ) {
+ targetId.clear();
+ Inkscape::Selection * sel = sp_desktop_selection(desktop);
+ if ( sel ) {
+ //g_message("found a selection to play with");
+
+ GSList const *items = sel->itemList();
+ while ( items && !target ) {
+ SPItem* item = SP_ITEM( items->data );
+ SPObject * obj = SP_OBJECT(item);
+ gchar const *id = obj->getId();
+ if ( id ) {
+ targetId = id;
+ target = obj;
+ }
+
+ items = g_slist_next(items);
}
-
- items = g_slist_next(items);
- }
- if ( target ) {
- renderPreview(target);
}
}
+ if ( target ) {
+ renderPreview(target);
+ }
} else {
SPObject *target = desktop->currentRoot();
if ( target ) {
void IconPreviewPanel::modeToggled()
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- prefs->setBool("/iconpreview/selectionOnly", (selectionButton && selectionButton->get_active()));
+ bool selectionOnly = (selectionButton && selectionButton->get_active());
+ prefs->setBool("/iconpreview/selectionOnly", selectionOnly);
+ if ( !selectionOnly ) {
+ targetId.clear();
+ }
refreshPreview();
}
index 9de8825697fa2349b23cd0a69974f24a8d460563..0842c3c5eb226de114b9f990b0dc4a6028540382 100644 (file)
Gtk::VBox iconBox;
Gtk::HPaned splitter;
+ Glib::ustring targetId;
int hot;
int numEntries;
int* sizes;