inline comments updated

This commit is contained in:
Uwe Rathmann 2024-02-22 12:07:59 +01:00
parent 39620bc8f0
commit 87c16d453b
2 changed files with 8 additions and 25 deletions

View File

@ -2045,21 +2045,9 @@ void QskFluent2Skin::initHints()
static inline QFont createFont( int size, int lineHeight, QFont::Weight weight ) static inline QFont createFont( int size, int lineHeight, QFont::Weight weight )
{ {
Q_UNUSED( lineHeight ); // ??? Q_UNUSED( lineHeight ); // TODO ...
const int pixelSize = qRound( qskPxToPixels( size ) ); const int pixelSize = qRound( qskPxToPixels( size ) );
/*
Font size determines how big or small the letters are, while line height
controls the vertical space between the lines of text.
https://doc.qt.io/qt-6/qfont.html#details:
"It is possible to set the height of characters shown on the screen
to a specified number of pixels with setPixelSize()"
https://doc.qt.io/qt-5/qfontmetrics.html#lineSpacing:
"This value is always equal to leading()+height()"
*/
QFont font( QStringLiteral( "Segoe UI" ), -1, weight ); QFont font( QStringLiteral( "Segoe UI" ), -1, weight );
static bool checkFont = true; static bool checkFont = true;

View File

@ -3,6 +3,11 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
/*
Definitions ( where possible ) taken from
https://www.figma.com/file/O4H724CKmUVPocw6JoSUrd/Material-3-Design-Kit-(Community)
*/
#include "QskMaterial3Skin.h" #include "QskMaterial3Skin.h"
#include <QskSkinHintTableEditor.h> #include <QskSkinHintTableEditor.h>
@ -65,11 +70,8 @@ namespace
{ {
using F = QskFontRole; using F = QskFontRole;
/* // M3 font roles: https://m3.material.io/styles/typography/type-scale-tokens
Material 3 font roles according to:
https://m3.material.io/styles/typography/overview
https://www.figma.com/file/O4H724CKmUVPocw6JoSUrd/Material-3-Design-Kit-(Community)?type=design&node-id=49848-6285&mode=design
*/
constexpr F LabelSmall = { F::Caption, F::Low }; constexpr F LabelSmall = { F::Caption, F::Low };
constexpr F LabelMedium = { F::Caption, F::Normal }; constexpr F LabelMedium = { F::Caption, F::Normal };
constexpr F LabelLarge = { F::Caption, F::High }; constexpr F LabelLarge = { F::Caption, F::High };
@ -1434,13 +1436,6 @@ static inline QFont createFont( int size, int lineHeight,
{ {
Q_UNUSED( lineHeight ); Q_UNUSED( lineHeight );
/*
sp (Scaleable Pixels OR scale-independent pixels) this is
like the dp unit, but it is also scaled by the users font size preference.
It is recommended you use this unit when specifying font sizes, so they will
be adjusted for both the screen density and users preference.
*/
const int pixelSize = qRound( qskDpToPixels( size ) ); const int pixelSize = qRound( qskDpToPixels( size ) );
QFont font( QStringLiteral( "Roboto" ), -1, weight ); QFont font( QStringLiteral( "Roboto" ), -1, weight );