View Single Post
Old Yesterday, 05:17 PM   #70
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 959
Karma: 3501880
Join Date: Jan 2017
Location: Poland
Device: Various
I’d like to come back to the suggestions from the previous thread. As these are three separate issues, I’ll cover them in three separate posts.

1. The idea of possibly resizing the image to fit the window and moving the image data to the top. I know that @KevinH is partly against this idea, but I’ve experimented with it and have been using this resizing for a month now. I won’t try to force anyone’s hand; I’m simply putting the idea forward for consideration.
Dimensions at the top are a nice feature, and I think we agree on that. As for image fitting – that depends on your working style and what you want to see. If you prefer the original size, we stick with the current solution; if you want the whole image, it might be worth testing.

The image is displayed in two situations:
1. Double-clicking the image file in the BookBrowser window.
2. Calling Go To Link from the image tag in the Code View window.

This could probably be solved using SVG; I’ve simply changed the styling.

Spoiler:
Code:
--- W:\Develop\Sigil\Sigil-master\src\Tabs\ImageTab.cpp-przed	2026-03-26 19:13:34.000000000 +0100
+++ W:\Develop\Sigil\Sigil-master\src\Tabs\ImageTab.cpp	2026-03-20 09:45:51.699239500 +0100
@@ -1,6 +1,6 @@
 /************************************************************************
 **
-**  Copyright (C) 2015-2024 Kevin B. Hendricks, Stratford Ontario Canada
+**  Copyright (C) 2015-2026 Kevin B. Hendricks, Stratford Ontario Canada
 **  Copyright (C) 2009-2011 Strahinja Markovic  <strahinja.markovic@gmail.com>
 **
 **  This file is part of Sigil.
@@ -58,16 +58,16 @@
     "<html>"
     "<head>"
     "<style type=\"text/css\">"
-    "body { -webkit-user-select: none; }"
-    "img { display: block; margin-left: auto; margin-right: auto; border-style: solid; border-width: 1px; }"
+    "body { -webkit-user-select: none; margin: 0; }"
+    "div { text-align: center; margin: 8px 0; }"
+    "img { display: block; margin: 0 auto; border: 1px solid; max-width: 100%; max-height: calc(100vh - 75px); }"
     "hr { width: 75%; }"
-    "div { text-align: center; }"
     "</style>"
     "</head>"
     "<body>"
-    "<p><img src=\"%1\" /></p>"
-    "<hr />"
     "<div>%2&times;%3px | %4 KB | %5%6</div>"
+    "<hr />"
+    "<p><img src=\"%1\" /></p>"
     "</body>"
     "</html>";


Spoiler:
Code:
--- W:\Develop\Sigil\Sigil-master\src\Widgets\ImageView.cpp-przed	2026-03-26 19:13:34.000000000 +0100
+++ W:\Develop\Sigil\Sigil-master\src\Widgets\ImageView.cpp	2026-03-20 09:45:58.595501000 +0100
@@ -1,6 +1,6 @@
 /************************************************************************
 **
-**  Copyright (C) 2019-2025 Kevin B. Hendricks
+**  Copyright (C) 2019-2026 Kevin B. Hendricks
 **  Copyright (C) 2013      Dave Heiland
 **
 **  This file is part of Sigil.
@@ -43,16 +43,16 @@
     "<html>"
     "<head>"
     "<style type=\"text/css\">"
-    "body { -webkit-user-select: none; }"
-    "img { display: block; margin-left: auto; margin-right: auto; border-style: solid; border-width: 1px; }"
+    "body { -webkit-user-select: none; margin: 0; }"
+    "div { text-align: center; margin: 8px 0; }"
+    "img { display: block; margin: 0 auto; border: 1px solid; max-width: 100%; max-height: calc(100vh - 75px); }"
     "hr { width: 75%; }"
-    "div { text-align: center; }"
     "</style>"
     "</head>"
     "<body>"
-    "<p><img src=\"%1\" /></p>"
-    "<hr />"
     "<div>%2&times;%3px | %4 KB | %5%6</div>"
+    "<hr />"
+    "<p><img src=\"%1\" /></p>"
     "</body>"
     "</html>";
Attached Thumbnails
Click image for larger version

Name:	sigil-276-image-file-before.jpg
Views:	7
Size:	377.2 KB
ID:	222135   Click image for larger version

Name:	sigil-276-image-file-after.png
Views:	5
Size:	907.6 KB
ID:	222136   Click image for larger version

Name:	sigil-276-image-jump-before.png
Views:	5
Size:	838.6 KB
ID:	222137   Click image for larger version

Name:	sigil-276-image-jump-after.png
Views:	5
Size:	716.8 KB
ID:	222138  
BeckyEbook is offline   Reply With Quote