mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 00:57:30 +02:00
commit
8223481ecb
6 changed files with 268 additions and 406 deletions
|
@ -3856,14 +3856,17 @@ void Application::manageRunningScriptsWidgetVisibility(bool shown) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::toggleRunningScriptsWidget() {
|
void Application::toggleRunningScriptsWidget() {
|
||||||
if (_runningScriptsWidgetWasVisible) {
|
if (_runningScriptsWidget->isVisible()) {
|
||||||
_runningScriptsWidget->hide();
|
if (_runningScriptsWidget->hasFocus()) {
|
||||||
_runningScriptsWidgetWasVisible = false;
|
_runningScriptsWidget->hide();
|
||||||
|
} else {
|
||||||
|
_runningScriptsWidget->raise();
|
||||||
|
setActiveWindow(_runningScriptsWidget);
|
||||||
|
_runningScriptsWidget->setFocus();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_runningScriptsWidget->setBoundary(QRect(_window->geometry().topLeft(),
|
|
||||||
_window->size()));
|
|
||||||
_runningScriptsWidget->show();
|
_runningScriptsWidget->show();
|
||||||
_runningScriptsWidgetWasVisible = true;
|
_runningScriptsWidget->setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,11 @@
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "Menu.h"
|
#include "Menu.h"
|
||||||
#include "ScriptsModel.h"
|
#include "ScriptsModel.h"
|
||||||
|
#include "UIUtil.h"
|
||||||
|
|
||||||
RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
|
RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
|
||||||
FramelessDialog(parent, 0, POSITION_LEFT),
|
QWidget(parent, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint |
|
||||||
|
Qt::WindowCloseButtonHint),
|
||||||
ui(new Ui::RunningScriptsWidget),
|
ui(new Ui::RunningScriptsWidget),
|
||||||
_signalMapper(this),
|
_signalMapper(this),
|
||||||
_proxyModel(this),
|
_proxyModel(this),
|
||||||
|
@ -33,15 +35,6 @@ RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||||
|
|
||||||
setAllowResize(false);
|
|
||||||
|
|
||||||
ui->hideWidgetButton->setIcon(QIcon(Application::resourcesPath() + "images/close.svg"));
|
|
||||||
ui->reloadAllButton->setIcon(QIcon(Application::resourcesPath() + "images/reload.svg"));
|
|
||||||
ui->stopAllButton->setIcon(QIcon(Application::resourcesPath() + "images/stop.svg"));
|
|
||||||
ui->loadScriptButton->setIcon(QIcon(Application::resourcesPath() + "images/plus-white.svg"));
|
|
||||||
|
|
||||||
ui->recentlyLoadedScriptsArea->hide();
|
|
||||||
|
|
||||||
ui->filterLineEdit->installEventFilter(this);
|
ui->filterLineEdit->installEventFilter(this);
|
||||||
|
|
||||||
connect(&_proxyModel, &QSortFilterProxyModel::modelReset,
|
connect(&_proxyModel, &QSortFilterProxyModel::modelReset,
|
||||||
|
@ -55,12 +48,6 @@ RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
|
||||||
connect(ui->filterLineEdit, &QLineEdit::textChanged, this, &RunningScriptsWidget::updateFileFilter);
|
connect(ui->filterLineEdit, &QLineEdit::textChanged, this, &RunningScriptsWidget::updateFileFilter);
|
||||||
connect(ui->scriptListView, &QListView::doubleClicked, this, &RunningScriptsWidget::loadScriptFromList);
|
connect(ui->scriptListView, &QListView::doubleClicked, this, &RunningScriptsWidget::loadScriptFromList);
|
||||||
|
|
||||||
_recentlyLoadedScriptsTable = new ScriptsTableWidget(ui->recentlyLoadedScriptsTableWidget);
|
|
||||||
_recentlyLoadedScriptsTable->setColumnCount(1);
|
|
||||||
_recentlyLoadedScriptsTable->setColumnWidth(0, 265);
|
|
||||||
|
|
||||||
connect(ui->hideWidgetButton, &QPushButton::clicked,
|
|
||||||
Application::getInstance(), &Application::toggleRunningScriptsWidget);
|
|
||||||
connect(ui->reloadAllButton, &QPushButton::clicked,
|
connect(ui->reloadAllButton, &QPushButton::clicked,
|
||||||
Application::getInstance(), &Application::reloadAllScripts);
|
Application::getInstance(), &Application::reloadAllScripts);
|
||||||
connect(ui->stopAllButton, &QPushButton::clicked,
|
connect(ui->stopAllButton, &QPushButton::clicked,
|
||||||
|
@ -163,7 +150,15 @@ void RunningScriptsWidget::showEvent(QShowEvent* event) {
|
||||||
ui->filterLineEdit->setFocus();
|
ui->filterLineEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
FramelessDialog::showEvent(event);
|
const QRect parentGeometry = parentWidget()->geometry();
|
||||||
|
int titleBarHeight = UIUtil::getWindowTitleBarHeight(this);
|
||||||
|
int menuBarHeight = Menu::getInstance()->geometry().height();
|
||||||
|
int topMargin = titleBarHeight + menuBarHeight;
|
||||||
|
|
||||||
|
setGeometry(parentGeometry.topLeft().x(), parentGeometry.topLeft().y() + topMargin,
|
||||||
|
size().width(), parentWidget()->height() - topMargin);
|
||||||
|
|
||||||
|
QWidget::showEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunningScriptsWidget::selectFirstInList() {
|
void RunningScriptsWidget::selectFirstInList() {
|
||||||
|
@ -189,19 +184,18 @@ bool RunningScriptsWidget::eventFilter(QObject* sender, QEvent* event) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FramelessDialog::eventFilter(sender, event);
|
return QWidget::eventFilter(sender, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunningScriptsWidget::keyPressEvent(QKeyEvent *keyEvent) {
|
void RunningScriptsWidget::keyPressEvent(QKeyEvent *keyEvent) {
|
||||||
if (keyEvent->key() == Qt::Key_Escape) {
|
if (keyEvent->key() == Qt::Key_Escape) {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
FramelessDialog::keyPressEvent(keyEvent);
|
QWidget::keyPressEvent(keyEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunningScriptsWidget::scriptStopped(const QString& scriptName) {
|
void RunningScriptsWidget::scriptStopped(const QString& scriptName) {
|
||||||
// _recentlyLoadedScripts.prepend(scriptName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunningScriptsWidget::allScriptsStopped() {
|
void RunningScriptsWidget::allScriptsStopped() {
|
||||||
|
|
|
@ -25,8 +25,7 @@ namespace Ui {
|
||||||
class RunningScriptsWidget;
|
class RunningScriptsWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RunningScriptsWidget : public FramelessDialog
|
class RunningScriptsWidget : public QWidget {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit RunningScriptsWidget(QWidget* parent = NULL);
|
explicit RunningScriptsWidget(QWidget* parent = NULL);
|
||||||
|
|
|
@ -7,29 +7,24 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>324</width>
|
<width>324</width>
|
||||||
<height>971</height>
|
<height>643</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Running Scripts</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">* {
|
<string notr="true">* { font-family: Helvetica, Arial, sans-serif; }</string>
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
|
||||||
}
|
|
||||||
QWidget {
|
|
||||||
background: #f7f7f7;
|
|
||||||
}</string>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>20</number>
|
<number>14</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>20</number>
|
<number>20</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>20</number>
|
<number>14</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>20</number>
|
<number>20</number>
|
||||||
|
@ -38,23 +33,22 @@ QWidget {
|
||||||
<widget class="QWidget" name="header" native="true">
|
<widget class="QWidget" name="header" native="true">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="widgetTitle">
|
<widget class="QLabel" name="widgetTitle">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">color: #0e7077;
|
<string notr="true">color: #0e7077;
|
||||||
font-size: 20px;
|
font-size: 20px;</string>
|
||||||
background: transparent;</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-size:18px;">Running Scripts</span></p></body></html></string>
|
<string>Running Scripts</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
@ -77,28 +71,6 @@ background: transparent;</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="hideWidgetButton">
|
|
||||||
<property name="cursor">
|
|
||||||
<cursorShape>PointingHandCursor</cursorShape>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">border: 0</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="flat">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -133,24 +105,45 @@ background: transparent;</string>
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="currentlyRunningLabel">
|
<widget class="QWidget" name="widget_3" native="true">
|
||||||
<property name="font">
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
<font>
|
<property name="spacing">
|
||||||
<family>Helvetica,Arial,sans-serif</family>
|
<number>0</number>
|
||||||
<pointsize>-1</pointsize>
|
</property>
|
||||||
<weight>75</weight>
|
<property name="leftMargin">
|
||||||
<italic>false</italic>
|
<number>6</number>
|
||||||
<bold>true</bold>
|
</property>
|
||||||
</font>
|
<property name="topMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="styleSheet">
|
</property>
|
||||||
<string notr="true">color: #0e7077;
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="currentlyRunningLabel">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Helvetica,Arial,sans-serif</family>
|
||||||
|
<pointsize>-1</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<italic>false</italic>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color: #0e7077;
|
||||||
font: bold 16px;
|
font: bold 16px;
|
||||||
background: transparent;</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-weight:600;">Currently running</span></p></body></html></string>
|
<string>Currently Running</string>
|
||||||
</property>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -177,49 +170,24 @@ background: transparent;</string>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">reloadStopButtonArea { padding: 0 }</string>
|
||||||
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<property name="spacing">
|
|
||||||
<number>24</number>
|
|
||||||
</property>
|
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="reloadAllButton">
|
<widget class="QPushButton" name="reloadAllButton">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>111</width>
|
|
||||||
<height>35</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="cursor">
|
|
||||||
<cursorShape>PointingHandCursor</cursorShape>
|
|
||||||
</property>
|
|
||||||
<property name="autoFillBackground">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background: #0e7077;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 4px;
|
|
||||||
font: bold 14px;
|
|
||||||
padding-top: 3px;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Reload all</string>
|
<string>Reload all</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -227,28 +195,6 @@ padding-top: 3px;</string>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="stopAllButton">
|
<widget class="QPushButton" name="stopAllButton">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>111</width>
|
|
||||||
<height>35</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="cursor">
|
|
||||||
<cursorShape>PointingHandCursor</cursorShape>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background: #0e7077;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 4px;
|
|
||||||
font: bold 14px;
|
|
||||||
padding-top: 3px;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Stop all</string>
|
<string>Stop all</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -261,8 +207,8 @@ padding-top: 3px;</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>0</width>
|
||||||
<height>20</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
@ -271,192 +217,104 @@ padding-top: 3px;</string>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_4">
|
<widget class="QWidget" name="widget_4" native="true">
|
||||||
<property name="orientation">
|
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||||
<enum>Qt::Vertical</enum>
|
<property name="spacing">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>8</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="noRunningScriptsLabel">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">font: 14px;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>There are no scripts currently running.</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>10</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QScrollArea" name="runningScriptsList">
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Helvetica,Arial,sans-serif</family>
|
|
||||||
<pointsize>14</pointsize>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="layoutDirection">
|
|
||||||
<enum>Qt::LeftToRight</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="verticalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>284</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="leftMargin">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<number>6</number>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="topMargin">
|
||||||
<string notr="true">font-size: 14px;</string>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
<property name="rightMargin">
|
||||||
<property name="spacing">
|
<number>6</number>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
<property name="bottomMargin">
|
||||||
<property name="leftMargin">
|
<number>0</number>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
<item>
|
||||||
<property name="topMargin">
|
<widget class="QScrollArea" name="runningScriptsList">
|
||||||
<number>0</number>
|
<property name="font">
|
||||||
</property>
|
<font>
|
||||||
<property name="rightMargin">
|
<family>Helvetica,Arial,sans-serif</family>
|
||||||
<number>0</number>
|
<pointsize>14</pointsize>
|
||||||
</property>
|
</font>
|
||||||
<property name="bottomMargin">
|
</property>
|
||||||
<number>0</number>
|
<property name="layoutDirection">
|
||||||
</property>
|
<enum>Qt::LeftToRight</enum>
|
||||||
</layout>
|
</property>
|
||||||
</widget>
|
<property name="frameShape">
|
||||||
</widget>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</item>
|
</property>
|
||||||
</layout>
|
<property name="lineWidth">
|
||||||
</widget>
|
<number>0</number>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
<property name="verticalScrollBarPolicy">
|
||||||
<widget class="QWidget" name="recentlyLoadedScriptsArea" native="true">
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
<property name="enabled">
|
</property>
|
||||||
<bool>true</bool>
|
<property name="horizontalScrollBarPolicy">
|
||||||
</property>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
<property name="minimumSize">
|
</property>
|
||||||
<size>
|
<property name="widgetResizable">
|
||||||
<width>0</width>
|
<bool>true</bool>
|
||||||
<height>100</height>
|
</property>
|
||||||
</size>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
<property name="maximumSize">
|
</property>
|
||||||
<size>
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
<width>16777215</width>
|
<property name="geometry">
|
||||||
<height>16777215</height>
|
<rect>
|
||||||
</size>
|
<x>0</x>
|
||||||
</property>
|
<y>0</y>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<width>284</width>
|
||||||
<property name="spacing">
|
<height>16</height>
|
||||||
<number>0</number>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="sizePolicy">
|
||||||
<number>0</number>
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
</property>
|
<horstretch>0</horstretch>
|
||||||
<property name="topMargin">
|
<verstretch>0</verstretch>
|
||||||
<number>0</number>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="styleSheet">
|
||||||
<number>0</number>
|
<string notr="true">font-size: 14px;</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<number>0</number>
|
<property name="spacing">
|
||||||
</property>
|
<number>0</number>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QLabel" name="recentlyLoadedLabel">
|
<property name="leftMargin">
|
||||||
<property name="styleSheet">
|
<number>0</number>
|
||||||
<string notr="true">color: #0e7077;
|
</property>
|
||||||
font: bold 16px;</string>
|
<property name="topMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="text">
|
</property>
|
||||||
<string><html><head/><body><p><span style=" font-weight:600;">Recently loaded</span></p></body></html></string>
|
<property name="rightMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="bottomMargin">
|
||||||
<item>
|
<number>0</number>
|
||||||
<widget class="QLabel" name="noRecentlyLoadedLabel">
|
</property>
|
||||||
<property name="styleSheet">
|
</layout>
|
||||||
<string notr="true">font: 14px;</string>
|
</widget>
|
||||||
</property>
|
</widget>
|
||||||
<property name="text">
|
</item>
|
||||||
<string>There are no recently loaded scripts.</string>
|
<item>
|
||||||
</property>
|
<widget class="QLabel" name="noRunningScriptsLabel">
|
||||||
</widget>
|
<property name="styleSheet">
|
||||||
</item>
|
<string notr="true">font: 14px;</string>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QWidget" name="recentlyLoadedScriptsTableWidget" native="true">
|
<property name="text">
|
||||||
<property name="sizePolicy">
|
<string>There are no scripts currently running.</string>
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
</property>
|
||||||
<horstretch>0</horstretch>
|
<property name="alignment">
|
||||||
<verstretch>1</verstretch>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
</sizepolicy>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="minimumSize">
|
</item>
|
||||||
<size>
|
</layout>
|
||||||
<width>284</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background: transparent;
|
|
||||||
font-size: 14px;</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
@ -476,9 +334,6 @@ font-size: 14px;</string>
|
||||||
<height>300</height>
|
<height>300</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
@ -502,16 +357,16 @@ font-size: 14px;</string>
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>15</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
@ -539,28 +394,6 @@ font: bold 16px;</string>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="loadScriptButton">
|
<widget class="QPushButton" name="loadScriptButton">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>111</width>
|
|
||||||
<height>35</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="cursor">
|
|
||||||
<cursorShape>PointingHandCursor</cursorShape>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background: #0e7077;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 4px;
|
|
||||||
font: bold 14px;
|
|
||||||
padding-top: 3px;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load script</string>
|
<string>Load script</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -570,64 +403,44 @@ padding-top: 3px;</string>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="filterLineEdit">
|
<widget class="QWidget" name="widget_2" native="true">
|
||||||
<property name="styleSheet">
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
<string notr="true">border: 1px solid rgb(128, 128, 128);
|
<property name="leftMargin">
|
||||||
border-radius: 2px;
|
<number>6</number>
|
||||||
padding: 4px;
|
</property>
|
||||||
background-color: white;</string>
|
<property name="topMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="text">
|
</property>
|
||||||
<string/>
|
<property name="rightMargin">
|
||||||
</property>
|
<number>6</number>
|
||||||
<property name="placeholderText">
|
</property>
|
||||||
<string>filter</string>
|
<property name="bottomMargin">
|
||||||
</property>
|
<number>0</number>
|
||||||
<property name="clearButtonEnabled">
|
</property>
|
||||||
<bool>true</bool>
|
<item>
|
||||||
</property>
|
<widget class="QLineEdit" name="filterLineEdit">
|
||||||
</widget>
|
<property name="text">
|
||||||
</item>
|
<string/>
|
||||||
<item>
|
</property>
|
||||||
<spacer name="verticalSpacer">
|
<property name="placeholderText">
|
||||||
<property name="orientation">
|
<string>filter</string>
|
||||||
<enum>Qt::Vertical</enum>
|
</property>
|
||||||
</property>
|
<property name="clearButtonEnabled">
|
||||||
<property name="sizeType">
|
<bool>true</bool>
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="sizeHint" stdset="0">
|
</item>
|
||||||
<size>
|
<item>
|
||||||
<width>20</width>
|
<widget class="QListView" name="scriptListView">
|
||||||
<height>6</height>
|
<property name="verticalScrollBarPolicy">
|
||||||
</size>
|
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
<property name="horizontalScrollBarPolicy">
|
||||||
</item>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
<item>
|
</property>
|
||||||
<widget class="QListView" name="scriptListView">
|
</widget>
|
||||||
<property name="styleSheet">
|
</item>
|
||||||
<string notr="true">QListView {
|
</layout>
|
||||||
border: 1px solid rgb(128, 128, 128);
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
QListView::item {
|
|
||||||
padding-top: 2px;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
}</string>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::Box</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="verticalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
29
libraries/shared/src/UIUtil.cpp
Normal file
29
libraries/shared/src/UIUtil.cpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// UIUtil.cpp
|
||||||
|
// library/shared/src
|
||||||
|
//
|
||||||
|
// Created by Ryan Huffman on 09/02/2014.
|
||||||
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <QStyle>
|
||||||
|
#include <QStyleOptionTitleBar>
|
||||||
|
|
||||||
|
#include "UIUtil.h"
|
||||||
|
|
||||||
|
int UIUtil::getWindowTitleBarHeight(const QWidget* window) {
|
||||||
|
QStyleOptionTitleBar options;
|
||||||
|
options.titleBarState = 1;
|
||||||
|
options.titleBarFlags = Qt::Window;
|
||||||
|
int titleBarHeight = window->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, window);
|
||||||
|
|
||||||
|
#if defined(Q_OS_MAC)
|
||||||
|
// The height on OSX is 4 pixels too tall
|
||||||
|
titleBarHeight -= 4;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return titleBarHeight;
|
||||||
|
}
|
24
libraries/shared/src/UIUtil.h
Normal file
24
libraries/shared/src/UIUtil.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
//
|
||||||
|
// UIUtil.h
|
||||||
|
// library/shared/src
|
||||||
|
//
|
||||||
|
// Created by Ryan Huffman on 09/02/2014.
|
||||||
|
// Copyright 2014 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef hifi_UIUtil_h
|
||||||
|
#define hifi_UIUtil_h
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class UIUtil {
|
||||||
|
public:
|
||||||
|
static int getWindowTitleBarHeight(const QWidget* window);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // hifi_UIUtil_h
|
Loading…
Reference in a new issue