mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
Added hide/show for task bar (Windows only).
This commit is contained in:
parent
3dbebe2347
commit
77d6ea6bec
6 changed files with 71 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include <shared/FileUtils.h>
|
#include <shared/FileUtils.h>
|
||||||
#include <shared/QtHelpers.h>
|
#include <shared/QtHelpers.h>
|
||||||
#include <DependencyManager.h>
|
#include <DependencyManager.h>
|
||||||
|
#include <MainWindow.h>
|
||||||
#include <OffscreenUi.h>
|
#include <OffscreenUi.h>
|
||||||
#include <StatTracker.h>
|
#include <StatTracker.h>
|
||||||
#include <Trace.h>
|
#include <Trace.h>
|
||||||
|
@ -186,3 +187,7 @@ void TestScriptingInterface::saveObject(QVariant variant, const QString& filenam
|
||||||
file.write(jsonData);
|
file.write(jsonData);
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestScriptingInterface::showMaximized() {
|
||||||
|
qApp->getWindow()->showMaximized();
|
||||||
|
}
|
|
@ -91,6 +91,11 @@ public slots:
|
||||||
*/
|
*/
|
||||||
void saveObject(QVariant v, const QString& filename);
|
void saveObject(QVariant v, const QString& filename);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Maximizes the window
|
||||||
|
*/
|
||||||
|
void showMaximized();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
bool waitForCondition(qint64 maxWaitMs, std::function<bool()> condition);
|
||||||
QString _testResultsLocation;
|
QString _testResultsLocation;
|
||||||
|
|
|
@ -204,6 +204,7 @@ void PluginContainer::setFullscreen(const QScreen* target, bool hideMenu) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma optimize("", off)
|
||||||
void PluginContainer::unsetFullscreen(const QScreen* avoid) {
|
void PluginContainer::unsetFullscreen(const QScreen* avoid) {
|
||||||
auto _window = getPrimaryWindow();
|
auto _window = getPrimaryWindow();
|
||||||
_window->showNormal();
|
_window->showNormal();
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
//
|
//
|
||||||
#include "AutoTester.h"
|
#include "AutoTester.h"
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
#include <windows.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
|
AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
ui.checkBoxInteractiveMode->setChecked(true);
|
ui.checkBoxInteractiveMode->setChecked(true);
|
||||||
|
@ -20,6 +25,11 @@ AutoTester::AutoTester(QWidget *parent) : QMainWindow(parent) {
|
||||||
connect(ui.actionClose, &QAction::triggered, this, &AutoTester::on_closeButton_clicked);
|
connect(ui.actionClose, &QAction::triggered, this, &AutoTester::on_closeButton_clicked);
|
||||||
connect(ui.actionAbout, &QAction::triggered, this, &AutoTester::about);
|
connect(ui.actionAbout, &QAction::triggered, this, &AutoTester::about);
|
||||||
|
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
|
ui.hideTaskbarButton->setVisible(false);
|
||||||
|
ui.showTaskbarButton->setVisible(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
test = new Test();
|
test = new Test();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +66,26 @@ void AutoTester::on_createTestsOutlineButton_clicked() {
|
||||||
test->createTestsOutline();
|
test->createTestsOutline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutoTester::on_showTaskbarButton_clicked() {
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
APPBARDATA abd = { sizeof abd };
|
||||||
|
UINT uState = (UINT)SHAppBarMessage(ABM_GETSTATE, &abd);
|
||||||
|
LPARAM param = uState & ABS_ALWAYSONTOP;
|
||||||
|
abd.lParam = param;
|
||||||
|
SHAppBarMessage(ABM_SETSTATE, &abd);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void AutoTester::on_hideTaskbarButton_clicked() {
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
APPBARDATA abd = { sizeof abd };
|
||||||
|
UINT uState = (UINT)SHAppBarMessage(ABM_GETSTATE, &abd);
|
||||||
|
LPARAM param = uState & ABS_ALWAYSONTOP;
|
||||||
|
abd.lParam = ABS_AUTOHIDE | param;
|
||||||
|
SHAppBarMessage(ABM_SETSTATE, &abd);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void AutoTester::on_closeButton_clicked() {
|
void AutoTester::on_closeButton_clicked() {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,10 @@ private slots:
|
||||||
void on_createMDFileButton_clicked();
|
void on_createMDFileButton_clicked();
|
||||||
void on_createAllMDFilesButton_clicked();
|
void on_createAllMDFilesButton_clicked();
|
||||||
void on_createTestsOutlineButton_clicked();
|
void on_createTestsOutlineButton_clicked();
|
||||||
|
|
||||||
|
void on_showTaskbarButton_clicked();
|
||||||
|
void on_hideTaskbarButton_clicked();
|
||||||
|
|
||||||
void on_closeButton_clicked();
|
void on_closeButton_clicked();
|
||||||
|
|
||||||
void saveImage(int index);
|
void saveImage(int index);
|
||||||
|
|
|
@ -147,6 +147,32 @@
|
||||||
<string>Create Tests Outline</string>
|
<string>Create Tests Outline</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="showTaskbarButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>490</x>
|
||||||
|
<y>280</y>
|
||||||
|
<width>91</width>
|
||||||
|
<height>40</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Taskbar</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="hideTaskbarButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>490</x>
|
||||||
|
<y>230</y>
|
||||||
|
<width>91</width>
|
||||||
|
<height>40</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide Taskbar</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menuBar">
|
<widget class="QMenuBar" name="menuBar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
|
|
Loading…
Reference in a new issue