Indicate state of Win/Alt modifiers by making '...' button appear depressed
[presencevnc] / src / mainwindow.cpp
index ce3afc5..5eb80dd 100644 (file)
@@ -54,7 +54,8 @@ MainWindow::MainWindow(QString url, int quality, int listen_port, bool view_only
 
     //set up toolbar
     toolbar = new QToolBar(0);
-    input_toolbuttons->addAction(toolbar->addAction(QChar(0x2026), this, SLOT(showKeyMenu()))); //"..." button
+    key_menu_button = input_toolbuttons->addAction(toolbar->addAction(QChar(0x2026), this, SLOT(showKeyMenu()))); //"..." button
+    key_menu_button->setCheckable(true); //used to indicate wether a modifier key is still pressed
     input_toolbuttons->addAction(toolbar->addAction(tr("Tab"), this, SLOT(sendTab())));
     input_toolbuttons->addAction(toolbar->addAction(tr("Esc"), this, SLOT(sendEsc())));
     input_toolbuttons->addAction(toolbar->addAction(tr("PgUp"), this, SLOT(sendPgUp())));
@@ -252,7 +253,7 @@ void MainWindow::statusChanged(RemoteView::RemoteStatus status)
 
         vnc_view->setZoomLevel(zoom_slider->value());
         vnc_view->useFastTransformations(false);
-        vnc_view->repaint();
+        vnc_view->update();
         break;
     case RemoteView::Disconnecting:
         if(old_status == RemoteView::Disconnected) //Disconnecting also occurs while connecting, so check last state
@@ -321,6 +322,7 @@ void MainWindow::showKeyMenu()
 {
     key_menu->exec();
     vnc_view->sendKeySequence(key_menu->getKeySequence());
+    key_menu_button->setChecked(key_menu->isAltChecked() or key_menu->isWinChecked());
 }
 
 void MainWindow::showPreferences()