Closed BeckyDTP closed 4 years ago
Actually, it sort of makes sense. All of the other toolbar icons load the 48px versions as default in the main.ui file. Then we extend them with the 22px versions in MainWindow. But the Edit/pencil icon is not loaded by default in the .ui file. The Preview/eyeball one is. Then we switch to the Edit/pencil programmatically later on. So it probably only ever gets the 22px version to work with.
Would you please change your pull request ever so slightly to simply add (not shrink) the 48 px size for that icon
It seems it is not being properly parsed from the main.ui file for some strange reason.
Something along these lines perhaps:
diff --git a/MainWindow.cpp b/MainWindow.cpp
index 724f934..735d43f 100644
--- a/MainWindow.cpp
+++ b/MainWindow.cpp
@@ -1853,6 +1853,7 @@ void MainWindow::ExtendIconSizes()
icon = ui.actionMode->icon();
icon.addFile(QString::fromUtf8(":/icons/mode-preview_22px.png"), QSize(22,22), QIcon::Normal, QIcon::Off);
icon.addFile(QString::fromUtf8(":/icons/mode-edit_22px.png"), QSize(22,22), QIcon::Normal, QIcon::On);
+ icon.addFile(QString::fromUtf8(":/icons/mode-edit_48px.png"), QSize(48,48), QIcon::Normal, QIcon::On);
ui.actionMode->setIcon(icon);
Thanks!
KevinH
The solution is probably to add BOTH icons in the ExtendIconSizes section. Can you test if that works? If so, you can add the commit to this PR.
Great minds think alike! ;)
Guess so! :D
I confirm that. Adding 48px icons works.
If you push your commit to your fork, this PR should pick it up and we can add it.
Looks good to me. But now that I think about it, I think the main Heading-Change ToolButton icon might need the same treatment (the icons for the individual actions are fine). It's not assigned in main.ui, so only the 22px version exists. Do you want to push another commit to this PR since they're related?
In fact, I'm thinking the two similar ToolButtons (CaseChange and HeadingChange) in Sigil, probably need this treatment as well.
I admit that I thought about it too. It is true that the correct icon is loading, but only AFTER restarting Sigil.
I will check if it works and update this PR and prepare PR for Sigil.
Nevermind. I was mistaken. The 48px icons ARE, in fact, correctly assigned to the QToolButtons in main.ui. No need to add them again in ExtendIconSizes.
I'm going to merge this request, now.
I know this change does not make sense, but I checked it a few weeks ago and forgot to prepare Pull Request.
How to check?
That is why in this unique place we have to load the "big" pencil right away.
It is possible that there is another solution, but I admit that I did not find it. It just works.