QskDialogButton subcontrols removed. In case we need to make them
different from normal push buttons we should introduce a "dialog" section, where we can avoid having to duplicate all hint settings
This commit is contained in:
parent
4ca5e798c8
commit
cb7acb6b92
@ -9,7 +9,6 @@
|
||||
|
||||
#include <QskBox.h>
|
||||
#include <QskCheckBox.h>
|
||||
#include <QskDialogButton.h>
|
||||
#include <QskDialogButtonBox.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskFunctions.h>
|
||||
@ -126,7 +125,6 @@ namespace
|
||||
void setupBox();
|
||||
void setupCheckBox();
|
||||
void setupDialogButtonBox();
|
||||
void setupDialogButton();
|
||||
void setupFocusIndicator();
|
||||
void setupInputPanel();
|
||||
void setupVirtualKeyboard();
|
||||
@ -185,7 +183,6 @@ void Editor::setup()
|
||||
setupBox();
|
||||
setupCheckBox();
|
||||
setupDialogButtonBox();
|
||||
setupDialogButton();
|
||||
setupFocusIndicator();
|
||||
setupInputPanel();
|
||||
setupVirtualKeyboard();
|
||||
@ -555,23 +552,6 @@ void Editor::setupPushButton()
|
||||
setAnimation( Q::Text | A::Color, qskDuration );
|
||||
}
|
||||
|
||||
void Editor::setupDialogButton()
|
||||
{
|
||||
using Q = QskDialogButton;
|
||||
|
||||
setStrutSize( Q::Panel, 48_dp, -1 );
|
||||
setSpacing( Q::Panel, 8_dp );
|
||||
setPadding( Q::Panel, { 12_dp, 13_dp, 12_dp, 13_dp } );
|
||||
setBoxShape( Q::Panel, 100, Qt::RelativeSize );
|
||||
setGradient( Q::Panel, m_pal.secondaryContainer );
|
||||
|
||||
setGradient( Q::Panel | Q::Hovered, stateLayerColor( m_pal.primary, m_pal.hoverOpacity ) );
|
||||
setGradient( Q::Panel | Q::Pressed, stateLayerColor( m_pal.primary, m_pal.pressedOpacity ) );
|
||||
|
||||
setColor( Q::Text, m_pal.primary );
|
||||
setFontRole( Q::Text, QskMaterial3Skin::M3LabelLarge );
|
||||
}
|
||||
|
||||
void Editor::setupDialogButtonBox()
|
||||
{
|
||||
using Q = QskDialogButtonBox;
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include <QskBox.h>
|
||||
#include <QskCheckBox.h>
|
||||
#include <QskDialogButton.h>
|
||||
#include <QskDialogButtonBox.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskInputPanelBox.h>
|
||||
@ -135,7 +134,6 @@ namespace
|
||||
|
||||
void setupBox();
|
||||
void setupCheckBox();
|
||||
void setupDialogButton();
|
||||
void setupDialogButtonBox();
|
||||
void setupFocusIndicator();
|
||||
void setupInputPanel();
|
||||
@ -257,7 +255,6 @@ void Editor::setup()
|
||||
setupBox();
|
||||
setupCheckBox();
|
||||
setupDialogButtonBox();
|
||||
setupDialogButton();
|
||||
setupFocusIndicator();
|
||||
setupInputPanel();
|
||||
setupInputPredictionBar();
|
||||
@ -618,31 +615,6 @@ void Editor::setupPushButton()
|
||||
setAlignment( Q::Graphic, Qt::AlignCenter );
|
||||
}
|
||||
|
||||
void Editor::setupDialogButton()
|
||||
{
|
||||
using A = QskAspect;
|
||||
using Q = QskDialogButton;
|
||||
|
||||
// panel
|
||||
setStrutSize( Q::Panel, qskDpiScaled( 75.0 ), qskDpiScaled( 23.0 ) );
|
||||
|
||||
setPadding( Q::Panel, 10 );
|
||||
setMetric( Q::Panel | A::Spacing, 4 );
|
||||
|
||||
setButton( Q::Panel, Raised );
|
||||
setButton( Q::Panel | Q::Pressed, Sunken );
|
||||
|
||||
setAnimation( Q::Panel | A::Color, qskDuration );
|
||||
setAnimation( Q::Panel | A::Metric, qskDuration );
|
||||
|
||||
// text
|
||||
setFlagHint( Q::Text | Q::Disabled | A::Style, Qsk::Sunken );
|
||||
setAlignment( Q::Text, Qt::AlignCenter );
|
||||
|
||||
setColor( Q::Text, m_pal.themeForeground );
|
||||
setColor( Q::Text | Q::Disabled, m_pal.darker200 );
|
||||
}
|
||||
|
||||
void Editor::setupDialogButtonBox()
|
||||
{
|
||||
using Q = QskDialogButtonBox;
|
||||
|
@ -7,10 +7,6 @@
|
||||
#include "QskDialogButtonBox.h"
|
||||
#include "QskSkin.h"
|
||||
|
||||
QSK_SUBCONTROL( QskDialogButton, Panel )
|
||||
QSK_SUBCONTROL( QskDialogButton, Text )
|
||||
QSK_SUBCONTROL( QskDialogButton, Graphic )
|
||||
|
||||
QskDialogButton::QskDialogButton(
|
||||
QskDialog::Action action, QQuickItem* parent )
|
||||
: QskPushButton( parent )
|
||||
@ -28,21 +24,6 @@ QskDialogButton::~QskDialogButton()
|
||||
{
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskDialogButton::substitutedSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
if ( subControl == QskPushButton::Panel )
|
||||
return QskDialogButton::Panel;
|
||||
|
||||
if ( subControl == QskPushButton::Text )
|
||||
return QskDialogButton::Text;
|
||||
|
||||
if ( subControl == QskPushButton::Graphic )
|
||||
return QskDialogButton::Graphic;
|
||||
|
||||
return Inherited::substitutedSubcontrol( subControl );
|
||||
}
|
||||
|
||||
void QskDialogButton::setAction( QskDialog::Action action )
|
||||
{
|
||||
if ( action != m_action )
|
||||
|
@ -19,7 +19,6 @@ class QSK_EXPORT QskDialogButton : public QskPushButton
|
||||
using Inherited = QskPushButton;
|
||||
|
||||
public:
|
||||
QSK_SUBCONTROLS( Panel, Text, Graphic )
|
||||
|
||||
QskDialogButton( QskDialog::Action, QQuickItem* parent = nullptr );
|
||||
QskDialogButton( QQuickItem* parent = nullptr );
|
||||
@ -35,9 +34,6 @@ class QSK_EXPORT QskDialogButton : public QskPushButton
|
||||
protected:
|
||||
void changeEvent( QEvent* ) override;
|
||||
|
||||
QskAspect::Subcontrol substitutedSubcontrol(
|
||||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
private:
|
||||
void resetButton();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user