屏蔽自定义色调曲线

This commit is contained in:
yangjiaxuan 2023-07-11 18:56:27 +08:00
parent 59c6cef25f
commit 4c53bac7e9
1 changed files with 31 additions and 16 deletions

View File

@ -563,19 +563,20 @@ void hg_settingdialog::createUI()
}
else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0)
{
QWidget* widget_cbtn_pbtn = new QWidget(scrollArea);
widget_cbtn_pbtn->setMaximumWidth(200);
btn_gamma_ = new QPushButton(widget_cbtn_pbtn);
btn_gamma_->setText(tr("custom tone curve"));
btn_gamma_->setFixedWidth(150);
continue;
// QWidget* widget_cbtn_pbtn = new QWidget(scrollArea);
// widget_cbtn_pbtn->setMaximumWidth(200);
// btn_gamma_ = new QPushButton(widget_cbtn_pbtn);
// btn_gamma_->setText(tr("custom tone curve"));
// btn_gamma_->setFixedWidth(150);
QHBoxLayout *hLayout = new QHBoxLayout;
hLayout->addWidget(checkBoxCreation);
hLayout->addWidget(btn_gamma_);
widget_cbtn_pbtn->setLayout(hLayout);
// QHBoxLayout *hLayout = new QHBoxLayout;
// hLayout->addWidget(checkBoxCreation);
// hLayout->addWidget(btn_gamma_);
// widget_cbtn_pbtn->setLayout(hLayout);
reinterpret_cast<QFormLayout*>(widget->layout())->addRow(opt->title + QString(" : "), widget_cbtn_pbtn);
connect(btn_gamma_, SIGNAL(clicked(bool)), this, SLOT(slot_gammaButtonClicked()));
// reinterpret_cast<QFormLayout*>(widget->layout())->addRow(opt->title + QString(" : "), widget_cbtn_pbtn);
// connect(btn_gamma_, SIGNAL(clicked(bool)), this, SLOT(slot_gammaButtonClicked()));
}
else
reinterpret_cast<QFormLayout*>(widget->layout())->addRow(opt->title + QString(" : "), checkBoxCreation);
@ -591,7 +592,7 @@ void hg_settingdialog::createUI()
}
if (strcmp(opt->name, SANE_STD_OPT_NAME_CUSTOM_AREA) == 0)
btn_cut_area_->setEnabled(enable);
else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0)
else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0 && btn_gamma_ != nullptr)
btn_gamma_->setEnabled(enable);
connect(checkBoxCreation, SIGNAL(stateChanged(int)), this, SLOT(slot_checkedClicked()));
m_list_widgets.append(checkBoxCreation);
@ -1131,9 +1132,23 @@ void hg_settingdialog::updateUIStatus()
hide = true;
refresh_control_value(id);
if(w_label)
hide ? w_label->hide() : w_label->show();
widget->setVisible(!hide);
if (strcmp(opt->name, SANE_STD_OPT_NAME_BRIGHTNESS) == 0 ||
strcmp(opt->name, SANE_STD_OPT_NAME_CONTRAST) == 0 ||
strcmp(opt->name, SANE_STD_OPT_NAME_GAMMA) == 0 ||
strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0)
{
if (w_label)
w_label->show();
widget->setVisible(true);
}
else
{
if(w_label)
hide ? w_label->hide() : w_label->show();
widget->setVisible(!hide);
}
if(strcmp(opt->name, SANE_STD_OPT_NAME_CUSTOM_AREA) == 0)
{
if(hide)
@ -1191,7 +1206,7 @@ void hg_settingdialog::slot_checkedClicked()
if(strcmp(opt->name, SANE_STD_OPT_NAME_CUSTOM_AREA) == 0)
btn_cut_area_->setEnabled(checkBoxcurrentState);
else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0)
else if (strcmp(opt->name, SANE_STD_OPT_NAME_IS_CUSTOM_GAMMA) == 0 && btn_gamma_ != nullptr)
btn_gamma_->setEnabled(checkBoxcurrentState);
//cur_scheme_->config_changed(id, (char*)&checkBoxcurrentState, sizeof(checkBoxcurrentState));