Skip to content

Commit

Permalink
fix: adjust cut attribute confirm button style and layout (for circle 4)
Browse files Browse the repository at this point in the history
   adjust cut attribute confirm button style and layout (for circle 4)

Log: adjust cut attribute confirm button style and layout (for circle 4)
Bug: https://pms.uniontech.com/bug-view-155955.html
  • Loading branch information
starhcq committed Nov 19, 2024
1 parent 95805e6 commit 61f9002
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void CutAttributionWidget::initUi()
QLabel *title = new QLabel(tr("Ratio"));
QLabel *scale_w = new QLabel();
scale_w->setText("W");
scale_w->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
w_spinbox = new CSpinBox();
w_spinbox->setEnabledEmbedStyle(true);
w_spinbox->setSpinRange(10, 10000);
Expand All @@ -38,6 +39,7 @@ void CutAttributionWidget::initUi()

QLabel *scale_h = new QLabel();
scale_h->setText("H");
scale_h->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
h_spinbox = new CSpinBox();
h_spinbox->setEnabledEmbedStyle(true);
h_spinbox->setSpinRange(10, 10000);
Expand All @@ -46,10 +48,9 @@ void CutAttributionWidget::initUi()

mainlayout->addWidget(title);
m_scaleStyle->addWidget(scale_w);
m_scaleStyle->addSpacing(BUTTON_SPACING);
m_scaleStyle->addWidget(w_spinbox);
m_scaleStyle->addSpacing(10);
m_scaleStyle->addWidget(scale_h);
m_scaleStyle->addSpacing(BUTTON_SPACING);
m_scaleStyle->addWidget(h_spinbox);

QGridLayout *m_gridLayout = new QGridLayout();
Expand All @@ -74,14 +75,15 @@ void CutAttributionWidget::initUi()
m_gridLayout->addWidget(button_type, i / MAXROWNUM, i % MAXROWNUM);
}
//确认/取消按钮
m_confirmbutton = new QToolButton(this);
m_cancelbutton = new QToolButton(this);
m_confirmbutton = new DSuggestButton(this);
m_cancelbutton = new DPushButton(this);
QHBoxLayout *m_buttonlayout = new QHBoxLayout(this);
m_buttonlayout->setSpacing(10);

m_cancelbutton->setText(tr("Cancel"));
m_confirmbutton->setText(tr("Confirm"));
m_confirmbutton->setFixedSize(QSize(110, 38));
m_cancelbutton->setFixedSize(QSize(110, 38));
m_confirmbutton->setFixedWidth(120);
m_cancelbutton->setFixedWidth(120);

m_buttonlayout->addWidget(m_cancelbutton);
m_buttonlayout->addWidget(m_confirmbutton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <QAbstractItemDelegate>
#include "iattributionregister.h"
#include <DToolButton>
#include <DSuggestButton>
#include <DPushButton>

#define CUTTYPE 6
#define MAXROWNUM 3
class QLabel;
Expand All @@ -28,8 +31,8 @@ class CutAttributionWidget: public AttributeWgt
QList<QToolButton * > m_buttonList;
CSpinBox *h_spinbox = nullptr;
CSpinBox *w_spinbox = nullptr;
QToolButton *m_confirmbutton = nullptr;
QToolButton *m_cancelbutton = nullptr;
DSuggestButton *m_confirmbutton = nullptr;
Dtk::Widget::DPushButton *m_cancelbutton = nullptr;
QButtonGroup *button_group = nullptr;
const qreal Radio[CUTTYPE] {-1, -2, 1.0, 2.0 / 3.0, 8.0 / 5.0, 16.0 / 9.0};

Expand Down

0 comments on commit 61f9002

Please sign in to comment.