Commit f6a1f2bf authored by Sylvain Thery's avatar Sylvain Thery

some improvement in SCHNApps

parent f6dc3b6f
......@@ -44,8 +44,6 @@ public:
bool isChecked(const QString& str);
virtual QSize sizeHint() const;
};
......
......@@ -129,6 +129,8 @@ public:
void addMenuAction(Plugin* plugin, const QString& menuPath, QAction* action);
void removeMenuAction(Plugin* plugin, QAction* action);
void statusBarMessage(const QString& msg, int msec);
public slots:
void aboutSCHNApps();
void aboutCGoGN();
......
......@@ -12,7 +12,7 @@ ListPopUp::ListPopUp(const QString& name, QWidget* parent) :
QDialog(parent)
{
setWindowTitle(name);
setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint);
setWindowFlags(windowFlags()/* | Qt::FramelessWindowHint*/ | Qt::SplashScreen | Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint);
m_layout = new QVBoxLayout(this);
setLayout(m_layout);
m_layout->setContentsMargins(1, 1, 1, 1);
......@@ -25,11 +25,6 @@ ListPopUp::~ListPopUp()
{
}
QSize ListPopUp::sizeHint() const
{
return QSize(170,100);
}
QListWidget* ListPopUp::list()
{
return m_list_items;
......@@ -40,7 +35,7 @@ void ListPopUp::show()
int rows = m_list_items->model()->rowCount();
int rowSize = m_list_items->sizeHintForRow(0);
int height = rows * rowSize + 6;
if (height < 96)
if (height < 96) // 96??
height = 96;
m_list_items->setFixedHeight(height);
QDialog::show();
......
......@@ -923,6 +923,10 @@ void SCHNApps::closeEvent(QCloseEvent *event)
QMainWindow::closeEvent(event);
}
void SCHNApps::statusBarMessage(const QString& msg, int msec)
{
statusbar->showMessage(msg, msec);
}
} // namespace SCHNApps
......
......@@ -502,10 +502,30 @@ void View::keyPressEvent(QKeyEvent* event)
if (event->key() == Qt::Key_S)
{
b_saveSnapshots = !b_saveSnapshots;
if (b_saveSnapshots)
connect(this, SIGNAL(drawFinished(bool)), this, SLOT(saveSnapshot(bool)));
{
QMessageBox msgBox;
msgBox.setText("Snapshot every frame?");
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
if (msgBox.exec() == QMessageBox::Ok)
{
m_schnapps->statusBarMessage("frame snapshot !!", 2000);
connect(this, SIGNAL(drawFinished(bool)), this, SLOT(saveSnapshot(bool)));
}
else
{
m_schnapps->statusBarMessage("cancel frame snapshot", 2000);
b_saveSnapshots = false;
}
}
else
{
disconnect(this, SIGNAL(drawFinished(bool)), this, SLOT(saveSnapshot(bool)));
m_schnapps->statusBarMessage("Stop frame snapshot", 2000);
}
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment