diff options
| author | 2015-05-12 16:19:47 -0400 | |
|---|---|---|
| committer | 2015-05-12 16:19:47 -0400 | |
| commit | 6ce5ee411d1e6093b68b1b4eca5dc6c12b927a96 (patch) | |
| tree | 1a98416041b39765c1c42ffbeab6da9fd40e181b /SQLiteStudio3/guiSQLiteStudio/dialogs/cssdebugdialog.cpp | |
| parent | 1fc9d1a4a1af320e39810cee21bed1201e2bddfd (diff) | |
| parent | 9618f0ebbf4b88045247c01ce8c8f58203508ebf (diff) | |
Merge tag 'upstream/3.0.6'
Upstream version 3.0.6
# gpg: Signature made Tue 12 May 2015 04:19:45 PM EDT using RSA key ID EBE9BD91
# gpg: Good signature from "Unit 193 <unit193@gmail.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.org>"
# gpg: aka "Unit 193 <unit193@ubuntu.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.com>"
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/dialogs/cssdebugdialog.cpp')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/dialogs/cssdebugdialog.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/dialogs/cssdebugdialog.cpp b/SQLiteStudio3/guiSQLiteStudio/dialogs/cssdebugdialog.cpp new file mode 100644 index 0000000..99439e8 --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/dialogs/cssdebugdialog.cpp @@ -0,0 +1,50 @@ +#include "cssdebugdialog.h" +#include "ui_cssdebugdialog.h" +#include "mainwindow.h" +#include "themetuner.h" +#include <QApplication> +#include <QPushButton> + +CssDebugDialog::CssDebugDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::CssDebugDialog) +{ + ui->setupUi(this); + connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*))); + + appliedCss = MAINWINDOW->styleSheet(); + ui->cssEdit->setPlainText(appliedCss); + updateState(); + + connect(ui->cssEdit, SIGNAL(textChanged()), this, SLOT(updateState())); +} + +CssDebugDialog::~CssDebugDialog() +{ + delete ui; +} + +void CssDebugDialog::buttonClicked(QAbstractButton* button) +{ + if (ui->buttonBox->standardButton(button) == QDialogButtonBox::RestoreDefaults) + { + ui->cssEdit->setPlainText(THEME_TUNER->getDefaultCss()); + } + else if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) + { + appliedCss = ui->cssEdit->toPlainText(); + MAINWINDOW->setStyleSheet(appliedCss); + } + + updateState(); +} + +void CssDebugDialog::updateState() +{ + ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(ui->cssEdit->toPlainText() != appliedCss); +} + +void CssDebugDialog::closeEvent(QCloseEvent*) +{ + deleteLater(); +} |
