diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-28 09:06:15 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-28 09:09:39 +0100 |
commit | 1863f330b2b366f504a8b510d282163737d9f715 (patch) | |
tree | b4a1b50bb65595604ba84c07652c57d32e889b2b /facetracknoir | |
parent | 5b0008b166772b5dbfc480eb3fadd1a78035b27c (diff) |
rename
Diffstat (limited to 'facetracknoir')
-rw-r--r-- | facetracknoir/curve-config.cpp | 1 | ||||
-rw-r--r-- | facetracknoir/curve-config.h | 2 | ||||
-rw-r--r-- | facetracknoir/main.cpp | 2 | ||||
-rw-r--r-- | facetracknoir/main.ui (renamed from facetracknoir/facetracknoir.ui) | 0 | ||||
-rw-r--r-- | facetracknoir/mapping.ui (renamed from facetracknoir/ftnoir_curves.ui) | 0 | ||||
-rw-r--r-- | facetracknoir/ui-res.qrc (renamed from facetracknoir/main-facetracknoir.qrc) | 0 | ||||
-rw-r--r-- | facetracknoir/ui.cpp (renamed from facetracknoir/facetracknoir.cpp) | 18 | ||||
-rw-r--r-- | facetracknoir/ui.h (renamed from facetracknoir/facetracknoir.h) | 3 |
8 files changed, 22 insertions, 4 deletions
diff --git a/facetracknoir/curve-config.cpp b/facetracknoir/curve-config.cpp index f00d3657..db5a4a75 100644 --- a/facetracknoir/curve-config.cpp +++ b/facetracknoir/curve-config.cpp @@ -1,4 +1,3 @@ -#include "./facetracknoir.h" #include "./curve-config.h" #include "opentrack/main-settings.hpp" MapWidget::MapWidget(Mappings& m, main_settings& s) : diff --git a/facetracknoir/curve-config.h b/facetracknoir/curve-config.h index 2104b7fa..d1ef7ad2 100644 --- a/facetracknoir/curve-config.h +++ b/facetracknoir/curve-config.h @@ -1,7 +1,7 @@ #pragma once #include <QWidget> #include "opentrack/mappings.hpp" -#include "ui_ftnoir_curves.h" +#include "ui_mapping.h" class MapWidget: public QWidget { diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index ee8da907..9c2ced45 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/main.cpp @@ -1,4 +1,4 @@ -#include "facetracknoir.h" +#include "ui.h" #include <QApplication> #include <QStyleFactory> #include <QStringList> diff --git a/facetracknoir/facetracknoir.ui b/facetracknoir/main.ui index 69ae1f8a..69ae1f8a 100644 --- a/facetracknoir/facetracknoir.ui +++ b/facetracknoir/main.ui diff --git a/facetracknoir/ftnoir_curves.ui b/facetracknoir/mapping.ui index 9f422b9b..9f422b9b 100644 --- a/facetracknoir/ftnoir_curves.ui +++ b/facetracknoir/mapping.ui diff --git a/facetracknoir/main-facetracknoir.qrc b/facetracknoir/ui-res.qrc index 0b28b032..0b28b032 100644 --- a/facetracknoir/main-facetracknoir.qrc +++ b/facetracknoir/ui-res.qrc diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/ui.cpp index 3ea95baa..edd3a818 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/ui.cpp @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License along * with this program; if not, see <http://www.gnu.org/licenses/>. *********************************************************************************/ -#include "facetracknoir.h" +#include "ui.h" #include "opentrack/tracker.h" #include <QFileDialog> @@ -78,6 +78,10 @@ MainWindow::MainWindow() : connect(&pose_update_timer, SIGNAL(timeout()), this, SLOT(showHeadPose())); connect(&kbd_quit, SIGNAL(activated()), this, SLOT(exit())); kbd_quit.setEnabled(true); + + ensure_tray(); + if (s.tray_enabled) + hide(); } MainWindow::~MainWindow() @@ -406,3 +410,15 @@ void MainWindow::shortcutToggled() if (work) work->tracker->toggle_enabled(); } + +void MainWindow::ensure_tray() +{ + tray = nullptr; + if (s.tray_enabled) + { + tray = std::make_shared<QSystemTrayIcon>(this); + tray->setIcon(QIcon(":/images/facetracknoir.png")); + tray->show(); + connect(tray.get(), SIGNAL(activated()), this, SLOT(show())); + } +} diff --git a/facetracknoir/facetracknoir.h b/facetracknoir/ui.h index 6e7ea4e0..9419936f 100644 --- a/facetracknoir/facetracknoir.h +++ b/facetracknoir/ui.h @@ -36,6 +36,7 @@ #include <QPixmap> #include <QLabel> #include <QTimer> +#include <QSystemTrayIcon> #if !defined(_WIN32) # include "qxt-mini/QxtGlobalShortcut" @@ -61,6 +62,7 @@ class MainWindow : public QMainWindow, private State Q_OBJECT Ui::OpentrackUI ui; + ptr<QSystemTrayIcon> tray; QTimer pose_update_timer; ptr<KeyboardShortcutDialog> shortcuts_widget; ptr<MapWidget> mapping_widget; @@ -88,6 +90,7 @@ class MainWindow : public QMainWindow, private State void updateButtonState(bool running, bool inertialp); void fill_profile_combobox(); void display_pose(const double* mapped, const double* raw); + void ensure_tray(); public slots: void shortcutRecentered(); |