input panel: Apply style to new input panel

This commit is contained in:
Peter Hartmann 2018-03-14 17:30:41 +01:00
parent 5a250eff8b
commit debd286b4d
4 changed files with 30 additions and 34 deletions

View File

@ -521,39 +521,37 @@ void QskMaterialSkin::initTabViewHints()
void QskMaterialSkin::initInputPanelHints() void QskMaterialSkin::initInputPanelHints()
{ {
using namespace QskAspect; using namespace QskAspect;
using Q = QskInputPanel; using Q = QskKeyButton;
const ColorPalette& pal = m_data->palette; const ColorPalette& pal = m_data->palette;
/*
// key panel // key panel
setMargins( Q::KeyPanel | Margin, 2 ); // setMargins( Q::KeyPanel | Margin, 2 );
setBoxShape( Q::KeyPanel, 20.0, Qt::RelativeSize ); setBoxShape( Q::Panel, 20.0, Qt::RelativeSize );
setBoxBorderMetrics( Q::KeyPanel, 2 ); setBoxBorderMetrics( Q::Panel, 2 );
setGradient( Q::KeyPanel, pal.darker125 ); setGradient( Q::Panel, pal.darker125 );
setBoxBorderColors( Q::KeyPanel, pal.baseColor ); setBoxBorderColors( Q::Panel, pal.baseColor );
for ( auto state : { NoState, Q::Focused } ) 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::Panel | Color, qskDuration );
setAnimation( Q::KeyPanel | Metric, qskDuration ); setAnimation( Q::Panel | Metric, qskDuration );
// glyph // glyph
setSkinHint( Q::KeyGlyph | Alignment, Qt::AlignCenter ); // setSkinHint( Q::KeyGlyph | Alignment, Qt::AlignCenter );
setFontRole( Q::KeyGlyph, QskSkin::TinyFont ); // setFontRole( Q::KeyGlyph, QskSkin::TinyFont );
setColor( Q::KeyGlyph, pal.textColor ); // setColor( Q::KeyGlyph, pal.textColor );
setColor( Q::KeyGlyph | Q::Disabled, pal.darker200 ); // setColor( Q::KeyGlyph | Q::Disabled, pal.darker200 );
// panel // panel
setBoxShape( Q::Panel, 0 ); setBoxShape( Q::Panel, 0 );
setBoxBorderMetrics( Q::Panel, 0 ); setBoxBorderMetrics( Q::Panel, 0 );
setGradient( Q::Panel, pal.darker150 ); setGradient( Q::Panel, pal.darker150 );
setBoxBorderColors( Q::Panel, pal.baseColor ); setBoxBorderColors( Q::Panel, pal.baseColor );
*/
} }
void QskMaterialSkin::initScrollViewHints() void QskMaterialSkin::initScrollViewHints()

View File

@ -554,38 +554,36 @@ void QskSquiekSkin::initTabViewHints()
void QskSquiekSkin::initInputPanelHints() void QskSquiekSkin::initInputPanelHints()
{ {
using namespace QskAspect; using namespace QskAspect;
using Q = QskInputPanel; using Q = QskKeyButton;
const ColorPalette& pal = m_data->palette; const ColorPalette& pal = m_data->palette;
/*
// key panel // 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::Panel, Raised );
setButton( Q::KeyPanel | Q::Pressed, Sunken ); setButton( Q::Panel | Q::Pressed, Sunken );
setAnimation( Q::KeyPanel | Color, qskDuration ); setAnimation( Q::Panel | Color, qskDuration );
#if 0 #if 0
// crashes because animations are started from updateNode // crashes because animations are started from updateNode
// TODO ... // TODO ...
setAnimation( Q::KeyPanel | Metric, qskDuration ); setAnimation( Q::Panel | Metric, qskDuration );
#endif #endif
// glyph // glyph
setSkinHint( Q::KeyGlyph | Alignment, Qt::AlignCenter ); // setSkinHint( Q::Text | Alignment, Qt::AlignCenter );
setFontRole( Q::KeyGlyph, QskSkin::TinyFont ); // setFontRole( Q::Text, QskSkin::TinyFont );
setColor( Q::KeyGlyph, pal.themeForeground ); setColor( Q::Text, pal.themeForeground );
setColor( Q::KeyGlyph | Q::Disabled, pal.darker200 ); setColor( Q::Text | Q::Disabled, pal.darker200 );
// panel // // panel
setMargins( Q::Panel | Padding, 5 ); // setMargins( Q::Panel | Padding, 5 );
setMargins( Q::Panel | Spacing, 5 ); // setMargins( Q::Panel | Spacing, 5 );
setPanel( Q::Panel, Raised ); // setPanel( Q::Panel, Raised );
*/
} }
void QskSquiekSkin::initScrollViewHints() void QskSquiekSkin::initScrollViewHints()

View File

@ -14,7 +14,7 @@
class QskInputCompositionModel; class QskInputCompositionModel;
class QskInputPanel; class QskInputPanel;
class QskKeyButton : public QskPushButton class QskKeyButton : public QskPushButton // ### rename to QskInputButton or so?
{ {
Q_OBJECT Q_OBJECT
@ -84,7 +84,7 @@ public:
using KeyDataSet = KeyDataRow[RowCount]; using KeyDataSet = KeyDataRow[RowCount];
QskInputPanel( QQuickItem* parent = nullptr ); QskInputPanel( QQuickItem* parent = nullptr );
virtual ~QskInputPanel(); virtual ~QskInputPanel() override;
void updateLocale( const QLocale& locale ); void updateLocale( const QLocale& locale );