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

Ricochet's icon in tray #260

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

kolodziej
Copy link
Contributor

Features:

  • Icon changes when user has unread messages.
  • Left click on tray icon shows and hides main window
  • Right click gives context menu with four options:
    • preferences
    • add contact
    • copy my id [to clipboard]
    • quit
  • User can activate option which will change behavior of close ('X') button to make it hides window, not closes application.

This PR is related to issue #247

@@ -67,6 +68,8 @@ MainWindow::MainWindow(QObject *parent)
Q_ASSERT(!uiMain);
uiMain = this;

trayIcon = new TrayIcon(QIcon(QLatin1String(":/icons/ricochet.svg")), QIcon(QLatin1String(":/icons/ricochet_unread.svg")));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trayIcon is leaked on destruction

@special
Copy link
Member

special commented Sep 17, 2015

I think the tray icon should only be visible when close-to-tray is enabled. We could also make a separate option, but I like that less. What do you think?

Looking good - I think this can be ready to merge after the above comments.

@special special mentioned this pull request Sep 17, 2015
1. Destruction of TrayIcon object in MainWindow's destructor
2. Forward declaration of TrayIcon in src/ui/MainWindow.h
3. QIcon objects for TrayIcon's constructor as const references
4. New names for TrayIcon's signals, removes unnecessary slots
	 and connects signals from TrayIcon's context menu to another
	 signals
5. Fixes braces style: brace in the same line as if/else in QML
6. Title case in TrayIcon's context menu
@kolodziej
Copy link
Contributor Author

Ok. I think everything's done.

TrayIcon(const QIcon& std_icon, const QIcon& unread_icon);
~TrayIcon();

void setStdIcon(QIcon std_icon);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are unused?

1. Removes unused TrayIcon::setStdIcon and TrayIcon::setUnreadIcon
2. Removes code formatting issues
@kolodziej
Copy link
Contributor Author

I hope now it's ok :)

@rburchell
Copy link
Contributor

thanks :)

@qsodev
Copy link
Contributor

qsodev commented Sep 21, 2015

looks good :)

@kolodziej
Copy link
Contributor Author

It's about time to merge :)

@puzanov
Copy link

puzanov commented Dec 17, 2015

Is it in master?

@kolodziej
Copy link
Contributor Author

Not yet, but it's ready since end of September.

@kolodziej kolodziej mentioned this pull request Dec 23, 2015
@special
Copy link
Member

special commented Jan 2, 2016

Toggling the window when the tray icon is clicked doesn't behave well. On some platforms, the window is hiding every time you click to open the context menu on the tray. How do most messaging-type applications behave here?

It's less important, but the unread icon is too subtle, also. Maybe recoloring the entire icon to orange would be better. We could merge without that.

We should disable tray icons entirely on OS X. Adding a #ifndef Q_OS_MAC in the right place would do. I can do this after merge if needed.

@qsodev
Copy link
Contributor

qsodev commented Jan 3, 2016

For example Pidgin and Psi open and close the main window on single click. Right click opens the context menu.

@ZimTester
Copy link

Single click is the best Windows practice, agree

@kolodziej
Copy link
Contributor Author

The only think that could be done is new 'unread icon'. After merging this branch into master we can make an issue. Maybe we have anybody who is better in graphics than me ;)

@qsodev
Copy link
Contributor

qsodev commented Feb 25, 2016

what about simply flashing the already existing tray icon when there are unread messages?

@kolodziej
Copy link
Contributor Author

I think it could be done. What do you think, should it be default behaviour or just an option?

@ZimTester
Copy link

I still think the best way is using a special icon for unread incoming messages, and here is why:
Flashing should be switchable on/off by option, because not everybody likes it. But it's ok to make it on by default. But when it's off we should see that we have unread messages, that's why we need a special icon. (Also if we have it then we should see the same special icon when flashing is on too).
Maybe you can choose something from any free icon packs? Hm...
That's just my humble opinion after using another messengers.

@kolodziej
Copy link
Contributor Author

We have special icon with dot. It's not very effective and I wanted to change it. I didn't know if it is enough to set new, more different icon or make it flash.

@kolodziej
Copy link
Contributor Author

kolodziej commented Mar 5, 2016

I've changed unread icon and add blinking when we have unread messages.

We need someone who will make this feature available on os x.

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

Successfully merging this pull request may close these issues.

None yet

6 participants