Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Patch] Systray icon mouse click behaviour #16

Closed
GoogleCodeExporter opened this issue Dec 19, 2015 · 3 comments
Closed

[Patch] Systray icon mouse click behaviour #16

GoogleCodeExporter opened this issue Dec 19, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

hi again,

here is a very small patch fixing strange behaviour of left-mouse click on
the systray icon. It should hide/show the window if it's shown/hidden as
it's usual for this kind of application. Anyway - feel free to commit or
reject it if you wish ;)

It just flashes (reactivates) the main window with the old code.

And one more thing - dunno why you require to call the setVisible() for all
child wodgets. It should be done automatically. But I'm not familiar with
Cuberok guts yet ;)

P.S.: can you fill SVN messages/comments for next commits, please? It's
helpful for occassional SVN users like me...

Patch:

void Cuberok::showhide(bool s)
{
    bool act = !isVisible();
    setVisible(act);
    if (act)
        activateWindow();
    /*
    bool vis = isVisible();
    if(vis && s) activateWindow();
    else if(vis != s) {
        vis = s;
        setVisible(vis);
        foreach (QWidget *widget, QApplication::allWidgets()) {
            QDialog *d = qobject_cast<QDialog*>(widget);
            if(d) d->setVisible(vis);   
        }
    }*/
}

Original issue reported on code.google.com by yarpe...@gmail.com on 9 Apr 2009 at 8:01

@GoogleCodeExporter
Copy link
Author

Thanks, patch was committed

Original comment by drmoriar...@gmail.com on 9 Apr 2009 at 11:57

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Если вы не против, я предложу ещё такой 
пустяк. Клик средней кнопкой мыши поствит 
трек на паузу или снимет с паузы. Второе 
изменение исправляет поведение на линуксе, 
где окно из трея не разворачивалось, а 
появлялось свёрнутым в панели задач.


Index: src/cuberok.cpp
===================================================================
--- src/cuberok.cpp     (revision 200)
+++ src/cuberok.cpp     (working copy)
@@ -227,6 +227,8 @@
 {
        if(r == QSystemTrayIcon::Trigger) {
                showhide(true);
+       } else if ( r == QSystemTrayIcon::MiddleClick ) {
+               ui.actionPause->trigger();
        }
 }

@@ -234,9 +236,10 @@
 {
        bool act = !isVisible();
        setVisible(act);
-       if (act)
-               activateWindow();
-
+       if (act) {
+               activateWindow(); // for windows
+               showNormal(); // for linux
+       }
        /*bool vis = isVisible();
        if(vis && s) activateWindow();
        else if(vis != s) {

Original comment by nomen.in...@gmail.com on 22 May 2009 at 8:35

@GoogleCodeExporter
Copy link
Author

Спасибо, патч принят

Original comment by drmoriar...@gmail.com on 23 May 2009 at 5:36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant