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