input panel: Apply style to new input panel
This commit is contained in:
parent
5a250eff8b
commit
debd286b4d
|
@ -56,7 +56,7 @@ QskInputCompositionModel::QskInputCompositionModel():
|
|||
{
|
||||
m_data->groupIndex = 0;
|
||||
|
||||
m_data->preeditFormat.setFontUnderline(true);
|
||||
m_data->preeditFormat.setFontUnderline( true );
|
||||
m_data->preeditAttributes.append( QInputMethodEvent::Attribute(
|
||||
QInputMethodEvent::TextFormat, 0, 0, m_data->preeditFormat ) );
|
||||
}
|
||||
|
|
|
@ -521,39 +521,37 @@ void QskMaterialSkin::initTabViewHints()
|
|||
void QskMaterialSkin::initInputPanelHints()
|
||||
{
|
||||
using namespace QskAspect;
|
||||
using Q = QskInputPanel;
|
||||
using Q = QskKeyButton;
|
||||
|
||||
const ColorPalette& pal = m_data->palette;
|
||||
|
||||
/*
|
||||
// key panel
|
||||
setMargins( Q::KeyPanel | Margin, 2 );
|
||||
// setMargins( Q::KeyPanel | Margin, 2 );
|
||||
|
||||
setBoxShape( Q::KeyPanel, 20.0, Qt::RelativeSize );
|
||||
setBoxBorderMetrics( Q::KeyPanel, 2 );
|
||||
setBoxShape( Q::Panel, 20.0, Qt::RelativeSize );
|
||||
setBoxBorderMetrics( Q::Panel, 2 );
|
||||
|
||||
setGradient( Q::KeyPanel, pal.darker125 );
|
||||
setBoxBorderColors( Q::KeyPanel, pal.baseColor );
|
||||
setGradient( Q::Panel, pal.darker125 );
|
||||
setBoxBorderColors( Q::Panel, pal.baseColor );
|
||||
|
||||
for ( auto state : { NoState, Q::Focused } )
|
||||
setBoxBorderColors( Q::KeyPanel | Q::Pressed | state, pal.accentColor );
|
||||
setBoxBorderColors( Q::Panel | Q::Pressed | state, pal.accentColor );
|
||||
|
||||
setAnimation( Q::KeyPanel | Color, qskDuration );
|
||||
setAnimation( Q::KeyPanel | Metric, qskDuration );
|
||||
setAnimation( Q::Panel | Color, qskDuration );
|
||||
setAnimation( Q::Panel | Metric, qskDuration );
|
||||
|
||||
// glyph
|
||||
setSkinHint( Q::KeyGlyph | Alignment, Qt::AlignCenter );
|
||||
setFontRole( Q::KeyGlyph, QskSkin::TinyFont );
|
||||
// setSkinHint( Q::KeyGlyph | Alignment, Qt::AlignCenter );
|
||||
// setFontRole( Q::KeyGlyph, QskSkin::TinyFont );
|
||||
|
||||
setColor( Q::KeyGlyph, pal.textColor );
|
||||
setColor( Q::KeyGlyph | Q::Disabled, pal.darker200 );
|
||||
// setColor( Q::KeyGlyph, pal.textColor );
|
||||
// setColor( Q::KeyGlyph | Q::Disabled, pal.darker200 );
|
||||
|
||||
// panel
|
||||
setBoxShape( Q::Panel, 0 );
|
||||
setBoxBorderMetrics( Q::Panel, 0 );
|
||||
setGradient( Q::Panel, pal.darker150 );
|
||||
setBoxBorderColors( Q::Panel, pal.baseColor );
|
||||
*/
|
||||
}
|
||||
|
||||
void QskMaterialSkin::initScrollViewHints()
|
||||
|
|
|
@ -554,38 +554,36 @@ void QskSquiekSkin::initTabViewHints()
|
|||
void QskSquiekSkin::initInputPanelHints()
|
||||
{
|
||||
using namespace QskAspect;
|
||||
using Q = QskInputPanel;
|
||||
using Q = QskKeyButton;
|
||||
|
||||
const ColorPalette& pal = m_data->palette;
|
||||
|
||||
/*
|
||||
// key panel
|
||||
setMargins( Q::KeyPanel | Margin, 2 ); // should be Panel | Spacing
|
||||
// setMargins( Q::Panel | Margin, 2 ); // should be Panel | Spacing
|
||||
|
||||
setButton( Q::KeyPanel, Raised );
|
||||
setButton( Q::KeyPanel | Q::Pressed, Sunken );
|
||||
setButton( Q::Panel, Raised );
|
||||
setButton( Q::Panel | Q::Pressed, Sunken );
|
||||
|
||||
setAnimation( Q::KeyPanel | Color, qskDuration );
|
||||
setAnimation( Q::Panel | Color, qskDuration );
|
||||
#if 0
|
||||
// crashes because animations are started from updateNode
|
||||
// TODO ...
|
||||
|
||||
setAnimation( Q::KeyPanel | Metric, qskDuration );
|
||||
setAnimation( Q::Panel | Metric, qskDuration );
|
||||
#endif
|
||||
|
||||
// glyph
|
||||
setSkinHint( Q::KeyGlyph | Alignment, Qt::AlignCenter );
|
||||
setFontRole( Q::KeyGlyph, QskSkin::TinyFont );
|
||||
// setSkinHint( Q::Text | Alignment, Qt::AlignCenter );
|
||||
// setFontRole( Q::Text, QskSkin::TinyFont );
|
||||
|
||||
setColor( Q::KeyGlyph, pal.themeForeground );
|
||||
setColor( Q::KeyGlyph | Q::Disabled, pal.darker200 );
|
||||
setColor( Q::Text, pal.themeForeground );
|
||||
setColor( Q::Text | Q::Disabled, pal.darker200 );
|
||||
|
||||
// panel
|
||||
// // panel
|
||||
|
||||
setMargins( Q::Panel | Padding, 5 );
|
||||
setMargins( Q::Panel | Spacing, 5 );
|
||||
setPanel( Q::Panel, Raised );
|
||||
*/
|
||||
// setMargins( Q::Panel | Padding, 5 );
|
||||
// setMargins( Q::Panel | Spacing, 5 );
|
||||
// setPanel( Q::Panel, Raised );
|
||||
}
|
||||
|
||||
void QskSquiekSkin::initScrollViewHints()
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
class QskInputCompositionModel;
|
||||
class QskInputPanel;
|
||||
|
||||
class QskKeyButton : public QskPushButton
|
||||
class QskKeyButton : public QskPushButton // ### rename to QskInputButton or so?
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
using KeyDataSet = KeyDataRow[RowCount];
|
||||
|
||||
QskInputPanel( QQuickItem* parent = nullptr );
|
||||
virtual ~QskInputPanel();
|
||||
virtual ~QskInputPanel() override;
|
||||
|
||||
void updateLocale( const QLocale& locale );
|
||||
|
||||
|
|
Loading…
Reference in New Issue