1 // Copyright (C) 2012-2019 The VPaint Developers. 2 // See the COPYRIGHT file at the top-level directory of this distribution 3 // and at https://github.com/dalboris/vpaint/blob/master/COPYRIGHT 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 17 #ifndef EDITCANVASSIZEDIALOG_H 18 #define EDITCANVASSIZEDIALOG_H 19 20 #include <QDialog> 21 22 class QDoubleSpinBox; 23 class Scene; 24 25 class EditCanvasSizeDialog: public QDialog 26 { 27 Q_OBJECT 28 29 public: 30 EditCanvasSizeDialog(Scene * scene); 31 32 Scene * scene() const; 33 34 // Reimplements from QDialog to set oldValues 35 void setVisible(bool visible); 36 37 void backupCurentValues(); 38 39 public slots: 40 void updateDialogFromScene(); 41 void updateSceneFromDialog(); 42 43 void accept(); 44 void reject(); 45 46 private: 47 Scene * scene_; 48 49 QDoubleSpinBox * topSpinBox_; 50 QDoubleSpinBox * leftSpinBox_; 51 QDoubleSpinBox * widthSpinBox_; 52 QDoubleSpinBox * heightSpinBox_; 53 54 double oldTop_; 55 double oldLeft_; 56 double oldWidth_; 57 double oldHeight_; 58 59 bool ignoreSceneChanged_; 60 }; 61 62 #endif // EDITCANVASSIZEDIALOG_H 63