Changeset 8872575


Ignore:
Timestamp:
03/03/15 07:46:24 (4 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, enter/10, releng/10.1.2
Children:
9bef46d
Parents:
e193655
Message:

Clean up the Tor icon overlay in pc-systemupatertray, and ensure that the menu is hidden before starting any tor enable/disable operations (causes strange Qt hang on some window managers).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt5/pc-systemupdatertray/TrayUI.cpp

    r7a0f437 r8872575  
    167167  if(CSTAT.InTorMode()){ 
    168168    //Add the pixmap overlay to the icon (bottom-right quarter of image) 
    169     QImage img; 
     169    QImage img = ico.pixmap(64,64).toImage(); 
     170    QPixmap overlay = QPixmap(":/images/tor.png").scaled(32,32, Qt::KeepAspectRatio, Qt::SmoothTransformation); 
    170171    QPainter painter(&img); 
    171       painter.drawPixmap(0,0,ico.pixmap(64,64)); 
    172       painter.drawPixmap(32,32,QPixmap(":/images/tor.png").scaled(32,32, Qt::KeepAspectRatio, Qt::SmoothTransformation)); 
     172      painter.drawPixmap(32,32,overlay); 
    173173    ico = QIcon(QPixmap::fromImage(img)); 
    174174    //Add a notice to the tooltip 
     
    296296 
    297297void TrayUI::slotToggleTorMode(){ 
     298  //Make sure the menu is hidden when this option is clicked 
     299  this->contextMenu()->hide(); 
     300  QApplication::processEvents(); 
     301         
    298302  bool enabled = CSTAT.InTorMode(); 
    299303  if(torMode->isChecked() && enabled){ return; } //nothing to do - already in TOR mode 
Note: See TracChangeset for help on using the changeset viewer.