Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust cut attribute confirm button style and layout (for circle 4) #115

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading