Squashed commit of the following:
commitc331fd601a
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Dec 10 12:17:51 2024 +0100 use enums for class members commit0d86454774
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Dec 10 11:27:16 2024 +0100 elide mode for QskTextField::PlaceholderText added commit0038f6d3b3
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 16:03:55 2024 +0100 more enums specified commit5d95913366
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 15:56:49 2024 +0100 QskSizePolicy enums specified commit4220edc7ca
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 15:46:43 2024 +0100 don't use enum bitfields for unspecied enums commit36f502b57a
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 15:43:57 2024 +0100 QskItem::UpdateFlags sepcified commit23beda3c28
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 15:39:06 2024 +0100 more enum types specified commit0849571523
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 15:21:37 2024 +0100 enum types specified commitd53579f3d9
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 15:04:37 2024 +0100 enum types specified commit4e6ee36420
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 14:53:59 2024 +0100 NodeRole enums qualified as quint8 commit3a83f5fa2c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 13:29:03 2024 +0100 compiler errors fixed commitd1fa0207fa
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 12:10:10 2024 +0100 Markdown format added commit66d97831b5
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 12:01:16 2024 +0100 QskTextColors is a Q_GADGET now commit4ad28e6076
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 9 10:04:33 2024 +0100 don't show the placeholder when text is not empty commitb6f2003826
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Wed Dec 4 10:08:39 2024 +0100 QskTextFieldSkinlet::sizeHint added commitf0d53322aa
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Dec 3 17:52:39 2024 +0100 gallery updated, dummy TextFieldSkinlets introduced commite86378a072
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Dec 3 13:33:17 2024 +0100 fusion skin improved commit4540cc1e4e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Dec 3 10:06:26 2024 +0100 QskTextFieldSkinlet::Selected state introduced commit77e556fad2
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Dec 3 09:32:39 2024 +0100 QskTextField::placeholderText introduced, QskTextField::description removed commit77739d7734
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Dec 3 07:44:44 2024 +0100 skin hint table size reduced commit108aa23397
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Dec 2 12:54:31 2024 +0100 QskTextInput renamed to QskTextField ( term used by F2/M3 and QC2 ) commitb0864965a8
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Sun Dec 1 11:06:51 2024 +0100 Material3 adjustements for progress bars commitd18017ca90
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Fri Nov 29 13:55:30 2024 +0100 QskProgressRing fixed + M3 updates commita58d6dd589
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Fri Nov 29 09:42:01 2024 +0100 QskProgressIndicator::hasOrigin(), QskSlider::hasOrigin added commit12dfac153d
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 28 16:06:00 2024 +0100 QskSlider::inverted introduced commitdb1e9a7e44
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 28 15:59:59 2024 +0100 key handling of bounded inputs improved commitd9a66e4a98
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 28 15:55:57 2024 +0100 QskSlider API cleanup commit9d13cd1edf
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 28 15:47:20 2024 +0100 subcontrol renamed from Knob to Handle commit7a180cfe5e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 28 12:00:46 2024 +0100 the corrected mouse/touch handling works without extending the handle selection area handle selection commit66085ea41f
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Wed Nov 27 16:27:57 2024 +0100 QskSlider::origin implemented commite2c76aa121
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Wed Nov 27 16:24:55 2024 +0100 QskSlider ticks implementaton completed commit77731954eb
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Nov 26 13:59:42 2024 +0100 slider changes on press commit59b88ffd7c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Nov 26 13:57:13 2024 +0100 slider layout code fixed commitcd65adb451
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Tue Nov 26 13:48:55 2024 +0100 QskSkinnable::metric with default value commitea3d7a5e69
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Nov 25 09:02:04 2024 +0100 QskInterval::center(), QskInterval::stretch removed as they the implementation is only handling normalized intervals commit494c370e61
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Fri Nov 22 17:38:58 2024 +0100 ticks for F2 sliders commitf4c2211f2c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Fri Nov 22 17:37:47 2024 +0100 API extended commit5c1e0ccad4
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 21 19:19:53 2024 +0100 invalid constexpr qualifier removed commit9a5dd886ed
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 21 17:59:54 2024 +0100 slider ticks - not only for M3 commitd04c030924
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 21 17:59:37 2024 +0100 using constexpr commitd87c8e3d0b
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 21 13:54:01 2024 +0100 API cleanup of the Bounded controls commit109fc7d7f4
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Wed Nov 20 14:57:16 2024 +0100 QskBoxClipNode renamed to QskClipNode + more clip options added commit1e383406e2
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Wed Nov 20 11:00:17 2024 +0100 M3 specific definitions moved to M3 classes commit97e3ea6e1f
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Nov 18 16:44:06 2024 +0100 Qt5 incompatibility fixed commit00f2112817
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Mon Nov 18 16:15:50 2024 +0100 QskMaterial3SliderSkinlet introduced commit9fc7b1f677
Author: Peter Hartmann <peter@edelhirsch.io> Date: Mon Nov 18 12:18:30 2024 +0100 push buttons: Style checked state properly (#477) Resolves #367 commitb5c56f7f80
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 14 10:52:08 2024 +0100 mismatch between allocated and used memory fixed commitd1c2751a8e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 14 10:51:53 2024 +0100 nullptr check added commit8dd5a7b249
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 14 08:52:40 2024 +0100 dangling reference fixed commitbaaccb2f41
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 14 07:43:34 2024 +0100 avoid enum bitfields commit7f389ef6cc
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Wed Nov 13 14:11:11 2024 +0100 don't subtract the slider margins twice commitd84ab6e387
Author: Peter Hartmann <peter@edelhirsch.io> Date: Wed Nov 13 10:00:38 2024 +0100 Update instructions on how to build the website (#470) * Regenerate doxygen file ... and change some things * Add custom stylesheet from Skia * update instructions on how to build the website commit525ca3bd0e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de> Date: Thu Nov 7 17:31:14 2024 +0100 QskSlider: Adapt to new Material3 style ( ValueLabel a.k.a Tooltip is not done yet )
This commit is contained in:
parent
128ce8f79b
commit
8d780244b6
|
@ -3,13 +3,27 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
############################################################################
|
||||
|
||||
set(SOURCES
|
||||
QskFluent2Global.h
|
||||
QskFluent2Theme.h QskFluent2Theme.cpp
|
||||
QskFluent2Skin.h QskFluent2Skin.cpp
|
||||
QskFluent2SkinFactory.h QskFluent2SkinFactory.cpp
|
||||
list(APPEND HEADERS
|
||||
QskFluent2Global.h QskFluent2Theme.h QskFluent2SkinFactory.h
|
||||
)
|
||||
|
||||
list(APPEND PRIVATE_HEADERS
|
||||
QskFluent2TextFieldSkinlet.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES
|
||||
QskFluent2Theme.cpp
|
||||
QskFluent2Skin.cpp
|
||||
QskFluent2SkinFactory.cpp
|
||||
QskFluent2TextFieldSkinlet.cpp
|
||||
)
|
||||
|
||||
qt_add_resources(SOURCES QskFluent2Icons.qrc)
|
||||
|
||||
qsk_add_plugin(fluent2skin skins QskFluent2SkinFactory ${SOURCES})
|
||||
set_target_properties(fluent2skin PROPERTIES DEFINE_SYMBOL QSK_FLUENT2_MAKEDLL )
|
||||
qsk_add_plugin(fluent2skin skins QskFluent2SkinFactory
|
||||
${SOURCES} ${HEADERS} ${PRIVATE_HEADERS}
|
||||
)
|
||||
|
||||
set_target_properties(fluent2skin PROPERTIES
|
||||
DEFINE_SYMBOL QSK_FLUENT2_MAKEDLL
|
||||
)
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
*/
|
||||
#include "QskFluent2Skin.h"
|
||||
#include "QskFluent2Theme.h"
|
||||
#include "QskFluent2TextFieldSkinlet.h"
|
||||
|
||||
#include <QskSkinHintTableEditor.h>
|
||||
|
||||
|
@ -78,7 +79,7 @@
|
|||
#include <QskTabBar.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextField.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskVirtualKeyboard.h>
|
||||
|
||||
|
@ -296,8 +297,8 @@ namespace
|
|||
void setupTabViewMetrics();
|
||||
void setupTabViewColors( QskAspect::Section, const QskFluent2Theme& );
|
||||
|
||||
void setupTextInputMetrics();
|
||||
void setupTextInputColors( QskAspect::Section, const QskFluent2Theme& );
|
||||
void setupTextFieldMetrics();
|
||||
void setupTextFieldColors( QskAspect::Section, const QskFluent2Theme& );
|
||||
|
||||
void setupTextLabelMetrics();
|
||||
void setupTextLabelColors( QskAspect::Section, const QskFluent2Theme& );
|
||||
|
@ -355,7 +356,7 @@ void Editor::setupMetrics()
|
|||
setupTabButtonMetrics();
|
||||
setupTabBarMetrics();
|
||||
setupTabViewMetrics();
|
||||
setupTextInputMetrics();
|
||||
setupTextFieldMetrics();
|
||||
setupTextLabelMetrics();
|
||||
setupVirtualKeyboardMetrics();
|
||||
}
|
||||
|
@ -394,7 +395,7 @@ void Editor::setupColors( QskAspect::Section section, const QskFluent2Theme& the
|
|||
setupTabButtonColors( section, theme );
|
||||
setupTabBarColors( section, theme );
|
||||
setupTabViewColors( section, theme );
|
||||
setupTextInputColors( section, theme );
|
||||
setupTextFieldColors( section, theme );
|
||||
setupTextLabelColors( section, theme );
|
||||
setupVirtualKeyboardColors( section, theme );
|
||||
};
|
||||
|
@ -1771,9 +1772,9 @@ void Editor::setupTextLabelColors(
|
|||
setColor( Q::Text | section, pal.fillColor.text.primary );
|
||||
}
|
||||
|
||||
void Editor::setupTextInputMetrics()
|
||||
void Editor::setupTextFieldMetrics()
|
||||
{
|
||||
using Q = QskTextInput;
|
||||
using Q = QskTextField;
|
||||
|
||||
setStrutSize( Q::Panel, { -1, 30_px } );
|
||||
setPadding( Q::Panel, { 11_px, 0, 11_px, 0 } );
|
||||
|
@ -1786,18 +1787,23 @@ void Editor::setupTextInputMetrics()
|
|||
|
||||
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
|
||||
setFontRole( Q::Text, Fluent2::Body );
|
||||
|
||||
setAlignment( Q::PlaceholderText, alignment( Q::Text ) );
|
||||
setFontRole( Q::PlaceholderText, fontRole( Q::Text ) );
|
||||
}
|
||||
|
||||
void Editor::setupTextInputColors(
|
||||
void Editor::setupTextFieldColors(
|
||||
QskAspect::Section section, const QskFluent2Theme& theme )
|
||||
{
|
||||
using Q = QskTextInput;
|
||||
using Q = QskTextField;
|
||||
using SK = QskTextFieldSkinlet;
|
||||
using A = QskAspect;
|
||||
|
||||
const auto& pal = theme.palette;
|
||||
|
||||
setColor( Q::PanelSelected, pal.fillColor.accent.selectedTextBackground );
|
||||
setColor( Q::TextSelected, pal.fillColor.textOnAccent.selectedText );
|
||||
setColor( Q::Panel | SK::Selected, pal.fillColor.accent.selectedTextBackground );
|
||||
setColor( Q::Text | SK::Selected, pal.fillColor.textOnAccent.selectedText );
|
||||
setColor( Q::PlaceholderText, pal.fillColor.text.secondary );
|
||||
|
||||
for( const auto state : { A::NoState, Q::Hovered, Q::Focused, Q::Editing, Q::Disabled } )
|
||||
{
|
||||
|
@ -1808,21 +1814,21 @@ void Editor::setupTextInputColors(
|
|||
panelColor = pal.fillColor.control.defaultColor;
|
||||
borderColor1 = pal.elevation.textControl.border[0];
|
||||
borderColor2 = pal.elevation.textControl.border[1];
|
||||
textColor = pal.fillColor.text.secondary;
|
||||
textColor = pal.fillColor.text.primary;
|
||||
}
|
||||
else if ( state == Q::Hovered )
|
||||
{
|
||||
panelColor = pal.fillColor.control.secondary;
|
||||
borderColor1 = pal.elevation.textControl.border[0];
|
||||
borderColor2 = pal.elevation.textControl.border[1];
|
||||
textColor = pal.fillColor.text.secondary;
|
||||
textColor = pal.fillColor.text.primary;
|
||||
}
|
||||
else if ( ( state == Q::Focused ) || ( state == Q::Editing ) )
|
||||
{
|
||||
panelColor = pal.fillColor.control.inputActive;
|
||||
borderColor1 = pal.elevation.textControl.border[0];
|
||||
borderColor2 = pal.fillColor.accent.defaultColor;
|
||||
textColor = pal.fillColor.text.secondary;
|
||||
textColor = pal.fillColor.text.primary;
|
||||
}
|
||||
else if ( state == Q::Disabled )
|
||||
{
|
||||
|
@ -2027,6 +2033,8 @@ void Editor::setupVirtualKeyboardColors(
|
|||
QskFluent2Skin::QskFluent2Skin( QObject* parent )
|
||||
: Inherited( parent )
|
||||
{
|
||||
declareSkinlet< QskTextField, QskFluent2TextFieldSkinlet >();
|
||||
|
||||
setupFonts();
|
||||
|
||||
Editor editor( &hintTable() );
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) The authors
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskFluent2TextFieldSkinlet.h"
|
||||
#include "QskTextField.h"
|
||||
|
||||
using Q = QskTextField;
|
||||
|
||||
QskFluent2TextFieldSkinlet::QskFluent2TextFieldSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
}
|
||||
|
||||
QskFluent2TextFieldSkinlet::~QskFluent2TextFieldSkinlet()
|
||||
{
|
||||
}
|
||||
|
||||
QRectF QskFluent2TextFieldSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
return Inherited::subControlRect( skinnable, contentsRect, subControl );
|
||||
}
|
||||
|
||||
#include "moc_QskFluent2TextFieldSkinlet.cpp"
|
|
@ -0,0 +1,26 @@
|
|||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) The authors
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef QSK_FLUENT2_TEXTFIELD_SKINLET_H
|
||||
#define QSK_FLUENT2_TEXTFIELD_SKINLET_H
|
||||
|
||||
#include "QskFluent2Global.h"
|
||||
#include "QskTextFieldSkinlet.h"
|
||||
|
||||
class QSK_FLUENT2_EXPORT QskFluent2TextFieldSkinlet : public QskTextFieldSkinlet
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
using Inherited = QskTextFieldSkinlet;
|
||||
|
||||
public:
|
||||
Q_INVOKABLE QskFluent2TextFieldSkinlet( QskSkin* = nullptr );
|
||||
~QskFluent2TextFieldSkinlet() override;
|
||||
|
||||
QRectF subControlRect( const QskSkinnable*,
|
||||
const QRectF& rect, QskAspect::Subcontrol ) const override;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -42,7 +42,8 @@
|
|||
#include <QskTabBar.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextField.h>
|
||||
#include <QskTextFieldSkinlet.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskVirtualKeyboard.h>
|
||||
|
||||
|
@ -141,7 +142,7 @@ namespace
|
|||
Q_INVOKABLE void setupTabButton();
|
||||
Q_INVOKABLE void setupTabBar();
|
||||
Q_INVOKABLE void setupTabView();
|
||||
Q_INVOKABLE void setupTextInput();
|
||||
Q_INVOKABLE void setupTextField();
|
||||
Q_INVOKABLE void setupTextLabel();
|
||||
|
||||
QskGraphic symbol( const char* name ) const
|
||||
|
@ -382,26 +383,30 @@ void Editor::setupTextLabel()
|
|||
setBoxBorderColors( Q::Panel, QskRgb::lighter( m_pal.outline, 108 ) );
|
||||
}
|
||||
|
||||
void Editor::setupTextInput()
|
||||
void Editor::setupTextField()
|
||||
{
|
||||
using Q = QskTextInput;
|
||||
using Q = QskTextField;
|
||||
using SK = QskTextFieldSkinlet;
|
||||
using A = QskAspect;
|
||||
using P = QPalette;
|
||||
|
||||
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignTop );
|
||||
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
|
||||
setAlignment( Q::PlaceholderText, Qt::AlignLeft | Qt::AlignVCenter );
|
||||
|
||||
for ( auto state : { A::NoState, Q::Disabled } )
|
||||
{
|
||||
const auto colorGroup = ( state == A::NoState ) ? P::Active : P::Disabled;
|
||||
|
||||
setGradient( Q::Panel | state, m_pal.color( colorGroup, P::Base ) );
|
||||
setColor( Q::PanelSelected | state, m_pal.color( colorGroup, P::Highlight ) );
|
||||
setColor( Q::Panel | state, m_pal.color( colorGroup, P::Base ) );
|
||||
setColor( Q::Panel | SK::Selected | state, m_pal.color( colorGroup, P::Highlight ) );
|
||||
|
||||
setColor( Q::Text | state, m_pal.color( colorGroup, P::Text ) );
|
||||
setColor( Q::TextSelected | state, m_pal.color( colorGroup, P::HighlightedText ) );
|
||||
|
||||
setColor( Q::Text | SK::Selected | state, m_pal.color( colorGroup, P::HighlightedText ) );
|
||||
setColor( Q::PlaceholderText, m_pal.color( colorGroup, P::PlaceholderText ) );
|
||||
}
|
||||
|
||||
setColor( Q::Panel | Q::ReadOnly, m_pal.disabled( P::Base ) );
|
||||
|
||||
setBoxBorderMetrics( Q::Panel, 1_px );
|
||||
|
||||
setBoxBorderColors( Q::Panel, m_pal.outline );
|
||||
|
@ -409,7 +414,7 @@ void Editor::setupTextInput()
|
|||
setBoxBorderColors( Q::Panel | Q::Focused, m_pal.highlightedOutline );
|
||||
#endif
|
||||
|
||||
setBoxShape( Q::Panel, 2 );
|
||||
setBoxShape( Q::Panel, 2_px );
|
||||
setPadding( Q::Panel, 4_px );
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ list(APPEND HEADERS
|
|||
list(APPEND PRIVATE_HEADERS
|
||||
QskMaterial3ProgressBarSkinlet.h
|
||||
QskMaterial3SliderSkinlet.h
|
||||
QskMaterial3TextFieldSkinlet.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES
|
||||
|
@ -17,6 +18,7 @@ list(APPEND SOURCES
|
|||
QskMaterial3SkinFactory.cpp
|
||||
QskMaterial3ProgressBarSkinlet.cpp
|
||||
QskMaterial3SliderSkinlet.cpp
|
||||
QskMaterial3TextFieldSkinlet.cpp
|
||||
)
|
||||
|
||||
qt_add_resources(SOURCES QskMaterial3Icons.qrc)
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "QskMaterial3Skin.h"
|
||||
#include "QskMaterial3ProgressBarSkinlet.h"
|
||||
#include "QskMaterial3SliderSkinlet.h"
|
||||
#include "QskMaterial3TextFieldSkinlet.h"
|
||||
|
||||
#include <QskSkinHintTableEditor.h>
|
||||
|
||||
|
@ -45,7 +46,7 @@
|
|||
#include <QskTabBar.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextField.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskVirtualKeyboard.h>
|
||||
|
||||
|
@ -200,7 +201,7 @@ namespace
|
|||
Q_INVOKABLE void setupTabButton();
|
||||
Q_INVOKABLE void setupTabBar();
|
||||
Q_INVOKABLE void setupTabView();
|
||||
Q_INVOKABLE void setupTextInput();
|
||||
Q_INVOKABLE void setupTextField();
|
||||
Q_INVOKABLE void setupTextLabel();
|
||||
|
||||
QskGraphic symbol( const char* name ) const
|
||||
|
@ -450,13 +451,15 @@ void Editor::setupTextLabel()
|
|||
}
|
||||
|
||||
|
||||
void Editor::setupTextInput()
|
||||
void Editor::setupTextField()
|
||||
{
|
||||
using Q = QskTextInput;
|
||||
using Q = QskTextField;
|
||||
using SK = QskTextFieldSkinlet;
|
||||
|
||||
setStrutSize( Q::Panel, -1.0, 56_dp );
|
||||
setPadding( Q::Panel, { 12_dp, 8_dp, 12_dp, 8_dp } );
|
||||
setGradient( Q::Panel, m_pal.surfaceVariant );
|
||||
setColor( Q::Panel | SK::Selected, m_pal.primary12 );
|
||||
setBoxShape( Q::Panel, m_pal.shapeExtraSmallTop );
|
||||
setBoxBorderMetrics( Q::Panel, { 0, 0, 0, 1_dp } );
|
||||
setBoxBorderColors( Q::Panel, m_pal.onSurfaceVariant );
|
||||
|
@ -476,11 +479,19 @@ void Editor::setupTextInput()
|
|||
setFontRole( Q::Text, BodyMedium );
|
||||
setAlignment( Q::Text, Qt::AlignLeft | Qt::AlignVCenter );
|
||||
|
||||
setAlignment( Q::PlaceholderText, Qt::AlignLeft | Qt::AlignVCenter );
|
||||
|
||||
const auto disabledPanelColor = QskRgb::toTransparentF( m_pal.onSurface, 0.04 );
|
||||
setGradient( Q::Panel | Q::Disabled, disabledPanelColor );
|
||||
setBoxBorderColors( Q::Panel | Q::Disabled, m_pal.onSurface38 );
|
||||
|
||||
setColor( Q::Text | Q::Disabled, m_pal.onSurface38 );
|
||||
|
||||
// PlaceholderText
|
||||
|
||||
setColor( Q::PlaceholderText, color( Q::Text ) );
|
||||
setFontRole( Q::PlaceholderText, fontRole( Q::Text ) );
|
||||
setAlignment( Q::PlaceholderText, alignment( Q::Text ) );
|
||||
}
|
||||
|
||||
void Editor::setupProgressBar()
|
||||
|
@ -1069,7 +1080,6 @@ void Editor::setupSwitchButton()
|
|||
using A = QskAspect;
|
||||
using Q = QskSwitchButton;
|
||||
|
||||
const QskStateCombination allStates ( QskStateCombination::CombinationNoState, QskAspect::AllStates );
|
||||
|
||||
setBoxShape( Q::Groove, 100, Qt::RelativeSize );
|
||||
const QSizeF strutSize( 52_dp, 32_dp );
|
||||
|
@ -1085,7 +1095,7 @@ void Editor::setupSwitchButton()
|
|||
setBoxBorderColors( Q::Groove, m_pal.outline );
|
||||
setBoxBorderColors( Q::Groove | Q::Disabled, m_pal.onSurface12 );
|
||||
|
||||
setBoxBorderMetrics( Q::Groove | Q::Checked, 0, allStates );
|
||||
setBoxBorderMetrics( Q::Groove | Q::Checked, 0 );
|
||||
|
||||
setBoxShape( Q::Handle, 100, Qt::RelativeSize );
|
||||
setStrutSize( Q::Handle, { 30_dp, 30_dp } );
|
||||
|
@ -1099,11 +1109,13 @@ void Editor::setupSwitchButton()
|
|||
setStrutSize( Q::Icon, { 16_dp, 16_dp } );
|
||||
setPadding( Q::Icon, 6_dp );
|
||||
setSymbol( Q::Icon, symbol( "switchbutton-unchecked" ) );
|
||||
setSymbol( Q::Icon | Q::Checked, symbol( "switchbutton-checked" ), allStates );
|
||||
setSymbol( Q::Icon | Q::Checked, symbol( "switchbutton-checked" ) );
|
||||
|
||||
setGraphicRole( Q::Icon, QskMaterial3Skin::GraphicRoleSurfaceContainerHighest );
|
||||
setGraphicRole( Q::Icon | Q::Checked, QskMaterial3Skin::GraphicRoleOnPrimaryContainer, allStates );
|
||||
setGraphicRole( Q::Icon | Q::Disabled, QskMaterial3Skin::GraphicRoleSurfaceContainerHighest38, allStates );
|
||||
setGraphicRole( Q::Icon | Q::Checked | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38, allStates );
|
||||
|
||||
setGraphicRole( Q::Icon | Q::Checked, QskMaterial3Skin::GraphicRoleOnPrimaryContainer );
|
||||
setGraphicRole( Q::Icon | Q::Disabled, QskMaterial3Skin::GraphicRoleSurfaceContainerHighest38 );
|
||||
setGraphicRole( Q::Icon | Q::Checked | Q::Disabled, QskMaterial3Skin::GraphicRoleOnSurface38 );
|
||||
|
||||
for ( auto state1 : { A::NoState, Q::Hovered, Q::Focused, Q::Pressed } )
|
||||
{
|
||||
|
@ -1612,6 +1624,7 @@ QskMaterial3Skin::QskMaterial3Skin( QObject* parent )
|
|||
{
|
||||
declareSkinlet< QskProgressBar, QskMaterial3ProgressBarSkinlet >();
|
||||
declareSkinlet< QskSlider, QskMaterial3SliderSkinlet >();
|
||||
declareSkinlet< QskTextField, QskMaterial3TextFieldSkinlet >();
|
||||
}
|
||||
|
||||
QskMaterial3Skin::~QskMaterial3Skin()
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) The authors
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskMaterial3TextFieldSkinlet.h"
|
||||
#include "QskTextField.h"
|
||||
|
||||
QskMaterial3TextFieldSkinlet::QskMaterial3TextFieldSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
}
|
||||
|
||||
QskMaterial3TextFieldSkinlet::~QskMaterial3TextFieldSkinlet()
|
||||
{
|
||||
}
|
||||
|
||||
QRectF QskMaterial3TextFieldSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
return Inherited::subControlRect( skinnable, contentsRect, subControl );
|
||||
}
|
||||
|
||||
QSGNode* QskMaterial3TextFieldSkinlet::updateSubNode(
|
||||
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
||||
{
|
||||
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
||||
}
|
||||
|
||||
#include "moc_QskMaterial3TextFieldSkinlet.cpp"
|
|
@ -0,0 +1,30 @@
|
|||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) The authors
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef QSK_MATERIAL3_TEXTFIELD_SKINLET_H
|
||||
#define QSK_MATERIAL3_TEXTFIELD_SKINLET_H
|
||||
|
||||
#include "QskMaterial3Global.h"
|
||||
#include "QskTextFieldSkinlet.h"
|
||||
|
||||
class QSK_MATERIAL3_EXPORT QskMaterial3TextFieldSkinlet : public QskTextFieldSkinlet
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
using Inherited = QskTextFieldSkinlet;
|
||||
|
||||
public:
|
||||
Q_INVOKABLE QskMaterial3TextFieldSkinlet( QskSkin* = nullptr );
|
||||
~QskMaterial3TextFieldSkinlet() override;
|
||||
|
||||
QRectF subControlRect( const QskSkinnable*,
|
||||
const QRectF& rect, QskAspect::Subcontrol ) const override;
|
||||
|
||||
protected:
|
||||
QSGNode* updateSubNode( const QskSkinnable*,
|
||||
quint8 nodeRole, QSGNode* ) const override;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <QskGridBox.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextField.h>
|
||||
#include <QskSpinBox.h>
|
||||
|
||||
namespace
|
||||
|
@ -61,30 +61,32 @@ namespace
|
|||
}
|
||||
};
|
||||
|
||||
class InputBox : public QskLinearBox
|
||||
class TextInputBox : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
InputBox( QQuickItem* parent = nullptr )
|
||||
TextInputBox( QQuickItem* parent = nullptr )
|
||||
: QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
setSpacing( 20 );
|
||||
|
||||
{
|
||||
new QskTextInput( "Edit Me", this );
|
||||
auto textField = new QskTextField( "Joe", this );
|
||||
textField->setPlaceholderText( "<Name>" );
|
||||
}
|
||||
|
||||
{
|
||||
auto input = new QskTextInput( "Only Read Me", this );
|
||||
input->setReadOnly( true );
|
||||
input->setSizePolicy( Qt::Horizontal, QskSizePolicy::MinimumExpanding );
|
||||
auto textField = new QskTextField( "Only Read Me", this );
|
||||
textField->setReadOnly( true );
|
||||
textField->setSizePolicy( Qt::Horizontal, QskSizePolicy::MinimumExpanding );
|
||||
}
|
||||
|
||||
{
|
||||
auto input = new QskTextInput( "12345", this );
|
||||
input->setMaxLength( 5 );
|
||||
input->setEchoMode( QskTextInput::PasswordEchoOnEdit );
|
||||
auto textField = new QskTextField( "12345", this );
|
||||
textField->setPlaceholderText( "<Password>" );
|
||||
textField->setMaxLength( 5 );
|
||||
textField->setEchoMode( QskTextField::PasswordEchoOnEdit );
|
||||
#if 1
|
||||
input->setFixedWidth( 80 );
|
||||
textField->setFixedWidth( 100 );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -117,8 +119,8 @@ InputPage::InputPage( QQuickItem* parent )
|
|||
auto spinBox = new QskSpinBox( 0.0, 100.0, 1.0 );
|
||||
spinBox->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
|
||||
|
||||
auto inputBox = new InputBox();
|
||||
inputBox->setSizePolicy( Qt::Vertical, QskSizePolicy::Fixed );
|
||||
auto textInputBox = new TextInputBox();
|
||||
textInputBox->setSizePolicy( Qt::Vertical, QskSizePolicy::Fixed );
|
||||
|
||||
auto vBox = new QskLinearBox( Qt::Vertical );
|
||||
vBox->setSpacing( 30 );
|
||||
|
@ -127,7 +129,7 @@ InputPage::InputPage( QQuickItem* parent )
|
|||
vBox->addItem( sliders[0].continous );
|
||||
vBox->addItem( sliders[0].discrete );
|
||||
vBox->addItem( sliders[0].centered );
|
||||
vBox->addItem( inputBox );
|
||||
vBox->addItem( textInputBox );
|
||||
vBox->addItem( spinBox );
|
||||
|
||||
auto mainBox = new QskLinearBox( Qt::Horizontal, this );
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <QskGradient.h>
|
||||
#include <QskGradientDirection.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextField.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskRgbValue.h>
|
||||
|
@ -50,14 +50,14 @@ namespace
|
|||
{
|
||||
new QskTextLabel( label, this );
|
||||
|
||||
m_input = new QskTextInput( this );
|
||||
m_input->setValidator( new InputValidator( m_input ) );
|
||||
m_input->setText( QString::number( value ) );
|
||||
m_textField = new QskTextField( this );
|
||||
m_textField->setValidator( new InputValidator( m_textField ) );
|
||||
m_textField->setText( QString::number( value ) );
|
||||
|
||||
const QFontMetricsF fm( m_input->font() );
|
||||
m_input->setFixedWidth( fm.horizontalAdvance( "-0.000" ) );
|
||||
const QFontMetricsF fm( m_textField->font() );
|
||||
m_textField->setFixedWidth( fm.horizontalAdvance( "-0.000" ) );
|
||||
|
||||
connect( m_input, &QskTextInput::editingChanged,
|
||||
connect( m_textField, &QskTextField::editingChanged,
|
||||
this, [ this ]( bool on ) { if ( !on ) Q_EMIT valueChanged(); } );
|
||||
|
||||
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||
|
@ -65,14 +65,14 @@ namespace
|
|||
|
||||
qreal value() const
|
||||
{
|
||||
return m_input->text().toDouble();
|
||||
return m_textField->text().toDouble();
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void valueChanged();
|
||||
|
||||
private:
|
||||
QskTextInput* m_input;
|
||||
QskTextField* m_textField;
|
||||
};
|
||||
|
||||
class VectorBox : public QskLinearBox
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <QskInputPanel.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskListView.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextField.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskFunctions.h>
|
||||
|
@ -201,26 +201,26 @@ class InputBox : public QskLinearBox
|
|||
setMargins( 10 );
|
||||
setSpacing( 10 );
|
||||
|
||||
auto* textInput1 = new QskTextInput( this );
|
||||
textInput1->setText( "Press and edit Me." );
|
||||
textInput1->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
auto* textField1 = new QskTextField( this );
|
||||
textField1->setText( "Press and edit Me." );
|
||||
textField1->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
|
||||
auto* textInput2 = new QskTextInput( this );
|
||||
textInput2->setText( "Press and edit Me." );
|
||||
textInput2->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
textInput2->setActivationModes( QskTextInput::ActivationOnAll );
|
||||
auto* textField2 = new QskTextField( this );
|
||||
textField2->setText( "Press and edit Me." );
|
||||
textField2->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
textField2->setActivationModes( QskTextField::ActivationOnAll );
|
||||
|
||||
auto* textInput3 = new QskTextInput( this );
|
||||
textInput3->setReadOnly( true );
|
||||
textInput3->setText( "Read Only information." );
|
||||
textInput3->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
auto* textField3 = new QskTextField( this );
|
||||
textField3->setReadOnly( true );
|
||||
textField3->setText( "Read Only information." );
|
||||
textField3->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
|
||||
auto* textInput4 = new QskTextInput( this );
|
||||
textInput4->setEchoMode( QskTextInput::Password );
|
||||
textInput4->setPasswordMaskDelay( 1000 );
|
||||
textInput4->setMaxLength( 8 );
|
||||
textInput4->setText( "12345678" );
|
||||
textInput4->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
auto* textField4 = new QskTextField( this );
|
||||
textField4->setEchoMode( QskTextField::Password );
|
||||
textField4->setPasswordMaskDelay( 1000 );
|
||||
textField4->setMaxLength( 8 );
|
||||
textField4->setText( "12345678" );
|
||||
textField4->setSizePolicy( Qt::Horizontal, QskSizePolicy::Preferred );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -22,19 +22,17 @@ static inline QskTextColors qskTextColors(
|
|||
|
||||
QskSkinHintStatus status;
|
||||
|
||||
QskTextColors c;
|
||||
c.textColor = skinnable->color( aspect | A::TextColor, &status );
|
||||
auto textColor = skinnable->color( aspect | A::TextColor, &status );
|
||||
|
||||
if ( status.aspect.subControl() != aspect.subControl() )
|
||||
{
|
||||
// using the same color as the one for the ticks
|
||||
c.textColor = skinnable->color( aspect );
|
||||
textColor = skinnable->color( aspect );
|
||||
}
|
||||
|
||||
c.styleColor = skinnable->color( aspect | A::StyleColor );
|
||||
c.linkColor = skinnable->color( aspect | A::LinkColor );
|
||||
|
||||
return c;
|
||||
return QskTextColors( textColor,
|
||||
skinnable->color( aspect | A::StyleColor ),
|
||||
skinnable->color( aspect | A::LinkColor ) );
|
||||
}
|
||||
|
||||
static inline QskAspect qskAxisAspect( QskPlot::Axis axis )
|
||||
|
|
|
@ -279,8 +279,8 @@ list(APPEND HEADERS
|
|||
controls/QskTabButtonSkinlet.h
|
||||
controls/QskTabView.h
|
||||
controls/QskTabViewSkinlet.h
|
||||
controls/QskTextInput.h
|
||||
controls/QskTextInputSkinlet.h
|
||||
controls/QskTextField.h
|
||||
controls/QskTextFieldSkinlet.h
|
||||
controls/QskTextLabel.h
|
||||
controls/QskTextLabelSkinlet.h
|
||||
controls/QskVariantAnimator.h
|
||||
|
@ -385,8 +385,8 @@ list(APPEND SOURCES
|
|||
controls/QskTabButtonSkinlet.cpp
|
||||
controls/QskTabView.cpp
|
||||
controls/QskTabViewSkinlet.cpp
|
||||
controls/QskTextInput.cpp
|
||||
controls/QskTextInputSkinlet.cpp
|
||||
controls/QskTextField.cpp
|
||||
controls/QskTextFieldSkinlet.cpp
|
||||
controls/QskTextLabel.cpp
|
||||
controls/QskTextLabelSkinlet.cpp
|
||||
controls/QskVariantAnimator.cpp
|
||||
|
|
|
@ -70,7 +70,7 @@ class QSK_EXPORT QskBoxBorderColors
|
|||
bool isValid() const;
|
||||
|
||||
private:
|
||||
enum
|
||||
enum : quint8
|
||||
{
|
||||
// in order of Qt::Edge
|
||||
Top = 0,
|
||||
|
|
|
@ -154,7 +154,7 @@ QskBoxShapeMetrics QskBoxShapeMetrics::interpolated(
|
|||
qskInterpolatedSize( m_radii[ 1 ], to.m_radii[ 1 ], ratio ),
|
||||
qskInterpolatedSize( m_radii[ 2 ], to.m_radii[ 2 ], ratio ),
|
||||
qskInterpolatedSize( m_radii[ 3 ], to.m_radii[ 3 ], ratio ),
|
||||
to.m_sizeMode, to.m_scalingMode );
|
||||
to.sizeMode(), to.m_scalingMode );
|
||||
}
|
||||
|
||||
QVariant QskBoxShapeMetrics::interpolate(
|
||||
|
|
|
@ -52,7 +52,7 @@ class QSK_EXPORT QskBoxShapeMetrics
|
|||
The default setting is Symmetric.
|
||||
*/
|
||||
|
||||
enum ScalingMode
|
||||
enum ScalingMode : quint8
|
||||
{
|
||||
Symmetric,
|
||||
SymmetricByMaximum,
|
||||
|
@ -144,7 +144,7 @@ class QSK_EXPORT QskBoxShapeMetrics
|
|||
}
|
||||
|
||||
QSizeF m_radii[ 4 ];
|
||||
Qt::SizeMode m_sizeMode : 2;
|
||||
unsigned int m_sizeMode : 2;
|
||||
ScalingMode m_scalingMode : 2;
|
||||
};
|
||||
|
||||
|
@ -278,7 +278,7 @@ inline void QskBoxShapeMetrics::setSizeMode( Qt::SizeMode sizeMode ) noexcept
|
|||
|
||||
inline constexpr Qt::SizeMode QskBoxShapeMetrics::sizeMode() const noexcept
|
||||
{
|
||||
return m_sizeMode;
|
||||
return static_cast< Qt::SizeMode >( m_sizeMode );
|
||||
}
|
||||
|
||||
inline void QskBoxShapeMetrics::setScalingMode( ScalingMode scalingMode ) noexcept
|
||||
|
@ -312,7 +312,7 @@ inline constexpr QskBoxShapeMetrics QskBoxShapeMetrics::transposed() const noexc
|
|||
return QskBoxShapeMetrics(
|
||||
m_radii[ 0 ].transposed(), m_radii[ 1 ].transposed(),
|
||||
m_radii[ 2 ].transposed(), m_radii[ 3 ].transposed(),
|
||||
m_sizeMode, m_scalingMode );
|
||||
sizeMode(), m_scalingMode );
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskFontRole
|
|||
Q_PROPERTY( Emphasis emphasis READ emphasis WRITE setEmphasis )
|
||||
|
||||
public:
|
||||
enum Category
|
||||
enum Category : quint8
|
||||
{
|
||||
Caption,
|
||||
Body,
|
||||
|
@ -28,7 +28,7 @@ class QSK_EXPORT QskFontRole
|
|||
};
|
||||
Q_ENUM( Category );
|
||||
|
||||
enum Emphasis
|
||||
enum Emphasis : quint8
|
||||
{
|
||||
VeryLow,
|
||||
Low,
|
||||
|
@ -54,8 +54,8 @@ class QSK_EXPORT QskFontRole
|
|||
QskHashValue hash( QskHashValue seed = 0 ) const noexcept;
|
||||
|
||||
private:
|
||||
unsigned char m_category;
|
||||
unsigned char m_emphasis;
|
||||
Category m_category;
|
||||
Emphasis m_emphasis;
|
||||
};
|
||||
|
||||
inline constexpr QskFontRole::QskFontRole( Category category, Emphasis emphasis ) noexcept
|
||||
|
@ -81,7 +81,7 @@ inline void QskFontRole::setCategory( Category category ) noexcept
|
|||
|
||||
inline constexpr QskFontRole::Category QskFontRole::category() const noexcept
|
||||
{
|
||||
return static_cast< Category >( m_category );
|
||||
return m_category;
|
||||
}
|
||||
|
||||
inline void QskFontRole::setEmphasis( Emphasis emphasis ) noexcept
|
||||
|
@ -91,7 +91,7 @@ inline void QskFontRole::setEmphasis( Emphasis emphasis ) noexcept
|
|||
|
||||
inline constexpr QskFontRole::Emphasis QskFontRole::emphasis() const noexcept
|
||||
{
|
||||
return static_cast< Emphasis >( m_emphasis );
|
||||
return m_emphasis;
|
||||
}
|
||||
|
||||
inline QskHashValue qHash( const QskFontRole fontRole, QskHashValue seed = 0 ) noexcept
|
||||
|
|
|
@ -40,7 +40,7 @@ class QSK_EXPORT QskGradient
|
|||
Q_CLASSINFO( "DefaultProperty", "stops" )
|
||||
|
||||
public:
|
||||
enum Type
|
||||
enum Type : quint8
|
||||
{
|
||||
Stops,
|
||||
|
||||
|
@ -50,7 +50,7 @@ class QSK_EXPORT QskGradient
|
|||
};
|
||||
Q_ENUM( Type )
|
||||
|
||||
enum SpreadMode
|
||||
enum SpreadMode : quint8
|
||||
{
|
||||
PadSpread,
|
||||
ReflectSpread,
|
||||
|
@ -58,7 +58,7 @@ class QSK_EXPORT QskGradient
|
|||
};
|
||||
Q_ENUM( SpreadMode )
|
||||
|
||||
enum StretchMode
|
||||
enum StretchMode : quint8
|
||||
{
|
||||
NoStretch,
|
||||
StretchToSize
|
||||
|
@ -181,8 +181,8 @@ class QSK_EXPORT QskGradient
|
|||
qreal m_values[5] = {};
|
||||
|
||||
unsigned int m_type : 3;
|
||||
unsigned int m_spreadMode : 3;
|
||||
unsigned int m_stretchMode : 3;
|
||||
SpreadMode m_spreadMode : 3;
|
||||
StretchMode m_stretchMode : 3;
|
||||
|
||||
mutable bool m_isDirty : 1;
|
||||
mutable bool m_isValid : 1;
|
||||
|
|
|
@ -21,7 +21,7 @@ class QByteArray;
|
|||
class QSK_EXPORT QskMetaInvokable
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
enum Type : quint8
|
||||
{
|
||||
Invalid = 0,
|
||||
|
||||
|
@ -93,7 +93,7 @@ class QSK_EXPORT QskMetaInvokable
|
|||
MetaData m_metaData;
|
||||
};
|
||||
|
||||
int m_type : 3;
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
inline QskMetaInvokable::QskMetaInvokable()
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace Qsk
|
|||
{
|
||||
Q_NAMESPACE_EXPORT( QSK_EXPORT )
|
||||
|
||||
enum Policy
|
||||
enum Policy : quint8
|
||||
{
|
||||
Maybe,
|
||||
Always,
|
||||
|
@ -21,7 +21,7 @@ namespace Qsk
|
|||
};
|
||||
Q_ENUM_NS( Policy )
|
||||
|
||||
enum Direction
|
||||
enum Direction : quint8
|
||||
{
|
||||
LeftToRight,
|
||||
RightToLeft,
|
||||
|
@ -30,7 +30,7 @@ namespace Qsk
|
|||
};
|
||||
Q_ENUM_NS( Direction )
|
||||
|
||||
enum TextStyle
|
||||
enum TextStyle : quint8
|
||||
{
|
||||
Normal,
|
||||
Outline,
|
||||
|
@ -39,7 +39,7 @@ namespace Qsk
|
|||
};
|
||||
Q_ENUM_NS( TextStyle )
|
||||
|
||||
enum Visibility
|
||||
enum Visibility : quint8
|
||||
{
|
||||
Visible = 1 << 0,
|
||||
Hidden = 1 << 1
|
||||
|
|
|
@ -14,7 +14,7 @@ class QObject;
|
|||
class QSK_EXPORT QskObjectCounter
|
||||
{
|
||||
public:
|
||||
enum ObjectType
|
||||
enum ObjectType : quint8
|
||||
{
|
||||
Objects,
|
||||
Items
|
||||
|
|
|
@ -19,7 +19,7 @@ class QSK_EXPORT QskPlacementPolicy
|
|||
|
||||
public:
|
||||
|
||||
enum Policy
|
||||
enum Policy : quint8
|
||||
{
|
||||
Ignore,
|
||||
Reserve,
|
||||
|
|
|
@ -26,7 +26,7 @@ class QSK_EXPORT QskShadowMetrics
|
|||
Q_PROPERTY( ShapeMode shapeMode READ shapeMode WRITE setShapeMode )
|
||||
|
||||
public:
|
||||
enum ShapeMode
|
||||
enum ShapeMode : quint8
|
||||
{
|
||||
Aligned = 0, // The shape is related to some external definition
|
||||
|
||||
|
@ -86,7 +86,7 @@ class QSK_EXPORT QskShadowMetrics
|
|||
qreal m_spreadRadius = 0.0;
|
||||
qreal m_blurRadius = 0.0;
|
||||
quint8 m_sizeMode = Qt::AbsoluteSize;
|
||||
quint8 m_shapeMode = QskShadowMetrics::Aligned;
|
||||
ShapeMode m_shapeMode = QskShadowMetrics::Aligned;
|
||||
};
|
||||
|
||||
inline constexpr QskShadowMetrics::QskShadowMetrics( const QPointF& offset ) noexcept
|
||||
|
@ -170,7 +170,7 @@ inline void QskShadowMetrics::setShapeMode( ShapeMode shapeMode ) noexcept
|
|||
|
||||
inline constexpr QskShadowMetrics::ShapeMode QskShadowMetrics::shapeMode() const noexcept
|
||||
{
|
||||
return static_cast< ShapeMode >( m_shapeMode );
|
||||
return m_shapeMode;
|
||||
}
|
||||
|
||||
inline void QskShadowMetrics::setOffsetX( qreal dx ) noexcept
|
||||
|
|
|
@ -18,7 +18,7 @@ class QSK_EXPORT QskSizePolicy
|
|||
Q_PROPERTY( Policy vertical READ verticalPolicy WRITE setVerticalPolicy )
|
||||
|
||||
public:
|
||||
enum Flag
|
||||
enum Flag : quint8
|
||||
{
|
||||
GrowFlag = 1 << 0,
|
||||
ExpandFlag = 1 << 1,
|
||||
|
@ -27,7 +27,7 @@ class QSK_EXPORT QskSizePolicy
|
|||
ConstrainedFlag = 1 << 4
|
||||
};
|
||||
|
||||
enum Policy
|
||||
enum Policy : quint8
|
||||
{
|
||||
Fixed = 0,
|
||||
|
||||
|
@ -48,7 +48,7 @@ class QSK_EXPORT QskSizePolicy
|
|||
ConstrainedExpanding = ConstrainedFlag | Expanding
|
||||
};
|
||||
|
||||
enum ConstraintType
|
||||
enum ConstraintType : quint8
|
||||
{
|
||||
Unconstrained = 0,
|
||||
|
||||
|
@ -85,8 +85,8 @@ class QSK_EXPORT QskSizePolicy
|
|||
void transpose() noexcept;
|
||||
|
||||
private:
|
||||
unsigned char m_horizontalPolicy = Ignored;
|
||||
unsigned char m_verticalPolicy = Ignored;
|
||||
Policy m_horizontalPolicy = Ignored;
|
||||
Policy m_verticalPolicy = Ignored;
|
||||
};
|
||||
|
||||
inline constexpr QskSizePolicy::QskSizePolicy(
|
||||
|
@ -111,38 +111,37 @@ inline constexpr bool QskSizePolicy::operator!=(
|
|||
|
||||
inline void QskSizePolicy::setHorizontalPolicy( Policy policy ) noexcept
|
||||
{
|
||||
m_horizontalPolicy = static_cast< unsigned char >( policy );
|
||||
m_horizontalPolicy = policy;
|
||||
}
|
||||
|
||||
inline constexpr QskSizePolicy::Policy QskSizePolicy::horizontalPolicy() const noexcept
|
||||
{
|
||||
return static_cast< Policy >( m_horizontalPolicy );
|
||||
return m_horizontalPolicy;
|
||||
}
|
||||
|
||||
inline void QskSizePolicy::setVerticalPolicy( Policy policy ) noexcept
|
||||
{
|
||||
m_verticalPolicy = static_cast< unsigned char >( policy );
|
||||
m_verticalPolicy = policy;
|
||||
}
|
||||
|
||||
inline constexpr QskSizePolicy::Policy QskSizePolicy::verticalPolicy() const noexcept
|
||||
{
|
||||
return static_cast< Policy >( m_verticalPolicy );
|
||||
return m_verticalPolicy;
|
||||
}
|
||||
|
||||
inline constexpr QskSizePolicy::Policy QskSizePolicy::policy(
|
||||
Qt::Orientation orientation ) const noexcept
|
||||
{
|
||||
return static_cast< Policy >(
|
||||
( orientation == Qt::Horizontal ) ? m_horizontalPolicy : m_verticalPolicy );
|
||||
return ( orientation == Qt::Horizontal ) ? m_horizontalPolicy : m_verticalPolicy;
|
||||
}
|
||||
|
||||
inline void QskSizePolicy::setPolicy(
|
||||
Qt::Orientation orientation, Policy policy ) noexcept
|
||||
{
|
||||
if ( orientation == Qt::Horizontal )
|
||||
m_horizontalPolicy = static_cast< unsigned char >( policy );
|
||||
m_horizontalPolicy = policy;
|
||||
else
|
||||
m_verticalPolicy = static_cast< unsigned char >( policy );
|
||||
m_verticalPolicy = policy;
|
||||
}
|
||||
|
||||
inline constexpr bool QskSizePolicy::isConstrained(
|
||||
|
@ -153,7 +152,7 @@ inline constexpr bool QskSizePolicy::isConstrained(
|
|||
|
||||
inline constexpr QskSizePolicy QskSizePolicy::transposed() const noexcept
|
||||
{
|
||||
return QskSizePolicy( verticalPolicy(), horizontalPolicy() );
|
||||
return QskSizePolicy( m_verticalPolicy, m_horizontalPolicy );
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
class QSK_EXPORT QskStateCombination
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
enum Type : quint8
|
||||
{
|
||||
Combination,
|
||||
CombinationNoState
|
||||
|
|
|
@ -11,17 +11,38 @@
|
|||
|
||||
QskHashValue QskTextColors::hash( QskHashValue seed ) const noexcept
|
||||
{
|
||||
const QRgb rgb[] = { textColor.rgba(), styleColor.rgba(), linkColor.rgba() };
|
||||
const QRgb rgb[] =
|
||||
{
|
||||
m_textColor.rgba(),
|
||||
m_styleColor.isValid() ? m_styleColor.rgba() : m_textColor.rgba(),
|
||||
m_linkColor.isValid() ? m_linkColor.rgba() : m_textColor.rgba()
|
||||
};
|
||||
|
||||
return qHashBits( rgb, sizeof( rgb ), seed );
|
||||
}
|
||||
|
||||
void QskTextColors::setTextColor( const QColor& color )
|
||||
{
|
||||
m_textColor = color;
|
||||
}
|
||||
|
||||
void QskTextColors::setStyleColor( const QColor& color )
|
||||
{
|
||||
m_styleColor = color;
|
||||
}
|
||||
|
||||
void QskTextColors::setLinkColor( const QColor& color )
|
||||
{
|
||||
m_linkColor = color;
|
||||
}
|
||||
|
||||
QskTextColors QskTextColors::interpolated(
|
||||
const QskTextColors& to, qreal ratio ) const
|
||||
{
|
||||
QskTextColors colors;
|
||||
colors.textColor = QskRgb::interpolated( textColor, to.textColor, ratio );
|
||||
colors.styleColor = QskRgb::interpolated( styleColor, to.styleColor, ratio );
|
||||
colors.linkColor = QskRgb::interpolated( linkColor, to.linkColor, ratio );
|
||||
colors.m_textColor = QskRgb::interpolated( m_textColor, to.m_textColor, ratio );
|
||||
colors.m_styleColor = QskRgb::interpolated( m_styleColor, to.m_styleColor, ratio );
|
||||
colors.m_linkColor = QskRgb::interpolated( m_linkColor, to.m_linkColor, ratio );
|
||||
|
||||
return colors;
|
||||
}
|
||||
|
@ -50,13 +71,23 @@ QDebug operator<<( QDebug debug, const QskTextColors& colors )
|
|||
debug << "TextColors" << '(';
|
||||
|
||||
debug << " T";
|
||||
qskDebugColor( debug, colors.textColor );
|
||||
|
||||
debug << ", S";
|
||||
qskDebugColor( debug, colors.styleColor );
|
||||
if ( colors.textColor().isValid() )
|
||||
qskDebugColor( debug, colors.textColor() );
|
||||
else
|
||||
debug << "(invalid)";
|
||||
|
||||
debug << ", L";
|
||||
qskDebugColor( debug, colors.linkColor );
|
||||
if ( colors.styleColor().isValid() )
|
||||
{
|
||||
debug << ", S";
|
||||
qskDebugColor( debug, colors.styleColor() );
|
||||
}
|
||||
|
||||
if ( colors.linkColor().isValid() )
|
||||
{
|
||||
debug << ", L";
|
||||
qskDebugColor( debug, colors.linkColor() );
|
||||
}
|
||||
|
||||
debug << " )";
|
||||
|
||||
|
@ -64,3 +95,5 @@ QDebug operator<<( QDebug debug, const QskTextColors& colors )
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#include "moc_QskTextColors.cpp"
|
||||
|
|
|
@ -16,10 +16,31 @@ class QVariant;
|
|||
|
||||
class QSK_EXPORT QskTextColors
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
|
||||
Q_PROPERTY( QColor styleColor READ styleColor WRITE setStyleColor )
|
||||
Q_PROPERTY( QColor linkColor READ linkColor WRITE setLinkColor )
|
||||
|
||||
public:
|
||||
QskTextColors( const QColor& text = QColor(),
|
||||
const QColor& style = QColor(), const QColor& link = QColor() );
|
||||
|
||||
QColor textColor() const;
|
||||
void setTextColor( const QColor& );
|
||||
void setTextColor( QRgb );
|
||||
void setTextColor( Qt::GlobalColor );
|
||||
|
||||
QColor styleColor() const;
|
||||
void setStyleColor( const QColor& );
|
||||
void setStyleColor( QRgb );
|
||||
void setStyleColor( Qt::GlobalColor );
|
||||
|
||||
QColor linkColor() const;
|
||||
void setLinkColor( const QColor& );
|
||||
void setLinkColor( QRgb );
|
||||
void setLinkColor( Qt::GlobalColor );
|
||||
|
||||
QskTextColors interpolated( const QskTextColors&, qreal value ) const;
|
||||
|
||||
static QVariant interpolate( const QskTextColors&,
|
||||
|
@ -27,19 +48,65 @@ class QSK_EXPORT QskTextColors
|
|||
|
||||
QskHashValue hash( QskHashValue seed = 0 ) const noexcept;
|
||||
|
||||
QColor textColor;
|
||||
QColor styleColor;
|
||||
QColor linkColor;
|
||||
private:
|
||||
QColor m_textColor;
|
||||
QColor m_styleColor;
|
||||
QColor m_linkColor;
|
||||
};
|
||||
|
||||
inline QskTextColors::QskTextColors(
|
||||
const QColor& text, const QColor& style, const QColor& link )
|
||||
: textColor( text )
|
||||
, styleColor( style )
|
||||
, linkColor( link )
|
||||
: m_textColor( text )
|
||||
, m_styleColor( style )
|
||||
, m_linkColor( link )
|
||||
{
|
||||
}
|
||||
|
||||
inline QColor QskTextColors::textColor() const
|
||||
{
|
||||
return m_textColor;
|
||||
}
|
||||
|
||||
inline QColor QskTextColors::linkColor() const
|
||||
{
|
||||
return m_linkColor;
|
||||
}
|
||||
|
||||
inline QColor QskTextColors::styleColor() const
|
||||
{
|
||||
return m_styleColor;
|
||||
}
|
||||
|
||||
inline void QskTextColors::setTextColor( QRgb rgb )
|
||||
{
|
||||
setTextColor( QColor::fromRgba( rgb ) );
|
||||
}
|
||||
|
||||
inline void QskTextColors::setTextColor( Qt::GlobalColor color )
|
||||
{
|
||||
setTextColor( QColor( color ) );
|
||||
}
|
||||
|
||||
inline void QskTextColors::setStyleColor( QRgb rgb )
|
||||
{
|
||||
setStyleColor( QColor::fromRgba( rgb ) );
|
||||
}
|
||||
|
||||
inline void QskTextColors::setStyleColor( Qt::GlobalColor color )
|
||||
{
|
||||
setStyleColor( QColor( color ) );
|
||||
}
|
||||
|
||||
inline void QskTextColors::setLinkColor( QRgb rgb )
|
||||
{
|
||||
setLinkColor( QColor::fromRgba( rgb ) );
|
||||
}
|
||||
|
||||
inline void QskTextColors::setLinkColor( Qt::GlobalColor color )
|
||||
{
|
||||
setLinkColor( QColor( color ) );
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
||||
QSK_EXPORT QDebug operator<<( QDebug, const QskTextColors& );
|
||||
|
|
|
@ -57,8 +57,8 @@ QskTextOptions::TextFormat QskTextOptions::effectiveFormat( const QString& text
|
|||
|
||||
if ( m_format == QskTextOptions::AutoText )
|
||||
return Qt::mightBeRichText( text ) ? StyledText : PlainText;
|
||||
else
|
||||
return m_format;
|
||||
|
||||
return m_format;
|
||||
}
|
||||
|
||||
QskHashValue QskTextOptions::hash( QskHashValue seed ) const noexcept
|
||||
|
|
|
@ -24,7 +24,7 @@ class QSK_EXPORT QskTextOptions
|
|||
Q_PROPERTY( int maximumLineCount READ maximumLineCount WRITE setMaximumLineCount )
|
||||
|
||||
public:
|
||||
enum FontSizeMode
|
||||
enum FontSizeMode : quint8
|
||||
{
|
||||
FixedSize,
|
||||
HorizontalFit,
|
||||
|
@ -33,7 +33,7 @@ class QSK_EXPORT QskTextOptions
|
|||
};
|
||||
Q_ENUM( FontSizeMode )
|
||||
|
||||
enum WrapMode
|
||||
enum WrapMode : quint8
|
||||
{
|
||||
NoWrap = QTextOption::NoWrap,
|
||||
WordWrap = QTextOption::WordWrap,
|
||||
|
@ -42,11 +42,12 @@ class QSK_EXPORT QskTextOptions
|
|||
};
|
||||
Q_ENUM( WrapMode )
|
||||
|
||||
enum TextFormat
|
||||
enum TextFormat : quint8
|
||||
{
|
||||
PlainText = Qt::PlainText,
|
||||
RichText = Qt::RichText,
|
||||
AutoText = Qt::AutoText,
|
||||
MarkdownText = Qt::MarkdownText,
|
||||
StyledText = 4 // taken from QQuickText::StyledText
|
||||
};
|
||||
Q_ENUM( TextFormat )
|
||||
|
@ -84,7 +85,7 @@ class QSK_EXPORT QskTextOptions
|
|||
FontSizeMode m_fontSizeMode : 2;
|
||||
WrapMode m_wrapMode : 4;
|
||||
TextFormat m_format : 3;
|
||||
Qt::TextElideMode m_elideMode : 2;
|
||||
unsigned int m_elideMode : 2;
|
||||
};
|
||||
|
||||
inline constexpr QskTextOptions::QskTextOptions() noexcept
|
||||
|
@ -113,12 +114,13 @@ inline void QskTextOptions::setElideMode( Qt::TextElideMode elideMode ) noexcept
|
|||
|
||||
constexpr inline Qt::TextElideMode QskTextOptions::elideMode() const noexcept
|
||||
{
|
||||
return m_elideMode;
|
||||
return static_cast< Qt::TextElideMode >( m_elideMode );
|
||||
}
|
||||
|
||||
constexpr inline Qt::TextElideMode QskTextOptions::effectiveElideMode() const noexcept
|
||||
{
|
||||
return ( m_wrapMode != QskTextOptions::NoWrap ) ? Qt::ElideNone : m_elideMode;
|
||||
return ( wrapMode() != QskTextOptions::NoWrap ) ?
|
||||
Qt::ElideNone : static_cast< Qt::TextElideMode >( m_elideMode );
|
||||
}
|
||||
|
||||
inline void QskTextOptions::setWrapMode( WrapMode wrapMode ) noexcept
|
||||
|
|
|
@ -18,7 +18,7 @@ class QSK_EXPORT QskTickmarks
|
|||
Q_PROPERTY( QVector< qreal > minorTicks READ minorTicks WRITE setMinorTicks )
|
||||
|
||||
public:
|
||||
enum TickType
|
||||
enum TickType : quint8
|
||||
{
|
||||
MinorTick,
|
||||
MediumTick,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
class QSK_EXPORT QskAnimationHint
|
||||
{
|
||||
public:
|
||||
enum UpdateFlag
|
||||
enum UpdateFlag : quint8
|
||||
{
|
||||
UpdateAuto = 0, // depending on the animated aspect
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class QSK_EXPORT QskBoxSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
RoleCount
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskCheckBoxSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
BoxRole,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskComboBoxSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
IconRole,
|
||||
|
|
|
@ -15,7 +15,7 @@ class QSK_EXPORT QskDrawerSkinlet : public QskPopupSkinlet
|
|||
using Inherited = QskPopupSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
ContentsRole = Inherited::RoleCount,
|
||||
PanelRole,
|
||||
|
|
|
@ -32,7 +32,7 @@ class QKeyEvent;
|
|||
class QSK_EXPORT QskEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
enum Type : int
|
||||
{
|
||||
NoEvent = 53800,
|
||||
|
||||
|
@ -161,7 +161,7 @@ class QSK_EXPORT QskGestureEvent : public QskEvent
|
|||
class QSK_EXPORT QskAnimatorEvent : public QskEvent
|
||||
{
|
||||
public:
|
||||
enum State
|
||||
enum State : quint8
|
||||
{
|
||||
Started,
|
||||
Terminated
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskFocusIndicatorSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
FrameRole,
|
||||
RoleCount
|
||||
|
|
|
@ -16,7 +16,7 @@ class QSK_EXPORT QskGesture
|
|||
Q_GADGET
|
||||
|
||||
public:
|
||||
enum Type
|
||||
enum Type : qint16
|
||||
{
|
||||
NoType = -1,
|
||||
|
||||
|
@ -33,7 +33,7 @@ class QSK_EXPORT QskGesture
|
|||
};
|
||||
Q_ENUM( Type )
|
||||
|
||||
enum State
|
||||
enum State : quint8
|
||||
{
|
||||
NoGesture,
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class QSK_EXPORT QskGestureRecognizer : public QObject
|
|||
using Inherited = QObject;
|
||||
|
||||
public:
|
||||
enum State
|
||||
enum State : quint8
|
||||
{
|
||||
Idle,
|
||||
Pending,
|
||||
|
|
|
@ -40,7 +40,7 @@ class QSK_EXPORT QskGraphicLabel : public QskControl
|
|||
public:
|
||||
QSK_SUBCONTROLS( Panel, Graphic )
|
||||
|
||||
enum FillMode
|
||||
enum FillMode : quint8
|
||||
{
|
||||
Stretch,
|
||||
PreserveAspectFit,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskGraphicLabelSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
GraphicRole,
|
||||
|
|
|
@ -44,7 +44,7 @@ class QSK_EXPORT QskItem : public QQuickItem
|
|||
using Inherited = QQuickItem;
|
||||
|
||||
public:
|
||||
enum UpdateFlag
|
||||
enum UpdateFlag : quint16
|
||||
{
|
||||
DeferredUpdate = 1 << 0,
|
||||
DeferredPolish = 1 << 1,
|
||||
|
|
|
@ -32,7 +32,7 @@ class QSK_EXPORT QskListView : public QskScrollView
|
|||
QSK_SUBCONTROLS( Cell, Text, Graphic )
|
||||
QSK_STATES( Selected )
|
||||
|
||||
enum SelectionMode
|
||||
enum SelectionMode : quint8
|
||||
{
|
||||
NoSelection,
|
||||
SingleSelection,
|
||||
|
|
|
@ -22,7 +22,7 @@ class QSK_EXPORT QskListViewSkinlet : public QskScrollViewSkinlet
|
|||
using Inherited = QskScrollViewSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
TextRole = Inherited::RoleCount,
|
||||
GraphicRole,
|
||||
|
|
|
@ -18,7 +18,7 @@ class QSK_EXPORT QskMenuSkinlet : public QskPopupSkinlet
|
|||
using Inherited = QskPopupSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
ContentsRole = Inherited::RoleCount,
|
||||
PanelRole,
|
||||
|
|
|
@ -15,7 +15,7 @@ class QSK_EXPORT QskPageIndicatorSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
BulletsRole,
|
||||
|
|
|
@ -27,7 +27,7 @@ class QSK_EXPORT QskPopup : public QskControl
|
|||
QSK_SUBCONTROLS( Overlay )
|
||||
QSK_STATES( Closed )
|
||||
|
||||
enum PopupFlag
|
||||
enum PopupFlag : quint8
|
||||
{
|
||||
DeleteOnClose = 1 << 0,
|
||||
CloseOnPressOutside = 1 << 1
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskPopupSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
OverlayRole,
|
||||
RoleCount
|
||||
|
|
|
@ -15,7 +15,7 @@ class QSK_EXPORT QskProgressIndicatorSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
GrooveRole,
|
||||
FillRole,
|
||||
|
|
|
@ -20,7 +20,7 @@ class QSK_EXPORT QskProgressRing : public QskProgressIndicator
|
|||
public:
|
||||
QSK_SUBCONTROLS( Groove, Fill )
|
||||
|
||||
enum Size
|
||||
enum Size : qint8
|
||||
{
|
||||
SmallSize = -1,
|
||||
NormalSize = 0,
|
||||
|
|
|
@ -47,7 +47,7 @@ class QSK_EXPORT QskPushButton : public QskAbstractButton
|
|||
public:
|
||||
QSK_SUBCONTROLS( Panel, Splash, Text, Icon )
|
||||
|
||||
enum Emphasis
|
||||
enum Emphasis : qint8
|
||||
{
|
||||
VeryLowEmphasis = -2,
|
||||
LowEmphasis = -1,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskPushButtonSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
SplashRole,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskRadioBoxSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
ButtonRole,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskScrollViewSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
ViewportRole,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskSegmentedBarSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
SegmentRole,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskSeparatorSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
RoleCount
|
||||
|
|
|
@ -100,8 +100,8 @@
|
|||
#include "QskTextLabel.h"
|
||||
#include "QskTextLabelSkinlet.h"
|
||||
|
||||
#include "QskTextInput.h"
|
||||
#include "QskTextInputSkinlet.h"
|
||||
#include "QskTextField.h"
|
||||
#include "QskTextFieldSkinlet.h"
|
||||
|
||||
#include "QskStatusIndicator.h"
|
||||
#include "QskStatusIndicatorSkinlet.h"
|
||||
|
@ -205,7 +205,7 @@ QskSkin::QskSkin( QObject* parent )
|
|||
declareSkinlet< QskTabButton, QskTabButtonSkinlet >();
|
||||
declareSkinlet< QskTabView, QskTabViewSkinlet >();
|
||||
declareSkinlet< QskTextLabel, QskTextLabelSkinlet >();
|
||||
declareSkinlet< QskTextInput, QskTextInputSkinlet >();
|
||||
declareSkinlet< QskTextField, QskTextFieldSkinlet >();
|
||||
declareSkinlet< QskProgressBar, QskProgressBarSkinlet >();
|
||||
declareSkinlet< QskProgressRing, QskProgressRingSkinlet >();
|
||||
declareSkinlet< QskRadioBox, QskRadioBoxSkinlet >();
|
||||
|
|
|
@ -36,7 +36,7 @@ class QSK_EXPORT QskSkin : public QObject
|
|||
public:
|
||||
#if 1
|
||||
// Use Qt::ColorScheme once minimum version is Qt 6.5
|
||||
enum ColorScheme
|
||||
enum ColorScheme : quint8
|
||||
{
|
||||
UnknownScheme,
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace
|
|||
class UpdateInfo
|
||||
{
|
||||
public:
|
||||
enum UpdateMode
|
||||
enum UpdateMode : quint8
|
||||
{
|
||||
Polish = 1,
|
||||
Update = 2
|
||||
|
@ -128,7 +128,7 @@ namespace
|
|||
}
|
||||
|
||||
QPointer< QskControl > control;
|
||||
int updateModes;
|
||||
quint8 updateModes = 0;
|
||||
};
|
||||
|
||||
class HintAnimator : public QskHintAnimator
|
||||
|
|
|
@ -22,7 +22,7 @@ template< typename Key, typename T > class QHash;
|
|||
class QSK_EXPORT QskSkinTransition
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
enum Type : quint8
|
||||
{
|
||||
Color = 1,
|
||||
Metric = 2,
|
||||
|
|
|
@ -183,17 +183,15 @@ static inline QskTextColors qskTextColors(
|
|||
|
||||
QskSkinHintStatus status;
|
||||
|
||||
QskTextColors c;
|
||||
c.textColor = skinnable->color( subControl, &status );
|
||||
auto textColor = skinnable->color( subControl, &status );
|
||||
#if 1
|
||||
if ( !status.isValid() )
|
||||
c.textColor = skinnable->color( subControl | QskAspect::TextColor );
|
||||
textColor = skinnable->color( subControl | QskAspect::TextColor );
|
||||
#endif
|
||||
|
||||
c.styleColor = skinnable->color( subControl | QskAspect::StyleColor );
|
||||
c.linkColor = skinnable->color( subControl | QskAspect::LinkColor );
|
||||
|
||||
return c;
|
||||
return QskTextColors( textColor,
|
||||
skinnable->color( subControl | QskAspect::StyleColor ),
|
||||
skinnable->color( subControl | QskAspect::LinkColor ) );
|
||||
}
|
||||
|
||||
static inline QQuickWindow* qskWindowOfSkinnable( const QskSkinnable* skinnable )
|
||||
|
@ -678,24 +676,34 @@ QSGNode* QskSkinlet::updateTextNode(
|
|||
const QskSkinnable* skinnable, QSGNode* node,
|
||||
const QRectF& rect, Qt::Alignment alignment,
|
||||
const QString& text, QskAspect::Subcontrol subControl )
|
||||
{
|
||||
const auto textOptions = skinnable->textOptionsHint( subControl );
|
||||
|
||||
return updateTextNode( skinnable, node, rect, alignment,
|
||||
textOptions, text, subControl );
|
||||
}
|
||||
|
||||
QSGNode* QskSkinlet::updateTextNode( const QskSkinnable* skinnable,
|
||||
QSGNode* node, const QRectF& rect,
|
||||
Qt::Alignment alignment, const QskTextOptions& textOptions,
|
||||
const QString& text, QskAspect::Subcontrol subControl )
|
||||
{
|
||||
if ( text.isEmpty() || rect.isEmpty() )
|
||||
return nullptr;
|
||||
|
||||
const auto textColors = qskTextColors( skinnable, subControl );
|
||||
const auto textOptions = skinnable->textOptionsHint( subControl );
|
||||
const auto colors = qskTextColors( skinnable, subControl );
|
||||
|
||||
auto textStyle = Qsk::Normal;
|
||||
if ( textColors.styleColor.alpha() == 0 )
|
||||
auto style = Qsk::Normal;
|
||||
if ( colors.styleColor().isValid() )
|
||||
{
|
||||
textStyle = skinnable->flagHint< Qsk::TextStyle >(
|
||||
style = skinnable->flagHint< Qsk::TextStyle >(
|
||||
subControl | QskAspect::Style, Qsk::Normal );
|
||||
}
|
||||
|
||||
const auto font = skinnable->effectiveFont( subControl );
|
||||
|
||||
return qskUpdateTextNode( skinnable, node, rect, alignment,
|
||||
text, font, textOptions, textColors, textStyle );
|
||||
text, font, textOptions, colors, style );
|
||||
}
|
||||
|
||||
QSGNode* QskSkinlet::updateTextNode(
|
||||
|
|
|
@ -110,7 +110,7 @@ class QSK_EXPORT QskSkinlet
|
|||
static QSGNode* updateLineNode( const QskSkinnable*, QSGNode*,
|
||||
const QLineF&, QskAspect::Subcontrol );
|
||||
|
||||
static QSGNode* updateLinesNode( const QskSkinnable*,
|
||||
static QSGNode* updateLinesNode( const QskSkinnable*,
|
||||
QSGNode*, const QVector< QLineF >&, QskAspect::Subcontrol );
|
||||
|
||||
static QSGNode* updateTextNode( const QskSkinnable*, QSGNode*,
|
||||
|
@ -120,6 +120,10 @@ class QSK_EXPORT QskSkinlet
|
|||
const QRectF&, Qt::Alignment, const QString&, const QFont&,
|
||||
const QskTextOptions&, const QskTextColors&, Qsk::TextStyle );
|
||||
|
||||
static QSGNode* updateTextNode( const QskSkinnable*, QSGNode*,
|
||||
const QRectF&, Qt::Alignment, const QskTextOptions&,
|
||||
const QString&, QskAspect::Subcontrol );
|
||||
|
||||
// keeping the aspect ratio
|
||||
static QSGNode* updateGraphicNode( const QskSkinnable*, QSGNode*,
|
||||
const QskGraphic&, const QskColorFilter&, const QRectF&,
|
||||
|
|
|
@ -46,7 +46,7 @@ class QskSkinStateChanger;
|
|||
class QSK_EXPORT QskSkinHintStatus
|
||||
{
|
||||
public:
|
||||
enum Source
|
||||
enum Source : quint8
|
||||
{
|
||||
NoSource = 0,
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
|
|||
public:
|
||||
QSK_STATES( Filled )
|
||||
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
GrooveRole,
|
||||
|
|
|
@ -25,7 +25,7 @@ class QSK_EXPORT QskSpinBox : public QskBoundedValueInput
|
|||
|
||||
QSK_STATES( Decreasing, Increasing )
|
||||
|
||||
enum Decoration
|
||||
enum Decoration : quint8
|
||||
{
|
||||
NoDecoration,
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class QSK_EXPORT QskSpinBoxSkinlet : public QskSkinlet
|
|||
public:
|
||||
Q_INVOKABLE QskSpinBoxSkinlet( QskSkin* = nullptr );
|
||||
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
TextPanelRole,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskStatusIndicatorSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
GraphicRole,
|
||||
RoleCount
|
||||
|
|
|
@ -34,7 +34,7 @@ class QSK_EXPORT QskSubWindow : public QskPopup
|
|||
using Inherited = QskPopup;
|
||||
|
||||
public:
|
||||
enum Decoration
|
||||
enum Decoration : quint16
|
||||
{
|
||||
NoDecoration = 0,
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskSubWindowAreaSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
RoleCount
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskSubWindowSkinlet : public QskPopupSkinlet
|
|||
using Inherited = QskPopupSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole = QskPopupSkinlet::RoleCount,
|
||||
TitleBarRole,
|
||||
|
|
|
@ -27,7 +27,7 @@ class QSK_EXPORT QskSwitchButton : public QskAbstractButton
|
|||
public:
|
||||
QSK_SUBCONTROLS( Groove, Handle, Icon )
|
||||
|
||||
enum IconMode
|
||||
enum IconMode : quint8
|
||||
{
|
||||
NoIcon,
|
||||
ShowIconWhenSelected,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskSwitchButtonSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
GrooveRole,
|
||||
HandleRole,
|
||||
|
|
|
@ -15,7 +15,7 @@ class QSK_EXPORT QskTabButtonSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
TextRole,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskTabViewSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PageRole,
|
||||
RoleCount
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskTextInput.h"
|
||||
#include "QskTextField.h"
|
||||
#include "QskTextFieldSkinlet.h"
|
||||
#include "QskFontRole.h"
|
||||
#include "QskQuick.h"
|
||||
|
||||
|
@ -12,19 +13,14 @@ QSK_QT_PRIVATE_BEGIN
|
|||
#include <private/qquicktextinput_p_p.h>
|
||||
QSK_QT_PRIVATE_END
|
||||
|
||||
QSK_SUBCONTROL( QskTextInput, Panel )
|
||||
QSK_SUBCONTROL( QskTextInput, Text )
|
||||
QSK_SUBCONTROL( QskTextField, Panel )
|
||||
QSK_SUBCONTROL( QskTextField, Text )
|
||||
QSK_SUBCONTROL( QskTextField, PlaceholderText )
|
||||
|
||||
#if 1
|
||||
// shouldn't this be a Selected state, TODO ...
|
||||
QSK_SUBCONTROL( QskTextInput, PanelSelected )
|
||||
QSK_SUBCONTROL( QskTextInput, TextSelected )
|
||||
#endif
|
||||
QSK_SYSTEM_STATE( QskTextField, ReadOnly, QskAspect::FirstSystemState << 1 )
|
||||
QSK_SYSTEM_STATE( QskTextField, Editing, QskAspect::FirstSystemState << 2 )
|
||||
|
||||
QSK_SYSTEM_STATE( QskTextInput, ReadOnly, QskAspect::FirstSystemState << 1 )
|
||||
QSK_SYSTEM_STATE( QskTextInput, Editing, QskAspect::FirstSystemState << 2 )
|
||||
|
||||
static inline void qskPropagateReadOnly( QskTextInput* input )
|
||||
static inline void qskPropagateReadOnly( QskTextField* input )
|
||||
{
|
||||
Q_EMIT input->readOnlyChanged( input->isReadOnly() );
|
||||
|
||||
|
@ -33,49 +29,49 @@ static inline void qskPropagateReadOnly( QskTextInput* input )
|
|||
}
|
||||
|
||||
static inline void qskBindSignals(
|
||||
const QQuickTextInput* wrappedInput, QskTextInput* input )
|
||||
const QQuickTextInput* input, QskTextField* field )
|
||||
{
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::textChanged,
|
||||
input, [ input ] { Q_EMIT input->textChanged( input->text() ); } );
|
||||
QObject::connect( input, &QQuickTextInput::textChanged,
|
||||
field, [ field ] { Q_EMIT field->textChanged( field->text() ); } );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::displayTextChanged,
|
||||
input, [ input ] { Q_EMIT input->displayTextChanged( input->displayText() ); } );
|
||||
QObject::connect( input, &QQuickTextInput::displayTextChanged,
|
||||
field, [ field ] { Q_EMIT field->displayTextChanged( field->displayText() ); } );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::textEdited,
|
||||
input, [ input ] { Q_EMIT input->textEdited( input->text() ); } );
|
||||
QObject::connect( input, &QQuickTextInput::textEdited,
|
||||
field, [ field ] { Q_EMIT field->textEdited( field->text() ); } );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::validatorChanged,
|
||||
input, &QskTextInput::validatorChanged );
|
||||
QObject::connect( input, &QQuickTextInput::validatorChanged,
|
||||
field, &QskTextField::validatorChanged );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::inputMaskChanged,
|
||||
input, &QskTextInput::inputMaskChanged );
|
||||
QObject::connect( input, &QQuickTextInput::inputMaskChanged,
|
||||
field, &QskTextField::inputMaskChanged );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::readOnlyChanged,
|
||||
input, [ input ] { qskPropagateReadOnly( input ); } );
|
||||
QObject::connect( input, &QQuickTextInput::readOnlyChanged,
|
||||
field, [ field ] { qskPropagateReadOnly( field ); } );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::overwriteModeChanged,
|
||||
input, &QskTextInput::overwriteModeChanged );
|
||||
QObject::connect( input, &QQuickTextInput::overwriteModeChanged,
|
||||
field, &QskTextField::overwriteModeChanged );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::maximumLengthChanged,
|
||||
input, &QskTextInput::maximumLengthChanged );
|
||||
QObject::connect( input, &QQuickTextInput::maximumLengthChanged,
|
||||
field, &QskTextField::maximumLengthChanged );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::wrapModeChanged,
|
||||
input, [ input ] { Q_EMIT input->wrapModeChanged( input->wrapMode() ); } );
|
||||
QObject::connect( input, &QQuickTextInput::wrapModeChanged,
|
||||
field, [ field ] { Q_EMIT field->wrapModeChanged( field->wrapMode() ); } );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::echoModeChanged,
|
||||
input, [ input ] { Q_EMIT input->echoModeChanged( input->echoMode() ); } );
|
||||
QObject::connect( input, &QQuickTextInput::echoModeChanged,
|
||||
field, [ field ] { Q_EMIT field->echoModeChanged( field->echoMode() ); } );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::passwordCharacterChanged,
|
||||
input, &QskTextInput::passwordCharacterChanged );
|
||||
QObject::connect( input, &QQuickTextInput::passwordCharacterChanged,
|
||||
field, &QskTextField::passwordCharacterChanged );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickTextInput::passwordMaskDelayChanged,
|
||||
input, &QskTextInput::passwordMaskDelayChanged );
|
||||
QObject::connect( input, &QQuickTextInput::passwordMaskDelayChanged,
|
||||
field, &QskTextField::passwordMaskDelayChanged );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickItem::implicitWidthChanged,
|
||||
input, &QskControl::resetImplicitSize );
|
||||
QObject::connect( input, &QQuickItem::implicitWidthChanged,
|
||||
field, &QskControl::resetImplicitSize );
|
||||
|
||||
QObject::connect( wrappedInput, &QQuickItem::implicitHeightChanged,
|
||||
input, &QskControl::resetImplicitSize );
|
||||
QObject::connect( input, &QQuickItem::implicitHeightChanged,
|
||||
field, &QskControl::resetImplicitSize );
|
||||
}
|
||||
|
||||
namespace
|
||||
|
@ -85,7 +81,7 @@ namespace
|
|||
using Inherited = QQuickTextInput;
|
||||
|
||||
public:
|
||||
TextInput( QskTextInput* );
|
||||
TextInput( QskTextField* );
|
||||
|
||||
void setEditing( bool on );
|
||||
|
||||
|
@ -200,8 +196,8 @@ namespace
|
|||
}
|
||||
};
|
||||
|
||||
TextInput::TextInput( QskTextInput* textInput )
|
||||
: QQuickTextInput( textInput )
|
||||
TextInput::TextInput( QskTextField* textField )
|
||||
: QQuickTextInput( textField )
|
||||
{
|
||||
classBegin();
|
||||
|
||||
|
@ -237,22 +233,22 @@ namespace
|
|||
|
||||
void TextInput::updateMetrics()
|
||||
{
|
||||
auto input = static_cast< const QskTextInput* >( parentItem() );
|
||||
auto textField = static_cast< const QskTextField* >( parentItem() );
|
||||
|
||||
setAlignment( input->alignment() );
|
||||
setFont( input->font() );
|
||||
setAlignment( textField->alignment() );
|
||||
setFont( textField->font() );
|
||||
}
|
||||
|
||||
void TextInput::updateColors()
|
||||
{
|
||||
auto input = static_cast< const QskTextInput* >( parentItem() );
|
||||
auto textField = static_cast< const QskTextField* >( parentItem() );
|
||||
auto d = QQuickTextInputPrivate::get( this );
|
||||
|
||||
bool isDirty = false;
|
||||
|
||||
QColor color;
|
||||
|
||||
color = input->color( QskTextInput::Text );
|
||||
color = textField->color( QskTextField::Text );
|
||||
if ( d->color != color )
|
||||
{
|
||||
d->color = color;
|
||||
|
@ -261,14 +257,14 @@ namespace
|
|||
|
||||
if ( d->hasSelectedText() )
|
||||
{
|
||||
color = input->color( QskTextInput::PanelSelected );
|
||||
color = textField->color( QskTextField::Panel | QskTextFieldSkinlet::Selected );
|
||||
if ( d->selectionColor != color )
|
||||
{
|
||||
d->selectionColor = color;
|
||||
isDirty = true;
|
||||
}
|
||||
|
||||
color = input->color( QskTextInput::TextSelected );
|
||||
color = textField->color( QskTextField::Text | QskTextFieldSkinlet::Selected );
|
||||
if ( d->selectedTextColor != color )
|
||||
{
|
||||
d->selectedTextColor = color;
|
||||
|
@ -285,17 +281,17 @@ namespace
|
|||
}
|
||||
}
|
||||
|
||||
class QskTextInput::PrivateData
|
||||
class QskTextField::PrivateData
|
||||
{
|
||||
public:
|
||||
TextInput* textInput;
|
||||
QString description; // f.e. used as prompt in QskInputPanel
|
||||
QString placeholderText;
|
||||
|
||||
unsigned int activationModes : 3;
|
||||
bool hasPanel : 1;
|
||||
};
|
||||
|
||||
QskTextInput::QskTextInput( QQuickItem* parent )
|
||||
QskTextField::QskTextField( QQuickItem* parent )
|
||||
: Inherited( parent )
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
|
@ -325,17 +321,17 @@ QskTextInput::QskTextInput( QQuickItem* parent )
|
|||
initSizePolicy( QskSizePolicy::Expanding, QskSizePolicy::Fixed );
|
||||
}
|
||||
|
||||
QskTextInput::QskTextInput( const QString& text, QQuickItem* parent )
|
||||
: QskTextInput( parent )
|
||||
QskTextField::QskTextField( const QString& text, QQuickItem* parent )
|
||||
: QskTextField( parent )
|
||||
{
|
||||
m_data->textInput->setText( text );
|
||||
}
|
||||
|
||||
QskTextInput::~QskTextInput()
|
||||
QskTextField::~QskTextField()
|
||||
{
|
||||
}
|
||||
|
||||
void QskTextInput::setPanel( bool on )
|
||||
void QskTextField::setPanel( bool on )
|
||||
{
|
||||
if ( on != m_data->hasPanel )
|
||||
{
|
||||
|
@ -347,12 +343,12 @@ void QskTextInput::setPanel( bool on )
|
|||
}
|
||||
}
|
||||
|
||||
bool QskTextInput::hasPanel() const
|
||||
bool QskTextField::hasPanel() const
|
||||
{
|
||||
return m_data->hasPanel;
|
||||
}
|
||||
|
||||
bool QskTextInput::event( QEvent* event )
|
||||
bool QskTextField::event( QEvent* event )
|
||||
{
|
||||
if ( event->type() == QEvent::ShortcutOverride )
|
||||
{
|
||||
|
@ -366,7 +362,7 @@ bool QskTextInput::event( QEvent* event )
|
|||
return Inherited::event( event );
|
||||
}
|
||||
|
||||
void QskTextInput::keyPressEvent( QKeyEvent* event )
|
||||
void QskTextField::keyPressEvent( QKeyEvent* event )
|
||||
{
|
||||
if ( isEditing() )
|
||||
{
|
||||
|
@ -418,12 +414,12 @@ void QskTextInput::keyPressEvent( QKeyEvent* event )
|
|||
Inherited::keyPressEvent( event );
|
||||
}
|
||||
|
||||
void QskTextInput::keyReleaseEvent( QKeyEvent* event )
|
||||
void QskTextField::keyReleaseEvent( QKeyEvent* event )
|
||||
{
|
||||
Inherited::keyReleaseEvent( event );
|
||||
}
|
||||
|
||||
void QskTextInput::mousePressEvent( QMouseEvent* event )
|
||||
void QskTextField::mousePressEvent( QMouseEvent* event )
|
||||
{
|
||||
m_data->textInput->handleEvent( event );
|
||||
|
||||
|
@ -431,12 +427,12 @@ void QskTextInput::mousePressEvent( QMouseEvent* event )
|
|||
setEditing( true );
|
||||
}
|
||||
|
||||
void QskTextInput::mouseMoveEvent( QMouseEvent* event )
|
||||
void QskTextField::mouseMoveEvent( QMouseEvent* event )
|
||||
{
|
||||
m_data->textInput->handleEvent( event );
|
||||
}
|
||||
|
||||
void QskTextInput::mouseReleaseEvent( QMouseEvent* event )
|
||||
void QskTextField::mouseReleaseEvent( QMouseEvent* event )
|
||||
{
|
||||
m_data->textInput->handleEvent( event );
|
||||
|
||||
|
@ -444,17 +440,17 @@ void QskTextInput::mouseReleaseEvent( QMouseEvent* event )
|
|||
setEditing( true );
|
||||
}
|
||||
|
||||
void QskTextInput::mouseDoubleClickEvent( QMouseEvent* event )
|
||||
void QskTextField::mouseDoubleClickEvent( QMouseEvent* event )
|
||||
{
|
||||
m_data->textInput->handleEvent( event );
|
||||
}
|
||||
|
||||
void QskTextInput::inputMethodEvent( QInputMethodEvent* event )
|
||||
void QskTextField::inputMethodEvent( QInputMethodEvent* event )
|
||||
{
|
||||
m_data->textInput->handleEvent( event );
|
||||
}
|
||||
|
||||
void QskTextInput::focusInEvent( QFocusEvent* event )
|
||||
void QskTextField::focusInEvent( QFocusEvent* event )
|
||||
{
|
||||
if ( m_data->activationModes & ActivationOnFocus )
|
||||
{
|
||||
|
@ -475,7 +471,7 @@ void QskTextInput::focusInEvent( QFocusEvent* event )
|
|||
Inherited::focusInEvent( event );
|
||||
}
|
||||
|
||||
void QskTextInput::focusOutEvent( QFocusEvent* event )
|
||||
void QskTextField::focusOutEvent( QFocusEvent* event )
|
||||
{
|
||||
switch ( event->reason() )
|
||||
{
|
||||
|
@ -494,70 +490,48 @@ void QskTextInput::focusOutEvent( QFocusEvent* event )
|
|||
Inherited::focusOutEvent( event );
|
||||
}
|
||||
|
||||
QSizeF QskTextInput::layoutSizeHint( Qt::SizeHint which, const QSizeF& ) const
|
||||
void QskTextField::updateLayout()
|
||||
{
|
||||
if ( which != Qt::PreferredSize )
|
||||
return QSizeF();
|
||||
|
||||
auto input = m_data->textInput;
|
||||
|
||||
input->updateMetrics();
|
||||
|
||||
QSizeF hint( input->implicitWidth(), input->implicitHeight() );
|
||||
|
||||
if ( m_data->hasPanel )
|
||||
{
|
||||
hint = outerBoxSize( Panel, hint );
|
||||
hint = hint.expandedTo( strutSizeHint( Panel ) );
|
||||
}
|
||||
|
||||
return hint;
|
||||
m_data->textInput->updateMetrics();
|
||||
qskSetItemGeometry( m_data->textInput, subControlRect( Text ) );
|
||||
}
|
||||
|
||||
void QskTextInput::updateLayout()
|
||||
{
|
||||
auto input = m_data->textInput;
|
||||
|
||||
input->updateMetrics();
|
||||
qskSetItemGeometry( input, subControlRect( Text ) );
|
||||
}
|
||||
|
||||
void QskTextInput::updateNode( QSGNode* node )
|
||||
void QskTextField::updateNode( QSGNode* node )
|
||||
{
|
||||
m_data->textInput->updateColors();
|
||||
Inherited::updateNode( node );
|
||||
}
|
||||
|
||||
QString QskTextInput::text() const
|
||||
QString QskTextField::text() const
|
||||
{
|
||||
return m_data->textInput->text();
|
||||
}
|
||||
|
||||
void QskTextInput::setText( const QString& text )
|
||||
void QskTextField::setText( const QString& text )
|
||||
{
|
||||
m_data->textInput->setText( text );
|
||||
}
|
||||
|
||||
void QskTextInput::setDescription( const QString& text )
|
||||
void QskTextField::setPlaceholderText( const QString& text )
|
||||
{
|
||||
if ( m_data->description != text )
|
||||
if ( m_data->placeholderText != text )
|
||||
{
|
||||
m_data->description = text;
|
||||
Q_EMIT descriptionChanged( text );
|
||||
m_data->placeholderText = text;
|
||||
Q_EMIT placeholderTextChanged( text );
|
||||
}
|
||||
}
|
||||
|
||||
QString QskTextInput::description() const
|
||||
QString QskTextField::placeholderText() const
|
||||
{
|
||||
return m_data->description;
|
||||
return m_data->placeholderText;
|
||||
}
|
||||
|
||||
QskTextInput::ActivationModes QskTextInput::activationModes() const
|
||||
QskTextField::ActivationModes QskTextField::activationModes() const
|
||||
{
|
||||
return static_cast< QskTextInput::ActivationModes >( m_data->activationModes );
|
||||
return static_cast< QskTextField::ActivationModes >( m_data->activationModes );
|
||||
}
|
||||
|
||||
void QskTextInput::setActivationModes( ActivationModes modes )
|
||||
void QskTextField::setActivationModes( ActivationModes modes )
|
||||
{
|
||||
if ( static_cast< ActivationModes >( m_data->activationModes ) != modes )
|
||||
{
|
||||
|
@ -566,13 +540,13 @@ void QskTextInput::setActivationModes( ActivationModes modes )
|
|||
}
|
||||
}
|
||||
|
||||
static inline void qskUpdateInputMethodFont( const QskTextInput* input )
|
||||
static inline void qskUpdateInputMethodFont( const QskTextField* input )
|
||||
{
|
||||
const auto queries = Qt::ImCursorRectangle | Qt::ImFont | Qt::ImAnchorRectangle;
|
||||
qskUpdateInputMethod( input, queries );
|
||||
}
|
||||
|
||||
void QskTextInput::setFontRole( const QskFontRole& role )
|
||||
void QskTextField::setFontRole( const QskFontRole& role )
|
||||
{
|
||||
if ( setFontRoleHint( Text, role ) )
|
||||
{
|
||||
|
@ -581,7 +555,7 @@ void QskTextInput::setFontRole( const QskFontRole& role )
|
|||
}
|
||||
}
|
||||
|
||||
void QskTextInput::resetFontRole()
|
||||
void QskTextField::resetFontRole()
|
||||
{
|
||||
if ( resetFontRoleHint( Text ) )
|
||||
{
|
||||
|
@ -590,12 +564,12 @@ void QskTextInput::resetFontRole()
|
|||
}
|
||||
}
|
||||
|
||||
QskFontRole QskTextInput::fontRole() const
|
||||
QskFontRole QskTextField::fontRole() const
|
||||
{
|
||||
return fontRoleHint( Text );
|
||||
}
|
||||
|
||||
void QskTextInput::setAlignment( Qt::Alignment alignment )
|
||||
void QskTextField::setAlignment( Qt::Alignment alignment )
|
||||
{
|
||||
if ( setAlignmentHint( Text, alignment ) )
|
||||
{
|
||||
|
@ -604,7 +578,7 @@ void QskTextInput::setAlignment( Qt::Alignment alignment )
|
|||
}
|
||||
}
|
||||
|
||||
void QskTextInput::resetAlignment()
|
||||
void QskTextField::resetAlignment()
|
||||
{
|
||||
if ( resetAlignmentHint( Text ) )
|
||||
{
|
||||
|
@ -613,34 +587,34 @@ void QskTextInput::resetAlignment()
|
|||
}
|
||||
}
|
||||
|
||||
Qt::Alignment QskTextInput::alignment() const
|
||||
Qt::Alignment QskTextField::alignment() const
|
||||
{
|
||||
return alignmentHint( Text, Qt::AlignLeft | Qt::AlignTop );
|
||||
}
|
||||
|
||||
void QskTextInput::setWrapMode( QskTextOptions::WrapMode wrapMode )
|
||||
void QskTextField::setWrapMode( QskTextOptions::WrapMode wrapMode )
|
||||
{
|
||||
m_data->textInput->setWrapMode(
|
||||
static_cast< QQuickTextInput::WrapMode >( wrapMode ) );
|
||||
}
|
||||
|
||||
QskTextOptions::WrapMode QskTextInput::wrapMode() const
|
||||
QskTextOptions::WrapMode QskTextField::wrapMode() const
|
||||
{
|
||||
return static_cast< QskTextOptions::WrapMode >(
|
||||
m_data->textInput->wrapMode() );
|
||||
}
|
||||
|
||||
QFont QskTextInput::font() const
|
||||
QFont QskTextField::font() const
|
||||
{
|
||||
return effectiveFont( QskTextInput::Text );
|
||||
return effectiveFont( QskTextField::Text );
|
||||
}
|
||||
|
||||
bool QskTextInput::isReadOnly() const
|
||||
bool QskTextField::isReadOnly() const
|
||||
{
|
||||
return m_data->textInput->isReadOnly();
|
||||
}
|
||||
|
||||
void QskTextInput::setReadOnly( bool on )
|
||||
void QskTextField::setReadOnly( bool on )
|
||||
{
|
||||
auto input = m_data->textInput;
|
||||
|
||||
|
@ -661,7 +635,7 @@ void QskTextInput::setReadOnly( bool on )
|
|||
setSkinStateFlag( ReadOnly, on );
|
||||
}
|
||||
|
||||
void QskTextInput::setEditing( bool on )
|
||||
void QskTextField::setEditing( bool on )
|
||||
{
|
||||
if ( isReadOnly() || on == isEditing() )
|
||||
return;
|
||||
|
@ -691,63 +665,63 @@ void QskTextInput::setEditing( bool on )
|
|||
Q_EMIT editingChanged( on );
|
||||
}
|
||||
|
||||
bool QskTextInput::isEditing() const
|
||||
bool QskTextField::isEditing() const
|
||||
{
|
||||
return hasSkinState( Editing );
|
||||
}
|
||||
|
||||
void QskTextInput::ensureVisible( int position )
|
||||
void QskTextField::ensureVisible( int position )
|
||||
{
|
||||
m_data->textInput->ensureVisible( position );
|
||||
}
|
||||
|
||||
int QskTextInput::cursorPosition() const
|
||||
int QskTextField::cursorPosition() const
|
||||
{
|
||||
return m_data->textInput->cursorPosition();
|
||||
}
|
||||
|
||||
void QskTextInput::setCursorPosition( int pos )
|
||||
void QskTextField::setCursorPosition( int pos )
|
||||
{
|
||||
m_data->textInput->setCursorPosition( pos );
|
||||
}
|
||||
|
||||
int QskTextInput::maxLength() const
|
||||
int QskTextField::maxLength() const
|
||||
{
|
||||
return m_data->textInput->maxLength();
|
||||
}
|
||||
|
||||
void QskTextInput::setMaxLength( int length )
|
||||
void QskTextField::setMaxLength( int length )
|
||||
{
|
||||
m_data->textInput->setMaxLength( length );
|
||||
}
|
||||
|
||||
QValidator* QskTextInput::validator() const
|
||||
QValidator* QskTextField::validator() const
|
||||
{
|
||||
return m_data->textInput->validator();
|
||||
}
|
||||
|
||||
void QskTextInput::setValidator( QValidator* validator )
|
||||
void QskTextField::setValidator( QValidator* validator )
|
||||
{
|
||||
m_data->textInput->setValidator( validator );
|
||||
}
|
||||
|
||||
QString QskTextInput::inputMask() const
|
||||
QString QskTextField::inputMask() const
|
||||
{
|
||||
return m_data->textInput->inputMask();
|
||||
}
|
||||
|
||||
void QskTextInput::setInputMask( const QString& mask )
|
||||
void QskTextField::setInputMask( const QString& mask )
|
||||
{
|
||||
m_data->textInput->setInputMask( mask );
|
||||
}
|
||||
|
||||
QskTextInput::EchoMode QskTextInput::echoMode() const
|
||||
QskTextField::EchoMode QskTextField::echoMode() const
|
||||
{
|
||||
const auto mode = m_data->textInput->echoMode();
|
||||
return static_cast< QskTextInput::EchoMode >( mode );
|
||||
return static_cast< QskTextField::EchoMode >( mode );
|
||||
}
|
||||
|
||||
void QskTextInput::setEchoMode( EchoMode mode )
|
||||
void QskTextField::setEchoMode( EchoMode mode )
|
||||
{
|
||||
if ( mode != echoMode() )
|
||||
{
|
||||
|
@ -758,75 +732,75 @@ void QskTextInput::setEchoMode( EchoMode mode )
|
|||
}
|
||||
}
|
||||
|
||||
QString QskTextInput::passwordCharacter() const
|
||||
QString QskTextField::passwordCharacter() const
|
||||
{
|
||||
return m_data->textInput->passwordCharacter();
|
||||
}
|
||||
|
||||
void QskTextInput::setPasswordCharacter( const QString& text )
|
||||
void QskTextField::setPasswordCharacter( const QString& text )
|
||||
{
|
||||
m_data->textInput->setPasswordCharacter( text );
|
||||
}
|
||||
|
||||
void QskTextInput::resetPasswordCharacter()
|
||||
void QskTextField::resetPasswordCharacter()
|
||||
{
|
||||
m_data->textInput->setPasswordCharacter(
|
||||
QGuiApplication::styleHints()->passwordMaskCharacter() );
|
||||
}
|
||||
|
||||
int QskTextInput::passwordMaskDelay() const
|
||||
int QskTextField::passwordMaskDelay() const
|
||||
{
|
||||
return m_data->textInput->passwordMaskDelay();
|
||||
}
|
||||
|
||||
void QskTextInput::setPasswordMaskDelay( int ms )
|
||||
void QskTextField::setPasswordMaskDelay( int ms )
|
||||
{
|
||||
m_data->textInput->setPasswordMaskDelay( ms );
|
||||
}
|
||||
|
||||
void QskTextInput::resetPasswordMaskDelay()
|
||||
void QskTextField::resetPasswordMaskDelay()
|
||||
{
|
||||
m_data->textInput->resetPasswordMaskDelay();
|
||||
}
|
||||
|
||||
QString QskTextInput::displayText() const
|
||||
QString QskTextField::displayText() const
|
||||
{
|
||||
return m_data->textInput->displayText();
|
||||
}
|
||||
|
||||
QString QskTextInput::preeditText() const
|
||||
QString QskTextField::preeditText() const
|
||||
{
|
||||
const auto d = QQuickTextInputPrivate::get( m_data->textInput );
|
||||
return d->m_textLayout.preeditAreaText();
|
||||
}
|
||||
|
||||
bool QskTextInput::overwriteMode() const
|
||||
bool QskTextField::overwriteMode() const
|
||||
{
|
||||
return m_data->textInput->overwriteMode();
|
||||
}
|
||||
|
||||
void QskTextInput::setOverwriteMode( bool overwrite )
|
||||
void QskTextField::setOverwriteMode( bool overwrite )
|
||||
{
|
||||
m_data->textInput->setOverwriteMode( overwrite );
|
||||
}
|
||||
|
||||
bool QskTextInput::hasAcceptableInput() const
|
||||
bool QskTextField::hasAcceptableInput() const
|
||||
{
|
||||
return m_data->textInput->hasAcceptableInput();
|
||||
}
|
||||
|
||||
bool QskTextInput::fixup()
|
||||
bool QskTextField::fixup()
|
||||
{
|
||||
return m_data->textInput->fixup();
|
||||
}
|
||||
|
||||
QVariant QskTextInput::inputMethodQuery(
|
||||
QVariant QskTextField::inputMethodQuery(
|
||||
Qt::InputMethodQuery property ) const
|
||||
{
|
||||
return inputMethodQuery( property, QVariant() );
|
||||
}
|
||||
|
||||
QVariant QskTextInput::inputMethodQuery(
|
||||
QVariant QskTextField::inputMethodQuery(
|
||||
Qt::InputMethodQuery query, const QVariant& argument ) const
|
||||
{
|
||||
switch ( query )
|
||||
|
@ -860,22 +834,22 @@ QVariant QskTextInput::inputMethodQuery(
|
|||
}
|
||||
}
|
||||
|
||||
bool QskTextInput::canUndo() const
|
||||
bool QskTextField::canUndo() const
|
||||
{
|
||||
return m_data->textInput->canUndo();
|
||||
}
|
||||
|
||||
bool QskTextInput::canRedo() const
|
||||
bool QskTextField::canRedo() const
|
||||
{
|
||||
return m_data->textInput->canRedo();
|
||||
}
|
||||
|
||||
Qt::InputMethodHints QskTextInput::inputMethodHints() const
|
||||
Qt::InputMethodHints QskTextField::inputMethodHints() const
|
||||
{
|
||||
return m_data->textInput->inputMethodHints();
|
||||
}
|
||||
|
||||
void QskTextInput::setInputMethodHints( Qt::InputMethodHints hints )
|
||||
void QskTextField::setInputMethodHints( Qt::InputMethodHints hints )
|
||||
{
|
||||
if ( m_data->textInput->inputMethodHints() != hints )
|
||||
{
|
||||
|
@ -884,7 +858,7 @@ void QskTextInput::setInputMethodHints( Qt::InputMethodHints hints )
|
|||
}
|
||||
}
|
||||
|
||||
void QskTextInput::setupFrom( const QQuickItem* item )
|
||||
void QskTextField::setupFrom( const QQuickItem* item )
|
||||
{
|
||||
if ( item == nullptr )
|
||||
return;
|
||||
|
@ -892,7 +866,7 @@ void QskTextInput::setupFrom( const QQuickItem* item )
|
|||
// finding attributes from the input hints of item
|
||||
|
||||
int maxCharacters = 32767;
|
||||
QskTextInput::EchoMode echoMode = QskTextInput::Normal;
|
||||
QskTextField::EchoMode echoMode = QskTextField::Normal;
|
||||
|
||||
Qt::InputMethodQueries queries = Qt::ImQueryAll;
|
||||
queries &= ~Qt::ImEnabled;
|
||||
|
@ -906,7 +880,7 @@ void QskTextInput::setupFrom( const QQuickItem* item )
|
|||
event.value( Qt::ImHints ).toInt() );
|
||||
|
||||
if ( hints & Qt::ImhHiddenText )
|
||||
echoMode = QskTextInput::NoEcho;
|
||||
echoMode = QskTextField::NoEcho;
|
||||
}
|
||||
|
||||
if ( event.queries() & Qt::ImMaximumTextLength )
|
||||
|
@ -944,7 +918,7 @@ void QskTextInput::setupFrom( const QQuickItem* item )
|
|||
int passwordMaskDelay = -1;
|
||||
QString passwordCharacter;
|
||||
|
||||
if ( echoMode == QskTextInput::NoEcho )
|
||||
if ( echoMode == QskTextField::NoEcho )
|
||||
{
|
||||
/*
|
||||
Qt::ImhHiddenText does not provide information
|
||||
|
@ -967,8 +941,8 @@ void QskTextInput::setupFrom( const QQuickItem* item )
|
|||
if ( value.canConvert< int >() )
|
||||
{
|
||||
const auto mode = value.toInt();
|
||||
if ( mode == QskTextInput::Password )
|
||||
echoMode = QskTextInput::Password;
|
||||
if ( mode == QskTextField::Password )
|
||||
echoMode = QskTextField::Password;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -985,4 +959,4 @@ void QskTextInput::setupFrom( const QQuickItem* item )
|
|||
setEchoMode( echoMode );
|
||||
}
|
||||
|
||||
#include "moc_QskTextInput.cpp"
|
||||
#include "moc_QskTextField.cpp"
|
|
@ -3,8 +3,8 @@
|
|||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef QSK_TEXT_INPUT_H
|
||||
#define QSK_TEXT_INPUT_H
|
||||
#ifndef QSK_TEXT_FIELD_H
|
||||
#define QSK_TEXT_FIELD_H
|
||||
|
||||
#include "QskControl.h"
|
||||
#include "QskTextOptions.h"
|
||||
|
@ -12,14 +12,14 @@
|
|||
class QValidator;
|
||||
class QskFontRole;
|
||||
|
||||
class QSK_EXPORT QskTextInput : public QskControl
|
||||
class QSK_EXPORT QskTextField : public QskControl
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged USER true)
|
||||
|
||||
Q_PROPERTY( QString description READ description
|
||||
WRITE setDescription NOTIFY descriptionChanged )
|
||||
Q_PROPERTY( QString placeholderText READ placeholderText
|
||||
WRITE setPlaceholderText NOTIFY placeholderTextChanged )
|
||||
|
||||
Q_PROPERTY( QskFontRole fontRole READ fontRole
|
||||
WRITE setFontRole RESET resetFontRole NOTIFY fontRoleChanged )
|
||||
|
@ -55,10 +55,10 @@ class QSK_EXPORT QskTextInput : public QskControl
|
|||
using Inherited = QskControl;
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Text, PanelSelected, TextSelected )
|
||||
QSK_SUBCONTROLS( Panel, Text, PlaceholderText )
|
||||
QSK_STATES( ReadOnly, Editing )
|
||||
|
||||
enum ActivationMode
|
||||
enum ActivationMode : quint8
|
||||
{
|
||||
NoActivation,
|
||||
|
||||
|
@ -73,7 +73,7 @@ class QSK_EXPORT QskTextInput : public QskControl
|
|||
Q_ENUM( ActivationMode )
|
||||
Q_DECLARE_FLAGS( ActivationModes, ActivationMode )
|
||||
|
||||
enum EchoMode
|
||||
enum EchoMode : quint8
|
||||
{
|
||||
Normal,
|
||||
NoEcho,
|
||||
|
@ -83,17 +83,17 @@ class QSK_EXPORT QskTextInput : public QskControl
|
|||
|
||||
Q_ENUM( EchoMode )
|
||||
|
||||
QskTextInput( QQuickItem* parent = nullptr );
|
||||
QskTextInput( const QString& text, QQuickItem* parent = nullptr );
|
||||
QskTextField( QQuickItem* parent = nullptr );
|
||||
QskTextField( const QString& text, QQuickItem* parent = nullptr );
|
||||
|
||||
~QskTextInput() override;
|
||||
~QskTextField() override;
|
||||
|
||||
void setupFrom( const QQuickItem* );
|
||||
|
||||
QString text() const;
|
||||
|
||||
void setDescription( const QString& );
|
||||
QString description() const;
|
||||
void setPlaceholderText( const QString& );
|
||||
QString placeholderText() const;
|
||||
|
||||
void setPanel( bool );
|
||||
bool hasPanel() const;
|
||||
|
@ -177,7 +177,7 @@ class QSK_EXPORT QskTextInput : public QskControl
|
|||
void displayTextChanged( const QString& );
|
||||
|
||||
void textEdited( const QString& );
|
||||
void descriptionChanged( const QString& );
|
||||
void placeholderTextChanged( const QString& );
|
||||
|
||||
void fontRoleChanged();
|
||||
void alignmentChanged();
|
||||
|
@ -209,8 +209,6 @@ class QSK_EXPORT QskTextInput : public QskControl
|
|||
void keyPressEvent( QKeyEvent* ) override;
|
||||
void keyReleaseEvent( QKeyEvent* ) override;
|
||||
|
||||
QSizeF layoutSizeHint( Qt::SizeHint, const QSizeF& ) const override;
|
||||
|
||||
void updateLayout() override;
|
||||
void updateNode( QSGNode* ) override;
|
||||
|
||||
|
@ -219,7 +217,7 @@ class QSK_EXPORT QskTextInput : public QskControl
|
|||
std::unique_ptr< PrivateData > m_data;
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( QskTextInput::ActivationModes )
|
||||
Q_DECLARE_METATYPE( QskTextInput::ActivationModes )
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( QskTextField::ActivationModes )
|
||||
Q_DECLARE_METATYPE( QskTextField::ActivationModes )
|
||||
|
||||
#endif
|
|
@ -0,0 +1,109 @@
|
|||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) The authors
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskTextFieldSkinlet.h"
|
||||
#include "QskTextField.h"
|
||||
|
||||
#include <qfontmetrics.h>
|
||||
|
||||
using Q = QskTextField;
|
||||
|
||||
QSK_SYSTEM_STATE( QskTextFieldSkinlet, Selected, QskAspect::FirstUserState >> 1 )
|
||||
|
||||
QskTextFieldSkinlet::QskTextFieldSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
setNodeRoles( { PanelRole, PlaceholderTextRole, } );
|
||||
}
|
||||
|
||||
QskTextFieldSkinlet::~QskTextFieldSkinlet()
|
||||
{
|
||||
}
|
||||
|
||||
QRectF QskTextFieldSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == Q::Panel )
|
||||
{
|
||||
return contentsRect;
|
||||
}
|
||||
else if ( subControl == Q::Text )
|
||||
{
|
||||
return skinnable->subControlContentsRect( contentsRect, Q::Panel );
|
||||
}
|
||||
else if ( subControl == Q::PlaceholderText )
|
||||
{
|
||||
const auto textField = static_cast< const QskTextField* >( skinnable );
|
||||
if( textField->text().isEmpty() )
|
||||
return subControlRect( skinnable, contentsRect, Q::Text );
|
||||
|
||||
return QRectF();
|
||||
}
|
||||
|
||||
return Inherited::subControlRect( skinnable, contentsRect, subControl );
|
||||
}
|
||||
|
||||
QSGNode* QskTextFieldSkinlet::updateSubNode(
|
||||
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
||||
{
|
||||
const auto textField = static_cast< const QskTextField* >( skinnable );
|
||||
|
||||
switch ( nodeRole )
|
||||
{
|
||||
case PanelRole:
|
||||
{
|
||||
if ( !textField->hasPanel() )
|
||||
return nullptr;
|
||||
|
||||
return updateBoxNode( skinnable, node, Q::Panel );
|
||||
}
|
||||
case PlaceholderTextRole:
|
||||
{
|
||||
if ( textField->text().isEmpty()
|
||||
&& !textField->placeholderText().isEmpty() )
|
||||
{
|
||||
const auto subControl = Q::PlaceholderText;
|
||||
|
||||
QskSkinHintStatus status;
|
||||
|
||||
auto options = skinnable->textOptionsHint( subControl, &status );
|
||||
if ( !status.isValid() )
|
||||
options.setElideMode( Qt::ElideRight );
|
||||
|
||||
return updateTextNode( skinnable, node,
|
||||
textField->subControlRect( subControl ),
|
||||
textField->alignmentHint( subControl, Qt::AlignLeft ),
|
||||
options, textField->placeholderText(), subControl );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
||||
}
|
||||
|
||||
QSizeF QskTextFieldSkinlet::sizeHint( const QskSkinnable* skinnable,
|
||||
Qt::SizeHint which, const QSizeF& ) const
|
||||
{
|
||||
if ( which != Qt::PreferredSize )
|
||||
return QSizeF();
|
||||
|
||||
const auto textField = static_cast< const QskTextField* >( skinnable );
|
||||
|
||||
const QFontMetricsF fm( textField->effectiveFont( Q::Text ) );
|
||||
|
||||
auto hint = fm.size( Qt::TextSingleLine | Qt::TextExpandTabs, textField->text() );
|
||||
|
||||
if ( textField->hasPanel() )
|
||||
{
|
||||
hint = textField->outerBoxSize( Q::Panel, hint );
|
||||
hint = hint.expandedTo( textField->strutSizeHint( Q::Panel ) );
|
||||
}
|
||||
|
||||
return hint;
|
||||
}
|
||||
|
||||
#include "moc_QskTextFieldSkinlet.cpp"
|
|
@ -3,30 +3,36 @@
|
|||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef QSK_TEXT_INPUT_SKINLET_H
|
||||
#define QSK_TEXT_INPUT_SKINLET_H
|
||||
#ifndef QSK_TEXT_FIELD_SKINLET_H
|
||||
#define QSK_TEXT_FIELD_SKINLET_H
|
||||
|
||||
#include "QskSkinlet.h"
|
||||
|
||||
class QSK_EXPORT QskTextInputSkinlet : public QskSkinlet
|
||||
class QSK_EXPORT QskTextFieldSkinlet : public QskSkinlet
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
QSK_STATES( Selected )
|
||||
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
PlaceholderTextRole,
|
||||
RoleCount
|
||||
};
|
||||
|
||||
Q_INVOKABLE QskTextInputSkinlet( QskSkin* = nullptr );
|
||||
~QskTextInputSkinlet() override;
|
||||
Q_INVOKABLE QskTextFieldSkinlet( QskSkin* = nullptr );
|
||||
~QskTextFieldSkinlet() override;
|
||||
|
||||
QRectF subControlRect( const QskSkinnable*,
|
||||
const QRectF& rect, QskAspect::Subcontrol ) const override;
|
||||
|
||||
QSizeF sizeHint( const QskSkinnable*,
|
||||
Qt::SizeHint, const QSizeF& ) const override;
|
||||
|
||||
protected:
|
||||
QSGNode* updateSubNode( const QskSkinnable*,
|
||||
quint8 nodeRole, QSGNode* ) const override;
|
|
@ -1,52 +0,0 @@
|
|||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) The authors
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskTextInputSkinlet.h"
|
||||
#include "QskTextInput.h"
|
||||
|
||||
QskTextInputSkinlet::QskTextInputSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
setNodeRoles( { PanelRole } );
|
||||
}
|
||||
|
||||
QskTextInputSkinlet::~QskTextInputSkinlet()
|
||||
{
|
||||
}
|
||||
|
||||
QRectF QskTextInputSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskTextInput::Panel )
|
||||
{
|
||||
return contentsRect;
|
||||
}
|
||||
else if ( subControl == QskTextInput::Text )
|
||||
{
|
||||
return skinnable->subControlContentsRect( contentsRect, QskTextInput::Panel );
|
||||
}
|
||||
|
||||
return Inherited::subControlRect( skinnable, contentsRect, subControl );
|
||||
}
|
||||
|
||||
QSGNode* QskTextInputSkinlet::updateSubNode(
|
||||
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
||||
{
|
||||
switch ( nodeRole )
|
||||
{
|
||||
case PanelRole:
|
||||
{
|
||||
const auto input = static_cast< const QskTextInput* >( skinnable );
|
||||
if ( !input->hasPanel() )
|
||||
return nullptr;
|
||||
|
||||
return updateBoxNode( skinnable, node, QskTextInput::Panel );
|
||||
}
|
||||
}
|
||||
|
||||
return Inherited::updateSubNode( skinnable, nodeRole, node );
|
||||
}
|
||||
|
||||
#include "moc_QskTextInputSkinlet.cpp"
|
|
@ -15,7 +15,7 @@ class QSK_EXPORT QskTextLabelSkinlet : public QskSkinlet
|
|||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
PanelRole,
|
||||
TextRole,
|
||||
|
|
|
@ -29,7 +29,7 @@ class QSK_EXPORT QskWindow : public QQuickWindow
|
|||
using Inherited = QQuickWindow;
|
||||
|
||||
public:
|
||||
enum EventAcceptance
|
||||
enum EventAcceptance : quint8
|
||||
{
|
||||
EventProcessed = 0,
|
||||
EventPropagationStopped = 1
|
||||
|
|
|
@ -31,7 +31,7 @@ class QSK_EXPORT QskDialog : public QObject
|
|||
WRITE setTransientParent NOTIFY transientParentChanged )
|
||||
|
||||
public:
|
||||
enum Policy
|
||||
enum Policy : quint8
|
||||
{
|
||||
EmbeddedBox,
|
||||
EmbeddedWindow, // not yet implemented, do we need it ?
|
||||
|
@ -41,7 +41,7 @@ class QSK_EXPORT QskDialog : public QObject
|
|||
Q_ENUM( Policy )
|
||||
|
||||
// a.k.a QMessageBox::StandardButton or QPlatformDialogHelper::StandardButton
|
||||
enum Action
|
||||
enum Action : quint32
|
||||
{
|
||||
NoAction = 0,
|
||||
Ok = 1 << 10,
|
||||
|
@ -68,7 +68,7 @@ class QSK_EXPORT QskDialog : public QObject
|
|||
Q_DECLARE_FLAGS( Actions, Action )
|
||||
|
||||
// a.k.a QMessageBox::ButtonRole
|
||||
enum ActionRole
|
||||
enum ActionRole : qint8
|
||||
{
|
||||
InvalidRole = -1,
|
||||
|
||||
|
@ -88,7 +88,7 @@ class QSK_EXPORT QskDialog : public QObject
|
|||
Q_ENUM( ActionRole )
|
||||
|
||||
// for building the mask in QskSkin::dialogButtonLayout
|
||||
enum ButtonLayoutFlag
|
||||
enum ButtonLayoutFlag : quint32
|
||||
{
|
||||
// from QPlatformDialogHelper::ButtonRole
|
||||
ActionMask = 0x0FFFFFFF,
|
||||
|
@ -98,7 +98,7 @@ class QSK_EXPORT QskDialog : public QObject
|
|||
Reverse = 1 << 30
|
||||
};
|
||||
|
||||
enum DialogCode
|
||||
enum DialogCode : quint8
|
||||
{
|
||||
Rejected = 0,
|
||||
Accepted
|
||||
|
|
|
@ -390,7 +390,7 @@ void QskDialogButtonBox::setActions( QskDialog::Actions actions )
|
|||
m_data->buttons[ i ].clear();
|
||||
}
|
||||
|
||||
for ( int i = QskDialog::Ok; i <= QskDialog::RestoreDefaults; i <<= 1 )
|
||||
for ( uint i = QskDialog::Ok; i <= QskDialog::RestoreDefaults; i <<= 1 )
|
||||
{
|
||||
const auto action = static_cast< QskDialog::Action >( i );
|
||||
if ( action & actions )
|
||||
|
|
|
@ -38,14 +38,14 @@ class QSK_EXPORT QskGraphic : public QPaintDevice
|
|||
using Inherited = QPaintDevice;
|
||||
|
||||
public:
|
||||
enum RenderHint
|
||||
enum RenderHint : quint8
|
||||
{
|
||||
RenderPensUnscaled = 0x1
|
||||
RenderPensUnscaled = 1 << 0
|
||||
};
|
||||
|
||||
typedef QFlags< RenderHint > RenderHints;
|
||||
|
||||
enum CommandType
|
||||
enum CommandType : quint8
|
||||
{
|
||||
VectorData = 1 << 0,
|
||||
RasterData = 1 << 1,
|
||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskPainterCommand
|
|||
{
|
||||
public:
|
||||
//! Type of the paint command
|
||||
enum Type
|
||||
enum Type : qint8
|
||||
{
|
||||
//! Invalid command
|
||||
Invalid = -1,
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace QskStandardSymbol
|
|||
{
|
||||
Q_NAMESPACE_EXPORT( QSK_EXPORT )
|
||||
|
||||
enum Type
|
||||
enum Type : qint16
|
||||
{
|
||||
NoSymbol = -1,
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "QskInputPanelBox.h"
|
||||
#include "QskInputPredictionBar.h"
|
||||
#include "QskLinearBox.h"
|
||||
#include "QskTextInput.h"
|
||||
#include "QskTextField.h"
|
||||
#include "QskTextLabel.h"
|
||||
#include "QskVirtualKeyboard.h"
|
||||
|
||||
|
@ -15,11 +15,11 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
class TextInputProxy final : public QskTextInput
|
||||
class TextFieldProxy final : public QskTextField
|
||||
{
|
||||
public:
|
||||
TextInputProxy( QskInputPanelBox* panelBox, QQuickItem* parentItem = nullptr )
|
||||
: QskTextInput( parentItem )
|
||||
TextFieldProxy( QskInputPanelBox* panelBox, QQuickItem* parentItem = nullptr )
|
||||
: QskTextField( parentItem )
|
||||
, m_panelBox( panelBox )
|
||||
{
|
||||
setObjectName( QStringLiteral( "InputBoxProxy" ) );
|
||||
|
@ -32,10 +32,10 @@ namespace
|
|||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const override
|
||||
{
|
||||
if ( subControl == QskTextInput::Panel )
|
||||
if ( subControl == QskTextField::Panel )
|
||||
return m_panelBox->effectiveSubcontrol( QskInputPanelBox::ProxyPanel );
|
||||
|
||||
if ( subControl == QskTextInput::Text )
|
||||
if ( subControl == QskTextField::Text )
|
||||
return m_panelBox->effectiveSubcontrol( QskInputPanelBox::ProxyText );
|
||||
|
||||
return subControl;
|
||||
|
@ -65,7 +65,7 @@ class QskInputPanelBox::PrivateData
|
|||
|
||||
QskLinearBox* layout;
|
||||
QskTextLabel* prompt;
|
||||
TextInputProxy* inputProxy;
|
||||
TextFieldProxy* inputProxy;
|
||||
QskInputPredictionBar* predictionBar;
|
||||
QskVirtualKeyboard* keyboard;
|
||||
|
||||
|
@ -81,7 +81,7 @@ QskInputPanelBox::QskInputPanelBox( QQuickItem* parent )
|
|||
m_data->prompt = new QskTextLabel();
|
||||
m_data->prompt->setVisible( false );
|
||||
|
||||
m_data->inputProxy = new TextInputProxy( this, nullptr );
|
||||
m_data->inputProxy = new TextFieldProxy( this, nullptr );
|
||||
m_data->inputProxy->setVisible(
|
||||
m_data->panelHints & QskInputPanelBox::InputProxy );
|
||||
|
||||
|
@ -184,10 +184,10 @@ QskAspect::Subcontrol QskInputPanelBox::substitutedSubcontrol(
|
|||
#if 1
|
||||
// TODO ...
|
||||
if ( subControl == QskInputPanelBox::ProxyPanel )
|
||||
return QskTextInput::Panel;
|
||||
return QskTextField::Panel;
|
||||
|
||||
if ( subControl == QskInputPanelBox::ProxyText )
|
||||
return QskTextInput::Text;
|
||||
return QskTextField::Text;
|
||||
#endif
|
||||
|
||||
return subControl;
|
||||
|
|
|
@ -29,7 +29,7 @@ class QSK_EXPORT QskInputPanelBox : public QskBox
|
|||
public:
|
||||
QSK_SUBCONTROLS( Panel, ProxyPanel, ProxyText )
|
||||
|
||||
enum PanelHint
|
||||
enum PanelHint : quint8
|
||||
{
|
||||
InputProxy = 1 << 0,
|
||||
Prediction = 1 << 1
|
||||
|
|
|
@ -51,17 +51,19 @@ class QSK_EXPORT QskVirtualKeyboard : public QskBox
|
|||
public:
|
||||
QSK_SUBCONTROLS( Panel, ButtonPanel, ButtonText )
|
||||
|
||||
enum Mode
|
||||
enum Mode : qint8
|
||||
{
|
||||
CurrentMode = -1,
|
||||
|
||||
LowercaseMode,
|
||||
UppercaseMode,
|
||||
SpecialCharacterMode,
|
||||
|
||||
ModeCount
|
||||
};
|
||||
Q_ENUM( Mode )
|
||||
|
||||
enum KeyType
|
||||
enum KeyType : quint8
|
||||
{
|
||||
NormalType,
|
||||
EnterType,
|
||||
|
|
|
@ -47,7 +47,7 @@ class QskLayoutChain
|
|||
QskLayoutMetrics metrics;
|
||||
};
|
||||
|
||||
enum FillMode
|
||||
enum FillMode : quint8
|
||||
{
|
||||
Leading = 1 << 0,
|
||||
Trailing = 1 << 1
|
||||
|
|
|
@ -52,7 +52,7 @@ class QSK_EXPORT QskLayoutEngine2D
|
|||
protected:
|
||||
QRectF geometryAt( const QskLayoutElement*, const QRect& grid ) const;
|
||||
|
||||
enum
|
||||
enum : quint8
|
||||
{
|
||||
ElementCache = 1 << 0,
|
||||
LayoutCache = 1 << 1
|
||||
|
|
|
@ -338,7 +338,7 @@ void QskStackBoxAnimator2::setOrientation( Qt::Orientation orientation )
|
|||
|
||||
Qt::Orientation QskStackBoxAnimator2::orientation() const
|
||||
{
|
||||
return m_orientation;
|
||||
return static_cast< Qt::Orientation >( m_orientation );
|
||||
}
|
||||
|
||||
void QskStackBoxAnimator2::setInverted( bool on )
|
||||
|
|
|
@ -96,7 +96,7 @@ class QSK_EXPORT QskStackBoxAnimator2 : public QskStackBoxAnimator
|
|||
void done() override;
|
||||
|
||||
private:
|
||||
Qt::Orientation m_orientation : 2;
|
||||
unsigned int m_orientation : 2;
|
||||
bool m_inverted : 1;
|
||||
};
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
enum NodeRole
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
/*
|
||||
If possible border + filling will be displayed by ArcRole
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
enum Role
|
||||
enum NodeRole : quint8
|
||||
{
|
||||
ShadowRole,
|
||||
ShadowFillRole,
|
||||
|
|
|
@ -20,7 +20,7 @@ class QSK_EXPORT QskFillNode : public QSGGeometryNode
|
|||
using Inherited = QSGGeometryNode;
|
||||
|
||||
public:
|
||||
enum Coloring
|
||||
enum Coloring : quint8
|
||||
{
|
||||
Monochrome,
|
||||
Polychrome,
|
||||
|
@ -30,7 +30,7 @@ class QSK_EXPORT QskFillNode : public QSGGeometryNode
|
|||
Conic
|
||||
};
|
||||
|
||||
enum Hint
|
||||
enum Hint : quint8
|
||||
{
|
||||
/*
|
||||
Colors might be defined in the material ( QskGradientMaterial,
|
||||
|
@ -46,7 +46,7 @@ class QSK_EXPORT QskFillNode : public QSGGeometryNode
|
|||
The default setting is to use colored points where possible. Note, that
|
||||
this is what is also done in the Qt/Quick classes.
|
||||
*/
|
||||
PreferColoredGeometry = 1
|
||||
PreferColoredGeometry = 1 << 0
|
||||
};
|
||||
|
||||
Q_ENUM( Hint )
|
||||
|
|
|
@ -21,7 +21,7 @@ class QSK_EXPORT QskGraduationNode : public QskBasicLinesNode
|
|||
using Inherited = QskBasicLinesNode;
|
||||
|
||||
public:
|
||||
enum Alignment
|
||||
enum Alignment : quint8
|
||||
{
|
||||
Leading,
|
||||
Centered,
|
||||
|
|
|
@ -33,7 +33,7 @@ class QSK_EXPORT QskGraduationRenderer
|
|||
Q_GADGET
|
||||
|
||||
public:
|
||||
enum Flag
|
||||
enum Flag : quint8
|
||||
{
|
||||
Backbone = 1 << 0,
|
||||
CenteredTickmarks = 1 << 1,
|
||||
|
|
|
@ -27,7 +27,7 @@ class QSK_EXPORT QskPaintedNode : public QSGNode
|
|||
OpenGL might be ignored depending on the backend used by the
|
||||
application.
|
||||
*/
|
||||
enum RenderHint
|
||||
enum RenderHint : quint8
|
||||
{
|
||||
Raster,
|
||||
OpenGL
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue