View Single Post
Old 01-05-2012, 03:33 PM   #23
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by meme View Post
If you double click on an image file repeatedly it opens new tabs each time, unlike Text or Styles which switches you to the open tab if a tab already exists.
I can't think of any reason why you wouldn't want to switch to the open image tab if repeatedly clicked. If there isn't one, this patch should fix it:

Code:
diff --git a/src/Sigil/Tabs/TabManager.cpp b/src/Sigil/Tabs/TabManager.cpp
index 3f34fee..7980bab 100644
--- a/src/Sigil/Tabs/TabManager.cpp
+++ b/src/Sigil/Tabs/TabManager.cpp
@@ -352,6 +352,13 @@ bool TabManager::SwitchedToExistingTab( Resource& resource,
             text_tab->ScrollToLine( line_to_scroll_to );
             return true;
         }
+
+        ImageTab *image_tab = qobject_cast< ImageTab* >( tab );
+
+        if ( image_tab != NULL )
+        {
+            return true;
+        }
     }
 
     return false;
meme is offline