Quote:
Originally Posted by meme
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;