Commit Graph

67 Commits

Author SHA1 Message Date
forbes
99f2a92df4 fix(gui): make SVG icon rasterization DPI-aware in loadPixmap (#189)
loadPixmap() rendered all SVGs at a hardcoded 64x64 pixels regardless of
display DPI. On HiDPI screens, Qt then downscaled these low-resolution
pixmaps to the toolbar icon size, producing chunky/aliased icons.

Multiply the render size by getMaximumDPR() and tag the resulting pixmap
with the correct devicePixelRatio, matching the pattern already used in
pixmapFromSvg(const char* name, QSizeF size). This ensures SVGs are
rasterized at the physical resolution needed for crisp display.
2026-02-18 12:52:14 -06:00
forbes
d7b532255b feat(icons): add icon theming infrastructure with Catppuccin color remapping
Some checks failed
Build and Test / build (pull_request) Has been cancelled
- Remove hand-crafted kindred-icons/ in favor of auto-generated themed icons
- Add icons/mappings/ with FCAD.csv (Tango palette) and kindred.csv (Catppuccin Mocha)
- Add icons/retheme.py script to remap upstream FreeCAD SVG colors
- Generate icons/themed/ with 1,595 themed SVGs (45,300 color replacements)
- BitmapFactory loads icons/themed/ as highest priority before default icons
- 157-color mapping covers the full Tango palette, interpolating between
  4 luminance anchors per color family

Regenerate: python3 icons/retheme.py
2026-02-15 20:34:22 -06:00
forbes
5456ffb34f cherry-pick #11: Catppuccin icon override infrastructure (224feda4ad)
BitmapFactory.cpp: load icons from kindred-icons/ dir before built-in resources.
2026-02-13 14:07:27 -06:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Markus Reitböck
6ef07bb358 Gui: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:03 +02:00
Kacper Donat
53737ed389 Gui: Add BitmapFactory::empty method
This adds empty(QSize) method to bitmap factory that creates empty
pixmap. This may seem useless, but after creating bitmap one needs to
remember to clear it and to properly set DPR - BitmapFactory will take
care of it.
2025-06-09 12:20:08 -04:00
Kacper Donat
9baeb6e9e6 Gui: Add support for hints in status bar 2025-05-21 17:42:45 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
captain0xff
d4de12061e Gui: make BitmapFactory::pixmapFromSvg dpi aware
added getMaximumDPR method and removed a overload of pixmapFromSvg with dpr parameter

update
2025-04-03 19:55:27 +05:30
Andrea
da66720d3a REMOVE old QT<= 5.14 code
Ubuntu 22.04  use qt 1.15.3.
In the code is still used qt code <5.10.
A cleanup was done by removing qT code version used in ubuntu 18.04.
2025-03-05 09:32:06 +01:00
Benjamin Bræstrup Sayoc
f647d4a1eb Gui: Use QStringLiteral 2025-02-10 18:34:57 +01:00
wmayer
63ad7d3fea Gui: Do not ignore alpha channel when converting QImage to SoSFImage
Fixes #18213: Sketcher constraints have black box backgrounds
2024-12-01 20:14:00 -05:00
wmayer
a372678e98 Gui: Support of converting 64-bit images 2024-11-28 19:41:18 +01:00
Chris Mayo
fbeaeee7e7 Remove xpmMap from BitmapFactory
No longer used since:
6ca8b2daae ("update hardcoded XPMs to .svg files. Updated .svg icons for clarity.", 2024-03-23)
2024-11-15 12:05:57 -05:00
Kacper Donat
b4923d1c58 Gui: Use FreeCAD Theme only for FreeCAD stuff 2024-09-14 17:38:47 +02:00
Max Wilfinger
6ca8b2daae update hardcoded XPMs to .svg files. Updated .svg icons for clarity. 2024-03-30 11:25:13 +01:00
wmayer
1eea88a8b7 Gui: add overloaded method pixmapFromSvg() to pass the device pixel ratio of a widget 2024-03-28 07:27:29 +01:00
wmayer
54bb9c9c62 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
berniev
75acacd1b7 Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
2022-09-14 13:25:13 -05:00
wmayer
ea5a0371a3 Gui: [skip ci] fix UTF-8 handling of icon resources 2022-08-20 15:47:07 +02:00
berniev
656ef8961f Gui: redundant void 2 2022-08-08 10:21:44 +02:00
Uwe
1d95c26e2e [Gui] remove more superfluous nullptr checks 2022-07-18 03:34:22 +02:00
Uwe
316a869b26 [Gui] remove superfluous nullptr checks 2022-07-18 03:17:42 +02:00
0penBrain
95a98669a4 Gui: implement temporary blocker for console observer 2022-07-05 13:35:18 +02:00
0penBrain
3fe4e4b6a6 [BUGFIX] Gui: correctly save and restore warning type enabling in report view 2022-07-05 13:35:18 +02:00
wmayer
d5921e08ec fix (Qt) issues found by clang's clazy tool:
+ -Wclazy-incorrect-emit
+ -Wclazy-strict-iterators
+ -Wclazy-overloaded-signal
+ -Wclazy-qstring-arg
+ -Wclazy-unused-non-trivial-variable
+ -Wclazy-container-anti-pattern
+ -Wclazy-range-loop-reference
+ -Wclazy-const-signal-or-slot
+ -Wclazy-detaching-temporary
+ -Wclazy-qfileinfo-exists
2022-06-29 21:00:54 +02:00
wmayer
96adb98f46 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
Uwe
7cc9261182 [Gui] Application, command etc: remove unused includes 2022-02-20 22:41:34 +01:00
wmayer
09da245af9 App: harmonize API of App::Application
* make getHomePath() static and return a std::string
* make getExecutableName() static and return a std::string
2021-11-04 10:50:09 +01:00
Chris Hennes
50c7ee36bf [GUI] Remove code for Qt < 5.9 2021-04-02 10:10:37 +02:00
Vanuan
7a0aec1210 High DPI support: Convert sketcher cursors to SVG
Remove xpm
2020-08-19 19:59:13 +02:00
wmayer
48f9085746 LGTM: [skip ci] fix: Local variable hides global variable
A local variable or parameter that hides a global variable of the same name.
This may be confusing. Consider renaming one of the variables.
2020-07-26 19:30:24 +02:00
wmayer
eced6aaed1 Qt5: 'int QImage::byteCount() const' is deprecated since Qt 5.10: Use sizeInBytes [-Wdeprecated-declarations] 2020-06-12 17:51:33 +02:00
wmayer
3490adf7da [skip ci] when converting from SoSFImage to QImage check that the internal buffer is not null 2019-12-09 17:53:52 +01:00
ezzieyguywuf
f27e4590a6 Refactor and rename ConsoleObserver...
...Renamed to "ILogger", to designate that this is an Interface for a
Logger. This "Interface" is pure virtual, so that it cannot be
instantiated directly. This makes it clear that it is intended to be
derived.

Finally, got rid of all the individual log-style methods and replaced
with SendLog. The idea here is that day-to-day users will only interact
with ILogger through ConsoleSingleton (or, likely, LoggerSingleton in
the future). This singleton will manage an arbirtary collection of
ILogger, and call SendLog with the appropriate parameters based on what
the user requests.

Therefore, the singleton itself will have the individual Log, Message,
Error, etc... methods, while stil allowing us to simplify the code base
of ILogger and its derived classes.
2019-10-20 11:46:15 +02:00
Abdullah Tahiri
db5ef314bf Gui: BitmapFactory new static function to make icon overlays with pixmaps 2019-06-23 01:03:35 +02:00
wmayer
a14b99e774 improve drawing of overlay pixmaps for high DPI screens 2019-03-14 18:32:21 +01:00
wmayer
337c9c936f fix various flaws detected by PVS 2019-03-01 22:52:41 +01:00
Mateusz Skowroński
317bcd59c9 Use QString's multi-arg overload to save memory allocations. [-Wclazy-qstring-arg] Thanks Clazy! 2019-02-11 15:39:14 +01:00
wmayer
57e71e5d55 port C++ code to Qt5 2016-12-13 14:22:59 +01:00
wmayer
40bba1b2e0 activate new icons and remove old icons 2016-08-19 17:08:02 +02:00
wmayer
747bae61dc activate new icons and remove old icons 2016-08-19 16:21:37 +02:00
maurerpe
e1f3fe1be4 Change numBytes() to byteCount()
numBytes() is obsolete in Qt 4.8 and removed in Qt5.  byteCount() is a
drop in replacement that works in 4.8 and 5.
2016-02-24 23:56:25 +01:00
Mateusz Skowroński
cd2db00f22 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:25 +01:00
Mateusz Skowroński
43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
wmayer
433efbc115 + fix possible crash in debug mode 2015-09-20 16:59:17 +02:00
wmayer
26b424e776 + support of exclusive Python command groups 2015-09-02 22:52:04 +02:00
wmayer
cd0b369425 + issue #0002053: Support of themes 2015-06-28 23:30:42 +02:00
wmayer
0e91902e74 + move to Qt's built-in search system for icon resources 2015-04-14 11:37:24 +02:00
wmayer
f19fe1f8ed + improve loading SVG files in debug mode 2015-02-01 11:14:00 +01:00