mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
Remove custom behavior from running scripts widget
This commit is contained in:
parent
c76afe7d4a
commit
b0361025b0
4 changed files with 27 additions and 16 deletions
|
@ -3850,14 +3850,17 @@ void Application::manageRunningScriptsWidgetVisibility(bool shown) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::toggleRunningScriptsWidget() {
|
void Application::toggleRunningScriptsWidget() {
|
||||||
if (_runningScriptsWidgetWasVisible) {
|
if (_runningScriptsWidget->isVisible()) {
|
||||||
|
if (_runningScriptsWidget->hasFocus()) {
|
||||||
_runningScriptsWidget->hide();
|
_runningScriptsWidget->hide();
|
||||||
_runningScriptsWidgetWasVisible = false;
|
|
||||||
} else {
|
} else {
|
||||||
_runningScriptsWidget->setBoundary(QRect(_window->geometry().topLeft(),
|
_runningScriptsWidget->raise();
|
||||||
_window->size()));
|
setActiveWindow(_runningScriptsWidget);
|
||||||
|
_runningScriptsWidget->setFocus();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
_runningScriptsWidget->show();
|
_runningScriptsWidget->show();
|
||||||
_runningScriptsWidgetWasVisible = true;
|
_runningScriptsWidget->setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "ScriptsModel.h"
|
#include "ScriptsModel.h"
|
||||||
|
|
||||||
RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
|
RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
|
||||||
FramelessDialog(parent, 0, POSITION_LEFT),
|
QWidget(parent, Qt::Window),
|
||||||
ui(new Ui::RunningScriptsWidget),
|
ui(new Ui::RunningScriptsWidget),
|
||||||
_signalMapper(this),
|
_signalMapper(this),
|
||||||
_proxyModel(this),
|
_proxyModel(this),
|
||||||
|
@ -33,8 +33,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->hideWidgetButton->setIcon(QIcon(Application::resourcesPath() + "images/close.svg"));
|
||||||
ui->reloadAllButton->setIcon(QIcon(Application::resourcesPath() + "images/reload.svg"));
|
ui->reloadAllButton->setIcon(QIcon(Application::resourcesPath() + "images/reload.svg"));
|
||||||
ui->stopAllButton->setIcon(QIcon(Application::resourcesPath() + "images/stop.svg"));
|
ui->stopAllButton->setIcon(QIcon(Application::resourcesPath() + "images/stop.svg"));
|
||||||
|
@ -143,6 +141,8 @@ void RunningScriptsWidget::setRunningScripts(const QStringList& list) {
|
||||||
line->setFrameShape(QFrame::HLine);
|
line->setFrameShape(QFrame::HLine);
|
||||||
line->setStyleSheet("color: #E1E1E1; margin-left: 6px; margin-right: 6px;");
|
line->setStyleSheet("color: #E1E1E1; margin-left: 6px; margin-right: 6px;");
|
||||||
|
|
||||||
|
row->setStyleSheet("background: #f7f7f7;");
|
||||||
|
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(row);
|
ui->scrollAreaWidgetContents->layout()->addWidget(row);
|
||||||
ui->scrollAreaWidgetContents->layout()->addWidget(line);
|
ui->scrollAreaWidgetContents->layout()->addWidget(line);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,10 @@ void RunningScriptsWidget::showEvent(QShowEvent* event) {
|
||||||
ui->filterLineEdit->setFocus();
|
ui->filterLineEdit->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
FramelessDialog::showEvent(event);
|
const QRect parentGeometry = parentWidget()->geometry();
|
||||||
|
setGeometry(parentGeometry.topLeft().x(), parentGeometry.topLeft().y(), size().width(), parentWidget()->size().height());
|
||||||
|
|
||||||
|
QWidget::showEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunningScriptsWidget::selectFirstInList() {
|
void RunningScriptsWidget::selectFirstInList() {
|
||||||
|
@ -189,14 +192,14 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,7 +7,7 @@
|
||||||
<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">
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<string notr="true">* {
|
<string notr="true">* {
|
||||||
font-family: Helvetica, Arial, sans-serif;
|
font-family: Helvetica, Arial, sans-serif;
|
||||||
}
|
}
|
||||||
QWidget {
|
#RunningScriptsWidget {
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
}</string>
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -326,6 +326,11 @@ padding-top: 3px;</string>
|
||||||
<property name="layoutDirection">
|
<property name="layoutDirection">
|
||||||
<enum>Qt::LeftToRight</enum>
|
<enum>Qt::LeftToRight</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">#runningScriptsList {
|
||||||
|
background: #f7f7f7;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
|
@ -608,6 +613,7 @@ background-color: white;</string>
|
||||||
<widget class="QListView" name="scriptListView">
|
<widget class="QListView" name="scriptListView">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QListView {
|
<string notr="true">QListView {
|
||||||
|
background: #f7f7f7;
|
||||||
border: 1px solid rgb(128, 128, 128);
|
border: 1px solid rgb(128, 128, 128);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue