Giter Site home page Giter Site logo

Comments (7)

Syres916 avatar Syres916 commented on May 29, 2024

You need to add the Boolean parameter Bitmaps/Theme/ThemeSearchPaths as per https://wiki.freecad.org/Fine-tuning

from freecad.

furgo16 avatar furgo16 commented on May 29, 2024

Thanks! This works around the issue for those two icons, but I'll leave it open, as I feel it's still a bug (either in packaging or on choosing the icon, or on the system icon theme). In general, I'm happy with the system theme.

It seems that at least on Linux, there are at least 3 themes that are applied depending on the FreeCAD package installed and the value of that property.

Icons Package Bitmaps/Theme/ThemeSearchPaths Theme Notes
Captura de pantalla de 2024-05-08 09-38-39
image
freecad-daily true Yaru Ubuntu's default theme
Captura de pantalla de 2024-05-08 09-37-31
image
freecad-daily false FreeCAD/Tango This is the FreeCAD icon set, which uses Tango icons. Also what it looks like on default installation with the snap package
Captura de pantalla de 2024-05-08 09-37-10
image
AppImage weekly true ? Yet another theme. Unclear where it comes from
Captura de pantalla de 2024-05-08 09-37-31
image
AppImage weekly false FreeCAD/Tango This is the FreeCAD icon set, which uses Tango icons.

from freecad.

maxwxyz avatar maxwxyz commented on May 29, 2024

Is it something which could be solved in FreeCAD or is there no system icon to distinguish between them?

from freecad.

furgo16 avatar furgo16 commented on May 29, 2024

I'm not sure how the translation FreeCAD icon => System icon works. FreeCAD does name them differently though (zoom-all and zoom-selection). I don't know whether some system icons can be overriden by FreeCAD icons when using the system theme.

: Command("Std_ViewFitSelection")
{
sGroup = "Standard-View";
sMenuText = QT_TR_NOOP("Fit selection");
sToolTipText = QT_TR_NOOP("Fits the selected content on the screen");
sWhatsThis = "Std_ViewFitSelection";
sStatusTip = QT_TR_NOOP("Fits the selected content on the screen");
sAccel = "V, S";
sPixmap = "zoom-selection";
eType = Alter3DView;
}

StdCmdViewFitAll::StdCmdViewFitAll()
: Command("Std_ViewFitAll")
{
sGroup = "Standard-View";
sMenuText = QT_TR_NOOP("Fit all");
sToolTipText = QT_TR_NOOP("Fits the whole content on the screen");
sWhatsThis = "Std_ViewFitAll";
sStatusTip = QT_TR_NOOP("Fits the whole content on the screen");
sPixmap = "zoom-all";
sAccel = "V, F";
eType = Alter3DView;
}

from freecad.

krushia avatar krushia commented on May 29, 2024

On my system they both look the same in the appimage. The icon they resolve to is zoom-fit-best from my scheme selected in KDE. There is an actual bug here, because "zoom-selection" and "zoom-all" aren't listed in the Freedesktop Icon Naming Specification. This means an application can't be sure they will exist. See also the related Icon There Spec

I have no idea how this works on Windows. The QIcon docs are a long read.

from freecad.

krushia avatar krushia commented on May 29, 2024

I spoke too soon. FreeCAD does have those named icons in the source,
https://github.com/FreeCAD/FreeCAD/blob/main/src/Gui/Icons/zoom-fit-best.svg
https://github.com/FreeCAD/FreeCAD/blob/main/src/Gui/Icons/zoom-all.svg
... but apparently they don't get used if Bitmaps/Theme/ThemeSearchPaths is true? In my case there is no setting defined.
Screenshot_20240508_205929

from freecad.

furgo16 avatar furgo16 commented on May 29, 2024

... but apparently they don't get used if Bitmaps/Theme/ThemeSearchPaths is true? In my case there is no setting defined.

That was the same behavior on my system. Before I created the property, the two icons distributed with FreeCAD were not used, so I assume if Bitmaps/Theme/ThemeSearchPath is not defined, it defaults to 'true' => use system theme icons. As per the table.

If I understand it correctly,

  1. from https://doc.qt.io/qt-5/qicon.html#fromTheme, and at least on Linux: that method is used to fetch the system icon given a descriptive string (e.g. zoom-all).

FreeCAD/src/Gui/Command.cpp

Lines 981 to 989 in 82101ac

Action * Command::createAction()
{
Action *pcAction;
pcAction = new Action(this,getMainWindow());
applyCommandData(this->className(), pcAction);
if (sPixmap)
pcAction->setIcon(Gui::BitmapFactory().iconFromTheme(sPixmap));
return pcAction;
}

Just as an example, there are other places where that method is called

Then also from the docs:

If an icon can't be found in the current theme, then it will be searched in fallbackSearchPaths() as an unthemed icon.

  1. The Icon Naming spec defines zoom-fit-best, zoom-in, zoom-original and zoom-out. Neither of those map to the zoom-all or zoom-selection strings defined in the FreeCAD code to load those icons.

  2. Despite not being a match, zoom-fit-best is the system theme icon returned when calling iconFromTheme() for either zoom-original or zoom-out.

This would mean that his bug is about finding out why 3) is happening.

from freecad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.