styling of QskInputPanel
This commit is contained in:
parent
a62e7fb3e2
commit
1e71259406
@ -20,12 +20,24 @@ namespace
|
|||||||
class TextInputProxy final : public QskTextInput
|
class TextInputProxy final : public QskTextInput
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextInputProxy( QQuickItem* parentItem = nullptr ):
|
TextInputProxy( QskInputPanel* panel, QQuickItem* parentItem = nullptr ):
|
||||||
QskTextInput( parentItem )
|
QskTextInput( parentItem ),
|
||||||
|
m_panel( panel )
|
||||||
{
|
{
|
||||||
setObjectName( "InputPanelInputProxy" );
|
setObjectName( "InputPanelInputProxy" );
|
||||||
setFocusPolicy( Qt::NoFocus );
|
setFocusPolicy( Qt::NoFocus );
|
||||||
setSizePolicy( QskSizePolicy::Ignored, QskSizePolicy::Fixed );
|
}
|
||||||
|
|
||||||
|
virtual QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
|
QskAspect::Subcontrol subControl ) const override
|
||||||
|
{
|
||||||
|
if ( subControl == QskTextInput::Panel )
|
||||||
|
return m_panel->effectiveSubcontrol( QskInputPanel::ProxyPanel );
|
||||||
|
|
||||||
|
if ( subControl == QskTextInput::Text )
|
||||||
|
return m_panel->effectiveSubcontrol( QskInputPanel::ProxyText );
|
||||||
|
|
||||||
|
return subControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -36,10 +48,15 @@ namespace
|
|||||||
virtual void focusOutEvent( QFocusEvent* ) override final
|
virtual void focusOutEvent( QFocusEvent* ) override final
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QskInputPanel* m_panel;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
QSK_SUBCONTROL( QskInputPanel, Panel )
|
QSK_SUBCONTROL( QskInputPanel, Panel )
|
||||||
|
QSK_SUBCONTROL( QskInputPanel, ProxyPanel )
|
||||||
|
QSK_SUBCONTROL( QskInputPanel, ProxyText )
|
||||||
|
|
||||||
class QskInputPanel::PrivateData
|
class QskInputPanel::PrivateData
|
||||||
{
|
{
|
||||||
@ -67,7 +84,7 @@ QskInputPanel::QskInputPanel( QQuickItem* parent ):
|
|||||||
m_data->prompt = new QskTextLabel();
|
m_data->prompt = new QskTextLabel();
|
||||||
m_data->prompt->setVisible( false );
|
m_data->prompt->setVisible( false );
|
||||||
|
|
||||||
m_data->inputProxy = new TextInputProxy();
|
m_data->inputProxy = new TextInputProxy( this, nullptr );
|
||||||
m_data->inputProxy->setVisible(
|
m_data->inputProxy->setVisible(
|
||||||
m_data->panelHints & QskInputPanel::InputProxy );
|
m_data->panelHints & QskInputPanel::InputProxy );
|
||||||
|
|
||||||
@ -169,6 +186,15 @@ QskAspect::Subcontrol QskInputPanel::effectiveSubcontrol(
|
|||||||
if( subControl == QskBox::Panel )
|
if( subControl == QskBox::Panel )
|
||||||
return QskInputPanel::Panel;
|
return QskInputPanel::Panel;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// TODO ...
|
||||||
|
if( subControl == QskInputPanel::ProxyPanel )
|
||||||
|
return QskTextInput::Panel;
|
||||||
|
|
||||||
|
if( subControl == QskInputPanel::ProxyText )
|
||||||
|
return QskTextInput::Text;
|
||||||
|
#endif
|
||||||
|
|
||||||
return subControl;
|
return subControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class QSK_EXPORT QskInputPanel : public QskBox
|
|||||||
WRITE setInputPrompt NOTIFY inputPromptChanged )
|
WRITE setInputPrompt NOTIFY inputPromptChanged )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QSK_SUBCONTROLS( Panel )
|
QSK_SUBCONTROLS( Panel, ProxyPanel, ProxyText )
|
||||||
|
|
||||||
enum PanelHint
|
enum PanelHint
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ namespace
|
|||||||
class Button final : public QskPushButton
|
class Button final : public QskPushButton
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Button( int row, int column, QQuickItem* parent ):
|
Button( int row, int column, QskVirtualKeyboard* parent ):
|
||||||
QskPushButton( parent ),
|
QskPushButton( parent ),
|
||||||
m_row( row ),
|
m_row( row ),
|
||||||
m_column( column )
|
m_column( column )
|
||||||
@ -39,13 +39,15 @@ namespace
|
|||||||
virtual QskAspect::Subcontrol effectiveSubcontrol(
|
virtual QskAspect::Subcontrol effectiveSubcontrol(
|
||||||
QskAspect::Subcontrol subControl ) const override
|
QskAspect::Subcontrol subControl ) const override
|
||||||
{
|
{
|
||||||
if( subControl == QskPushButton::Panel )
|
auto keyBoard = static_cast< const QskVirtualKeyboard*>( parent() );
|
||||||
return QskVirtualKeyboard::ButtonPanel;
|
|
||||||
|
|
||||||
if( subControl == QskPushButton::Text )
|
if ( subControl == QskPushButton::Panel )
|
||||||
return QskVirtualKeyboard::ButtonText;
|
return keyBoard->effectiveSubcontrol( QskVirtualKeyboard::ButtonPanel );
|
||||||
|
|
||||||
return subControl;
|
if ( subControl == QskPushButton::Text )
|
||||||
|
return keyBoard->effectiveSubcontrol( QskVirtualKeyboard::ButtonText );
|
||||||
|
|
||||||
|
return QskPushButton::effectiveSubcontrol( subControl );
|
||||||
}
|
}
|
||||||
|
|
||||||
int row() const { return m_row; }
|
int row() const { return m_row; }
|
||||||
@ -273,6 +275,15 @@ QskAspect::Subcontrol QskVirtualKeyboard::effectiveSubcontrol(
|
|||||||
if( subControl == QskBox::Panel )
|
if( subControl == QskBox::Panel )
|
||||||
return QskVirtualKeyboard::Panel;
|
return QskVirtualKeyboard::Panel;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// TODO ...
|
||||||
|
if( subControl == QskVirtualKeyboard::ButtonPanel )
|
||||||
|
return QskPushButton::Panel;
|
||||||
|
|
||||||
|
if( subControl == QskVirtualKeyboard::ButtonText )
|
||||||
|
return QskPushButton::Text;
|
||||||
|
#endif
|
||||||
|
|
||||||
return subControl;
|
return subControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user