diff --git a/saoritootwidget.cpp b/saoritootwidget.cpp index 3224ae3..ea8ad4c 100644 --- a/saoritootwidget.cpp +++ b/saoritootwidget.cpp @@ -28,6 +28,7 @@ #include "ui_saoritootwidget.h" #include #include +#include #include SaoriTootWidget::SaoriTootWidget(QWidget *parent) : @@ -35,10 +36,11 @@ ui(new Ui::SaoriTootWidget) { ui->setupUi(this); + ui->actionToot->setEnabled(false); connect(ui->textEdit_toot,&QTextEdit::textChanged,this,[=](){ int c = 500 - ui->textEdit_toot->toPlainText().count(); - if ((c >= 500) || (c < 0)) ui->pushButton_commit->setEnabled(false); - else ui->pushButton_commit->setEnabled(true); + if ((c >= 500) || (c < 0)) ui->actionToot->setEnabled(false); + else ui->actionToot->setEnabled(true); if (c < 0) ui->label_count->setText("" + QString::number(c) + ""); else if (c < 100) ui->label_count->setText("" + QString::number(c) + ""); else ui->label_count->setText("" + QString::number(c) + ""); @@ -90,7 +92,7 @@ return result; } -void SaoriTootWidget::on_pushButton_commit_clicked() +void SaoriTootWidget::on_actionToot_triggered() { emit postNewStatus(createPostData()); } diff --git a/saoritootwidget.h b/saoritootwidget.h index d661a93..90b5e7b 100644 --- a/saoritootwidget.h +++ b/saoritootwidget.h @@ -53,7 +53,7 @@ void postNewStatus(const QString data); private slots: - void on_pushButton_commit_clicked(); + void on_actionToot_triggered(); private: Ui::SaoriTootWidget *ui; diff --git a/saoritootwidget.ui b/saoritootwidget.ui index 80b56e9..66d28b3 100644 --- a/saoritootwidget.ui +++ b/saoritootwidget.ui @@ -125,53 +125,42 @@ - - - Qt::NoFocus - - - clear - - - - - - + + false - - Qt::ActionsContextMenu + + false - - Toot! - + + + + + Toot! + + + Ctrl+Return + + + + + clear + + + Ctrl+Del + + - pushButton_clear - clicked() - textEdit_toot - clear() - - - 263 - 277 - - - 199 - 158 - - - - checkBox_cw toggled(bool) lineEdit_cw @@ -187,5 +176,37 @@ + + actionClear + triggered() + textEdit_toot + clear() + + + -1 + -1 + + + 199 + 170 + + + + + actionClear + triggered() + lineEdit_cw + clear() + + + -1 + -1 + + + 227 + 82 + + +