forked from qt-creator/qt-creator
VCS: Clear commit message hint when editor becomes disabled
The commit editor becomes disabled, when no more changed files were available. In this case, the commit message verification makes no sense and should be removed. Change-Id: Ic16cc4ade1ecd1b64faee52b21a10b9c882908d0 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
3edc5822da
commit
0e8756508c
@@ -435,6 +435,12 @@ void SubmitEditorWidget::updateSubmitAction()
|
||||
}
|
||||
}
|
||||
|
||||
void SubmitEditorWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::EnabledChange)
|
||||
verifyDescription();
|
||||
}
|
||||
|
||||
// Enable diff depending on selected files
|
||||
void SubmitEditorWidget::updateDiffAction()
|
||||
{
|
||||
@@ -506,6 +512,12 @@ void SubmitEditorWidget::hideDescription()
|
||||
|
||||
void SubmitEditorWidget::verifyDescription()
|
||||
{
|
||||
if (!isEnabled()) {
|
||||
d->m_ui.descriptionHint->setText(QString());
|
||||
d->m_ui.descriptionHint->setToolTip(QString());
|
||||
return;
|
||||
}
|
||||
|
||||
auto fontColor = [](Utils::Theme::Color color) {
|
||||
return QString("<font color=\"%1\">")
|
||||
.arg(Utils::creatorTheme()->color(color).name());
|
||||
|
||||
@@ -111,6 +111,7 @@ signals:
|
||||
void submitActionEnabledChanged(bool);
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *event) override;
|
||||
virtual QString cleanupDescription(const QString &) const;
|
||||
virtual QString commitName() const;
|
||||
void insertTopWidget(QWidget *w);
|
||||
|
||||
Reference in New Issue
Block a user