mirror of
https://github.com/overte-org/overte.git
synced 2025-04-10 16:12:28 +02:00
Removed the animation, placed UI elements according to mockup
This commit is contained in:
parent
2ef8277d0f
commit
f3121e1bf6
5 changed files with 48 additions and 56 deletions
|
@ -4,22 +4,22 @@
|
|||
<context>
|
||||
<name>Application</name>
|
||||
<message>
|
||||
<location filename="src/Application.cpp" line="1394"/>
|
||||
<location filename="src/Application.cpp" line="1397"/>
|
||||
<source>Export Voxels</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Application.cpp" line="1395"/>
|
||||
<location filename="src/Application.cpp" line="1398"/>
|
||||
<source>Sparse Voxel Octree Files (*.svo)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Application.cpp" line="3741"/>
|
||||
<location filename="src/Application.cpp" line="3730"/>
|
||||
<source>Open Script</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="src/Application.cpp" line="3742"/>
|
||||
<location filename="src/Application.cpp" line="3731"/>
|
||||
<source>JavaScript Files (*.js)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -162,49 +162,51 @@
|
|||
<name>RunningScriptsWidget</name>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="14"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="120"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="121"/>
|
||||
<source>Form</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="34"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="121"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="122"/>
|
||||
<source><html><head/><body><p><span style=" font-size:18pt;">Running Scripts</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="51"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="122"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="123"/>
|
||||
<source><html><head/><body><p><span style=" font-weight:600;">Currently running</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="76"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="123"/>
|
||||
<source>Reload All</source>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="124"/>
|
||||
<source>Reload all</source>
|
||||
<oldsource>Reload All</oldsource>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="102"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="124"/>
|
||||
<source>Stop All</source>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="125"/>
|
||||
<source>Stop all</source>
|
||||
<oldsource>Stop All</oldsource>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="123"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="125"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="126"/>
|
||||
<source><html><head/><body><p><span style=" font-weight:600;">Recently loaded</span></p></body></html></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="140"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="126"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="127"/>
|
||||
<source>(click a script or use the 1-9 keys to load and run it)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="ui/runningScriptsWidget.ui" line="188"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="128"/>
|
||||
<location filename="../build/interface/ui_runningScriptsWidget.h" line="129"/>
|
||||
<source>There are no scripts currently running.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -171,7 +171,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
|||
_recentMaxPackets(0),
|
||||
_resetRecentMaxPacketsSoon(true),
|
||||
_previousScriptLocation(),
|
||||
_logger(new FileLogger(this))
|
||||
_logger(new FileLogger(this)),
|
||||
_runningScriptsWidget(new RunningScriptsWidget)
|
||||
{
|
||||
// read the ApplicationInfo.ini file for Name/Version/Domain information
|
||||
QSettings applicationInfo(Application::resourcesPath() + "info/ApplicationInfo.ini", QSettings::IniFormat);
|
||||
|
@ -333,7 +334,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
|||
LocalVoxelsList::getInstance()->addPersistantTree(DOMAIN_TREE_NAME, _voxels.getTree());
|
||||
LocalVoxelsList::getInstance()->addPersistantTree(CLIPBOARD_TREE_NAME, &_clipboard);
|
||||
|
||||
_window->addDockWidget(Qt::NoDockWidgetArea, _runningScriptsWidget = new RunningScriptsWidget());
|
||||
_window->addDockWidget(Qt::NoDockWidgetArea, _runningScriptsWidget);
|
||||
_runningScriptsWidget->hide();
|
||||
_runningScriptsWidget->setRunningScripts(getRunningScripts());
|
||||
connect(_runningScriptsWidget, &RunningScriptsWidget::stopScriptName, this, &Application::stopScript);
|
||||
|
||||
|
@ -620,10 +622,11 @@ void Application::resizeGL(int width, int height) {
|
|||
updateProjectionMatrix();
|
||||
glLoadIdentity();
|
||||
|
||||
if (_runningScriptsWidgetVisible)
|
||||
if (_runningScriptsWidget->isVisible()) {
|
||||
_runningScriptsWidget->setGeometry(_window->geometry().topLeft().x(),
|
||||
_window->geometry().topLeft().y(),
|
||||
_runningScriptsWidget->width(), _window->height());
|
||||
}
|
||||
}
|
||||
|
||||
void Application::updateProjectionMatrix() {
|
||||
|
@ -3630,30 +3633,16 @@ void Application::reloadAllScripts() {
|
|||
void Application::toggleRunningScriptsWidget()
|
||||
{
|
||||
if (!_runningScriptsWidget->toggleViewAction()->isChecked()) {
|
||||
_runningScriptsWidget->move(_window->geometry().topLeft().x(), _window->geometry().topLeft().y());
|
||||
_runningScriptsWidget->resize(0, _window->height());
|
||||
_runningScriptsWidget->setGeometry(_window->geometry().topLeft().x(),
|
||||
_window->geometry().topLeft().y(),
|
||||
310, _window->height());
|
||||
_runningScriptsWidget->toggleViewAction()->trigger();
|
||||
_runningScriptsWidget->grabKeyboard();
|
||||
_runningScriptsWidgetVisible = true;
|
||||
|
||||
QPropertyAnimation* slideAnimation = new QPropertyAnimation(_runningScriptsWidget, "geometry", _runningScriptsWidget);
|
||||
slideAnimation->setStartValue(_runningScriptsWidget->geometry());
|
||||
slideAnimation->setEndValue(QRect(_window->geometry().topLeft().x(), _window->geometry().topLeft().y(),
|
||||
310, _runningScriptsWidget->height()));
|
||||
slideAnimation->setDuration(250);
|
||||
slideAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
_runningScriptsWidget->show();
|
||||
} else {
|
||||
_runningScriptsWidget->toggleViewAction()->trigger();
|
||||
_runningScriptsWidget->releaseKeyboard();
|
||||
_runningScriptsWidgetVisible = false;
|
||||
|
||||
QPropertyAnimation* slideAnimation = new QPropertyAnimation(_runningScriptsWidget, "geometry", _runningScriptsWidget);
|
||||
slideAnimation->setStartValue(_runningScriptsWidget->geometry());
|
||||
slideAnimation->setEndValue(QRect(_window->geometry().topLeft().x(), _window->geometry().topLeft().y(),
|
||||
0, _runningScriptsWidget->height()));
|
||||
slideAnimation->setDuration(250);
|
||||
slideAnimation->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
|
||||
QTimer::singleShot(260, _runningScriptsWidget->toggleViewAction(), SLOT(trigger()));
|
||||
_runningScriptsWidget->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -502,7 +502,6 @@ private:
|
|||
|
||||
RunningScriptsWidget* _runningScriptsWidget;
|
||||
QHash<QString, ScriptEngine*> _scriptEnginesHash;
|
||||
bool _runningScriptsWidgetVisible;
|
||||
};
|
||||
|
||||
#endif /* defined(__interface__Application__) */
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <QKeyEvent>
|
||||
#include <QFileInfo>
|
||||
#include <QScrollArea>
|
||||
#include <QPainter>
|
||||
#include <QTableWidgetItem>
|
||||
|
||||
|
@ -26,14 +27,14 @@ RunningScriptsWidget::RunningScriptsWidget(QDockWidget *parent) :
|
|||
|
||||
_runningScriptsTable = new ScriptsTableWidget(ui->runningScriptsTableWidget);
|
||||
_runningScriptsTable->setColumnCount(2);
|
||||
_runningScriptsTable->setColumnWidth(0, 245);
|
||||
_runningScriptsTable->setColumnWidth(0, 252);
|
||||
_runningScriptsTable->setColumnWidth(1, 22);
|
||||
connect(_runningScriptsTable, &QTableWidget::cellClicked, this, &RunningScriptsWidget::stopScript);
|
||||
|
||||
_recentlyLoadedScriptsTable = new ScriptsTableWidget(ui->recentlyLoadedScriptsTableWidget);
|
||||
_recentlyLoadedScriptsTable->setColumnCount(2);
|
||||
_recentlyLoadedScriptsTable->setColumnWidth(0, 25);
|
||||
_recentlyLoadedScriptsTable->setColumnWidth(1, 235);
|
||||
_recentlyLoadedScriptsTable->setColumnWidth(1, 242);
|
||||
connect(_recentlyLoadedScriptsTable, &QTableWidget::cellClicked,
|
||||
this, &RunningScriptsWidget::loadScript);
|
||||
|
||||
|
@ -147,13 +148,13 @@ void RunningScriptsWidget::paintEvent(QPaintEvent *)
|
|||
if (ui->currentlyRunningLabel->isVisible()) {
|
||||
// line below the 'Currently Running' label
|
||||
painter.drawLine(20, ui->currentlyRunningLabel->y() + ui->currentlyRunningLabel->height(),
|
||||
width() - 20, ui->currentlyRunningLabel->y() + ui->currentlyRunningLabel->height());
|
||||
width() - 21, ui->currentlyRunningLabel->y() + ui->currentlyRunningLabel->height());
|
||||
}
|
||||
|
||||
if (ui->recentlyLoadedLabel->isVisible()) {
|
||||
// line below the 'Recently loaded' label
|
||||
painter.drawLine(20, ui->recentlyLoadedLabel->y() + ui->recentlyLoadedLabel->height(),
|
||||
width() - 20, ui->recentlyLoadedLabel->y() + ui->recentlyLoadedLabel->height());
|
||||
width() - 21, ui->recentlyLoadedLabel->y() + ui->recentlyLoadedLabel->height());
|
||||
}
|
||||
|
||||
painter.end();
|
||||
|
|
|
@ -39,7 +39,7 @@ font-size: 20pt;</string>
|
|||
<rect>
|
||||
<x>20</x>
|
||||
<y>40</y>
|
||||
<width>301</width>
|
||||
<width>270</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -54,10 +54,10 @@ font-size: 14pt;</string>
|
|||
<widget class="QPushButton" name="reloadAllButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>40</x>
|
||||
<x>20</x>
|
||||
<y>230</y>
|
||||
<width>111</width>
|
||||
<height>31</height>
|
||||
<height>35</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
|
@ -69,11 +69,11 @@ font-size: 14pt;</string>
|
|||
<property name="styleSheet">
|
||||
<string notr="true">background: #0e7077;
|
||||
color: #fff;
|
||||
border-radius: 6px;
|
||||
border-radius: 4px;
|
||||
font: 14pt 75pt;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reload All</string>
|
||||
<string>Reload all</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/resources.qrc">
|
||||
|
@ -83,10 +83,10 @@ font: 14pt 75pt;</string>
|
|||
<widget class="QPushButton" name="stopAllButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>160</x>
|
||||
<x>144</x>
|
||||
<y>230</y>
|
||||
<width>101</width>
|
||||
<height>31</height>
|
||||
<height>35</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="cursor">
|
||||
|
@ -95,11 +95,11 @@ font: 14pt 75pt;</string>
|
|||
<property name="styleSheet">
|
||||
<string notr="true">background: #0e7077;
|
||||
color: #fff;
|
||||
border-radius: 6px;
|
||||
border-radius: 4px;
|
||||
font: 14pt 75pt;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop All</string>
|
||||
<string>Stop all</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources/resources.qrc">
|
||||
|
@ -194,9 +194,9 @@ font-size: 14pt;</string>
|
|||
<widget class="QWidget" name="recentlyLoadedScriptsTableWidget" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<x>14</x>
|
||||
<y>300</y>
|
||||
<width>270</width>
|
||||
<width>276</width>
|
||||
<height>280</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -204,14 +204,15 @@ font-size: 14pt;</string>
|
|||
<string notr="true">background: transparent;
|
||||
font-size: 14pt;</string>
|
||||
</property>
|
||||
<zorder>reloadAllButton</zorder>
|
||||
</widget>
|
||||
<widget class="QWidget" name="runningScriptsTableWidget" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<x>14</x>
|
||||
<y>60</y>
|
||||
<width>270</width>
|
||||
<height>140</height>
|
||||
<width>276</width>
|
||||
<height>161</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
|
|
Loading…
Reference in a new issue