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