From 754ae1a54132eb41332267fc70a42595017c5a6e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 16 Jul 2016 23:44:31 +0200 Subject: gui, tracker/{aruco,pt}, api: detect whether widget is visible on screen Sadly, it's only implemented right now on win32. Remove "set enabled" code for the video widget since it only works for explicit window minimization, not covering by other windows. --- gui/ui.cpp | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'gui/ui.cpp') diff --git a/gui/ui.cpp b/gui/ui.cpp index 37b9b748..2feb806b 100644 --- a/gui/ui.cpp +++ b/gui/ui.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2015, Stanislaw Halik +/* Copyright (c) 2013-2016, Stanislaw Halik * Permission to use, copy, modify, and/or distribute this * software for any purpose with or without fee is hereby granted, @@ -124,8 +124,6 @@ MainWindow::MainWindow() : register_shortcuts(); - connect(this, &MainWindow::emit_minimized, this, &MainWindow::mark_minimized, Qt::QueuedConnection); - ui.btnStartTracker->setFocus(); } @@ -558,30 +556,6 @@ void MainWindow::restore_from_tray(QSystemTrayIcon::ActivationReason) activateWindow(); // for Windows } -void MainWindow::changeEvent(QEvent* e) -{ - if (e->type() == QEvent::WindowStateChange) - { - const bool is_minimized = windowState() & Qt::WindowMinimized; - - if (s.tray_enabled && is_minimized) - { - if (!tray) - ensure_tray(); - hide(); - } - - emit_minimized(is_minimized); - } - - QMainWindow::changeEvent(e); -} - -void MainWindow::mark_minimized(bool is_minimized) -{ - ui.video_frame->setEnabled(!is_minimized); -} - void MainWindow::maybe_start_profile_from_executable() { if (!work) -- cgit v1.2.3