Martchus
3c22745d74
Improve code for initializing language selection
...
* Simplify code and improve style
* Use QRegularExpression instead of deprecated QRegExp
* Use QStringLiteral and QLatin1String where appropriate
* Avoid compiling the regex in every loop iteration
2023-06-22 21:17:12 +02:00
Martchus
658708d59b
Improve handling of data directory
...
* Avoid hard-coding prefix at build time; always use a relative path so the
build can always be relocated and not AppImage-specific code is needed
* Avoid special handling for MacOS every time the data directory is used;
handle the case of MacOS in the utility function itself
2023-06-22 21:17:12 +02:00
Martchus
979d92a971
Use `qEnvironmentVariable()` for reading an env variable as `QString`
...
This is the best function to call in this case according to the
documentation.
2023-06-22 20:08:08 +02:00
Martchus
1648807059
Add UI settings via Qt Utilities
...
It is likely best to apply these settings before instantiating the main
window. So this change moves out the instantiation of settings objects to
the main function.
2023-06-12 23:36:44 +02:00
Martchus
eb0111dd7b
Fix wrong usage of `QObject` leading to warnings
...
Classes inheriting from `QObject` must use the `Q_OBJECT` macro. This was
not the case and thus causing warnings. Since the `QObject` base class was
not utilized here anyways except for `tr()` I simply removed the that
inheritance.
2023-06-12 22:49:11 +02:00
Martchus
c787b1bc7c
Fix warning about missing reference in range-based for loop
2023-06-12 22:28:03 +02:00
Martchus
6d0944dd9e
Fix build without FTGL
2023-06-06 00:19:21 +02:00
Martchus
7d0f5faf23
Build translations via helper from qtutilities
...
It handles the case of cross-compilation correctly and this way also code
for handling different Qt versions can be removed.
2023-06-06 00:10:51 +02:00
Martchus
17c3a3c584
Enable target to invoke cmake-format via c++utilities and apply formatting
2023-06-05 22:50:36 +02:00
Martchus
370304e576
Simplify main, use version from meta-data defined in CMake
...
* Simplify code
* Set meta-data for Qt application via helpers from c++utilities and
qtutilities
* Set sensible default settings for Qt via helper from qtutilities for more
modern behavior regarding High DPI scaling and theming, e.g. for better
dark mode support under Windows 11
2023-06-05 22:43:41 +02:00
Martchus
8dfca58470
Avoid boilerplate code in build script utilizing c++utilities/qtutilities
...
* Prepare use of qtutilities for improving UI
* Remove code for enabling warnings that has been copied from c++utilities
* Remove code for various details now handled in qtutilities helpers
* Simplify configuration of executable
* Simplify finding Qt modules
2023-06-05 22:10:11 +02:00
gjdv
10363f312b
finalize editable clefs
2023-06-05 20:27:46 +02:00
gjdv
462d8128ee
first attempt to have editable clefs
2023-06-05 20:27:46 +02:00
Martchus
26a67310bb
Make text color themable as well and extend light theme
2023-06-05 20:27:46 +02:00
Martchus
f5d2b2ac1c
Avoid compilation error on MacOS build
...
Prevents
```
/Users/runner/work/PianoBooster/PianoBooster/src/Cfg.h:77:5: error: defaulted definition of copy assignment operator is not constexpr
constexpr ColorTheme &operator=(const ColorTheme &other) = default;
^
```
2023-06-05 20:27:46 +02:00
Martchus
93ba642355
Tweak light theme further
2023-06-05 20:27:46 +02:00
Martchus
fb553cf3d0
Make colors for "playing zone" configurable
2023-06-05 20:27:46 +02:00
Martchus
e568df1e8a
Avoid implicit signness conversion
2023-06-05 20:27:46 +02:00
Martchus
38fd083e7a
Draw background of keyboard so it looks good regardless of theme
2023-06-05 20:27:46 +02:00
Martchus
724548a8b1
Add header files to target so they show up in IDE's such as Qt Creator
2023-06-05 20:27:46 +02:00
Martchus
48a597a1a6
Remember the selected theme
2023-06-05 20:27:46 +02:00
Martchus
cc291bf432
Improve coding style in `setNoteColor()`
...
* Use white-spaces in consistency with other functions defined here
* Check for `note == 0` first as it is the simpler check
2023-06-05 20:27:46 +02:00
Martchus
04b4e3d56d
Add very basic configuration for theming and a light theme
...
* Allow selecting between built-in themes via "View" menu
* Add basic mechanism to apply color changes at runtime
* Add a basic light theme (needs still tweaking)
2023-06-05 20:27:46 +02:00
Martchus
35c01b9382
Refactor color definitions to make them easier exchangable
2023-06-05 20:27:46 +02:00
Martchus
36b970ebcb
Modernize `CColor` class
...
* Use `constexpr`
* Add c'tor for `float` to avoid unnecassary conversions if arguments are
already `float`
* Simplify syntax in `operator==`
2023-06-05 20:27:46 +02:00
Martchus
39882a6db6
Link against FluidSynth's imported target and find its dependencies
...
* Link against FluidSynth at all (not sure how the Windows build has with
FluidSynth enabled has ever been working without actually linking to the
FluidSynth's library)
* The imported target of FluidSynth does not automatically make the targets
it depends on available. So we need to find the according packages
manually.
2023-06-05 20:27:46 +02:00
Martchus
fab9af593e
Remove `using namespace std` to fix building with mingw-w64
...
Using `using namespace std;` is a bad practice, especially in header files
as it can lead to name collisions. In this case `std::byte` (from C++ 17)
collided with `typedef unsigned char byte` (from the Windows header
`rpcndr.h`) leading to many build errors.
2023-06-05 20:27:46 +02:00
Martchus
3f482e49c7
Add include path of FreeType 2 as FTGL does not pull it in automatically
...
Apparently FTGL's CMake find module does not pull in the include path for
FreeType 2 headers automatically. So we need to do that manually on our
own. This code is relying on pkg-config for finding the include path. As
pkg-config has been intentionally avoided for Windows builds I only enabled
this for mingw-w64 builds so far (where pkg-config is usually available).
2023-06-05 20:27:46 +02:00
Martchus
79c985adbf
Fix casing of CMake modules to allow cross-compilation for Windows under Linux
...
The filesystem on Linux is case-sensitive so we need to get the casing
right when compiling on Linux for Windows.
2023-06-05 20:27:46 +02:00
Capitaine Fab
6dafdcbdfc
Merge pull request #327 from Martchus/coding-style
...
Improve coding style
2023-01-22 22:29:58 +01:00
Martchus
54c843adc4
Avoid implicit signness conversions
2023-01-22 19:33:02 +01:00
Martchus
d951c3b6fa
Use C++ style includes for standard headers consistently
2023-01-22 19:33:02 +01:00
Capitaine Fab
a1dfa18e05
Merge pull request #324 from pianobooster/weblate-pianobooster-pianobooster
...
Weblate pianobooster pianobooster
2023-01-16 23:30:47 +01:00
Yuri Chornoivan
bd54e951d6
Translated using Weblate (Ukrainian)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/uk/
2023-01-16 23:26:35 +01:00
Dan
16dd600f68
Translated using Weblate (Ukrainian)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/uk/
2023-01-16 23:26:35 +01:00
poi
a2a94fd22a
Translated using Weblate (Chinese (Simplified))
...
Currently translated at 81.3% (305 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/zh_Hans/
2023-01-16 23:26:35 +01:00
Magnus Johansson
b6beee254d
Translated using Weblate (Swedish)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/sv/
2023-01-16 23:26:35 +01:00
Magnus Johansson
14dd1bf02f
Translated using Weblate (Swedish)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/sv/
2023-01-16 23:26:35 +01:00
Magnus Johansson
2d4975321f
Translated using Weblate (Swedish)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/sv/
2023-01-16 23:26:35 +01:00
Darío Hereñú
9d23dd17ab
Translated using Weblate (Spanish)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/es/
2023-01-16 23:26:35 +01:00
poi
d4551621b9
Translated using Weblate (Chinese (Simplified))
...
Currently translated at 71.4% (268 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/zh_Hans/
2023-01-16 23:26:35 +01:00
Iñaki Ibarrola Atxa
d88400c190
Translated using Weblate (Basque)
...
Currently translated at 34.9% (131 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/eu/
2023-01-16 23:26:35 +01:00
Eric
2792e59092
Translated using Weblate (Chinese (Simplified))
...
Currently translated at 71.4% (268 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/zh_Hans/
2023-01-16 23:26:35 +01:00
poi
2344b0b89a
Translated using Weblate (Chinese (Simplified))
...
Currently translated at 71.4% (268 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/zh_Hans/
2023-01-16 23:26:35 +01:00
Reza Almanda
98c7fb8ddc
Translated using Weblate (Indonesian)
...
Currently translated at 21.8% (82 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/id/
2023-01-16 23:26:35 +01:00
Jonatan Nyberg
59afb5eaca
Translated using Weblate (Swedish)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/sv/
2023-01-16 23:26:35 +01:00
Jonatan Nyberg
7e2324564b
Translated using Weblate (Swedish)
...
Currently translated at 97.0% (364 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/sv/
2023-01-16 23:26:35 +01:00
عبدالرئوف عابدی
9db4f9d0b1
Translated using Weblate (Persian)
...
Currently translated at 18.1% (68 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/fa/
2023-01-16 23:26:35 +01:00
Lucas
9f9b2d901a
Translated using Weblate (Portuguese)
...
Currently translated at 100.0% (375 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/pt/
2023-01-16 23:26:35 +01:00
Lucas
ad35847806
Translated using Weblate (Portuguese)
...
Currently translated at 91.2% (342 of 375 strings)
Translation: PianoBooster/PianoBooster
Translate-URL: https://hosted.weblate.org/projects/pianobooster/pianobooster/pt/
2023-01-16 23:26:35 +01:00