Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons not displaying icons on Windows, and some missing button text #903

Closed
Tecratal opened this issue Dec 8, 2024 · 10 comments
Closed

Comments

@Tecratal
Copy link

Tecratal commented Dec 8, 2024

I am using Windows 11 and installed BrewTarget 4.0.11 today. Some of the buttons don't have any text and I have to hover over them and wait for the tool tip to figure out what it does. For example the Add/Remove/Edit fermentable buttons are blank. I attached a screenshot.

image

@matty0ung
Copy link
Contributor

Sorry you're hitting problems. This particular problem is actually already fixed in the head revision of the code, and just waiting on the next release (4.0.12 release), which should be available later this week (I hope!).

@Tecratal
Copy link
Author

Tecratal commented Dec 8, 2024

Awesome, thank you.

@matty0ung
Copy link
Contributor

Hopefully this is fixed in 4.0.12. If not, please don't hesitate to reopen this issue!

@Tecratal
Copy link
Author

I tried 4.0.12 and it looks like the issue is still there.
image

@matty0ung matty0ung reopened this Dec 18, 2024
@matty0ung
Copy link
Contributor

Hot dang! Back to the drawing board.

This should have been a small tweak - just getting one extra bit of Qt included in all the packages - but I obviously have missed some subtlety to it. Will have another look.

@Tecratal
Copy link
Author

Tecratal commented Dec 18, 2024

It looks like text isn't being passed into the qstring function for the edit and remove buttons (add to recipe and new do have text being passed to QString() so they display correctly)

brewtarget/src/catalogs
/CatalogBase.h

   void retranslateUi() {
      this->derived().setWindowTitle(QString(QObject::tr("%1 Catalog / Database")).arg(NE::localisedName()));
      if (m_pushButton_addToRecipe) {
         m_pushButton_addToRecipe->setText(QString(QObject::tr("Add to Recipe")));
      }
      m_pushButton_new        ->setText(QString(QObject::tr("New")));
      m_pushButton_edit       ->setText(QString());
      m_pushButton_remove     ->setText(QString());

On the main screen it looks like some strings are missing from brewtarget/ui
/mainWindow.ui

For example: Edit mash step is missing Edit mash step after on line 1366 Edit mash displays properly.

<widget class="QPushButton" name="pushButton_editMashStep">
                    <property name="toolTip">
                     <string>Edit selected mash step</string>
                    </property>
                    <property name="text">
                     <string/>
                    </property>
                    <property name="icon">
                     <iconset resource="../resources.qrc">
                      <normaloff>:/images/edit.svg</normaloff>:/images/edit.svg</iconset>
                    </property>
                   </widget>
                  </item>
                  <item>
                   <widget class="QPushButton" name="pushButton_editMash">
                    <property name="toolTip">
                     <string>Edit mash properties</string>
                    </property>
                    <property name="text">
                     <string>Edit mash</string>
                    </property>
                   </widget>
                  </item>
                  <item>

I think these are the source of the bugs. Just saw that some buttons had text and some didn't and this was the difference I saw.

@matty0ung
Copy link
Contributor

matty0ung commented Dec 18, 2024

Believe it or not, it's deliberate that some of the buttons only have images. You can see what it's supposed to look like here.

The issue is that the icons are stored as scalable vector graphics (svg files). There is a part of the Qt framework that converts them into bitmaps to show on the screen (meaning that they look good on multiple different monitor resolution). Because of a bug in part of the Qt packaging tools, we have to jump through a couple of hoops to ensure that this particular part of the Qt framework ships with the application. We have it working on Linux (and I hope Mac), but it seems we didn't quite do the right incantations for Windows.

It's a bit hard for me to test on my Windows machine, because it already has all the Qt libraries installed (to do the build). But I'll keep poking around to try to see what we need to do to get this glitch fixed.

@matty0ung
Copy link
Contributor

I'll probably add back-up text to the buttons that are image-only -- not least as it makes the application more accessible. So we will also make the changes you're suggesting. 👍

@matty0ung
Copy link
Contributor

Original fix was following the notes at https://stackoverflow.com/questions/76047551/icons-shown-in-qt5-not-showing-in-qt6, but I think we might need to do something different because we use MSYS2 and GCC for our Windows build.

@matty0ung matty0ung changed the title Buttons not displaying button text Buttons not displaying icons on Windows, and some missing button text Dec 19, 2024
@matty0ung
Copy link
Contributor

I'm hoping this is now fixed in 4.0.13. (It seemed to work OK on a Windows 10 VM I tried that didn't have all the build environment installed.) However, as ever, please don't hesitate to reopen this issue if you're still seeing this problem (or to raise a new issue if you hit any other problems).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants