[ADDED] Allowing Notifications show outside of a window

Request new features and improvements you want to see in WebLaF.
I will answer any request so don't hesitate and post it!

[ADDED] Allowing Notifications show outside of a window

Postby frizinator » Tue Sep 30, 2014 3:29 am

I'm pretty sure this has been suggested before, but I think I may have found a possible easy solution. I've looked through your PopupLayer, Notification, and etc code and though I could be wrong, it may be a seamless integration.

Playing around with the WebNotificationPopup, because it is derived from a WebPopup, which extends WebPanel, it can be added to a Window, such as WebFrame.

The following code will show how to show a WebNotificationPopup outside of a window. It does not show code to position it correctly in the bottom right corner of the screen.

Code: Select all

WebFrame frame = new WebFrame();
WebNotificationPopup popup = new WebNotificationPopup();

popup.setContent("Testing");

frame.setUndecorated(true);
frame.setBackground(new Color(0,0,0,0));

frame.add(popup);
frame.setVisible(true);


Setting the frame undecorated and setting the background with 0 Alpha will show only the WebNotificationPopup and can be displayed outside the current window! I don't know how you position the Popup inside a Window, though I think you can probably use similar code utilizing GraphicsEnviroment and getting graphics devices and such.
frizinator
 
Posts: 12
Joined: Fri Dec 07, 2012 8:14 am

Re: Allowing Notifications show outside of a window

Postby frizinator » Tue Sep 30, 2014 3:31 am

I can probably play with some code for a little bit and see what results I can come up with using the Graphics Enviroment package.
frizinator
 
Posts: 12
Joined: Fri Dec 07, 2012 8:14 am

Re: Allowing Notifications show outside of a window

Postby frizinator » Tue Sep 30, 2014 3:41 am

Sorry for another reply, as it won't let me edit my post.

However, there are a couple issues doing this. First, it creates an extra icon in the taskbar under the currently running program. Utilizing a WebWindow may fix this, but I couldn't get the WebWindow working correctly. Also, it seems that adding a popup to the frame sets the size of the popup to the frame. So, this could actually provide useful for other uses as well.

Secondly, if a user selects the currently running frame the popup will disappear behind the current window. This could be fixed by using a WebDialog instead and setting it modal, but then this will also prohibit the user from doing anything until the is closed.
frizinator
 
Posts: 12
Joined: Fri Dec 07, 2012 8:14 am

Re: Allowing Notifications show outside of a window

Postby mgarin » Tue Sep 30, 2014 12:04 pm

I am aware of this request and it was already implemented some time ago for upcoming v1.29 update, check this issue log: https://github.com/mgarin/weblaf/issues/64
It was actually implemented a few months ago :)

Unfortunately v1.29 taking much longer than I thought so there is a pre-release build available if you want to test out new features here: http://weblookandfeel.com/downloads/prerelease/

Starting with this update WebNotification extends new special class - WebHeavyWeightPopup. That tricky popup component based on simple WebPanel allows to show customized and decorated content anywhere on the screen.

But basically - WebNotification can still be used in the same way it was used before, but it will now be displayed independant of the invoker window. The old in-window-only version of notification is also available - it was renamed to WebInnerNotification and can also be called/displayed through NotificationManager.

P.S. The way you have suggested is one of possible solutions but it will use excessive amount of memory in case you want to display notification in full-screen mode in that way. Plus it won't work properly on some OS which still doesn't support window per-pixel translucency.
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: [ADDED] Allowing Notifications show outside of a window

Postby frizinator » Fri Oct 03, 2014 1:00 am

Alright, well, it's good to see that was added. I was playing around with the Notification Popup and kind of heavily modified the WebNotificationPopup class for something I'm working on. I like the style of it. Half way through modifying it I figured out I could have just set the style of a WebPopup to the notification popup style. haha.
frizinator
 
Posts: 12
Joined: Fri Dec 07, 2012 8:14 am

Re: [ADDED] Allowing Notifications show outside of a window

Postby mgarin » Fri Oct 03, 2014 1:35 pm

:)
So I guess this case should be solved now?
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: [ADDED] Allowing Notifications show outside of a window

Postby frizinator » Sun Oct 05, 2014 2:14 am

Yes, agreed. Thank you for replying! Btw, incoming new post in questions. You're very helpful!
frizinator
 
Posts: 12
Joined: Fri Dec 07, 2012 8:14 am

Re: [ADDED] Allowing Notifications show outside of a window

Postby mgarin » Sun Oct 05, 2014 3:36 pm

Will be waiting for it :)
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg

Re: [ADDED] Allowing Notifications show outside of a window

Postby frizinator » Tue Oct 07, 2014 2:02 am

Sorry, I haven't posted it! My internet has been acting up and I've been unable to connect to the forums. I decided to email you what I was going to post.
frizinator
 
Posts: 12
Joined: Fri Dec 07, 2012 8:14 am

Re: [ADDED] Allowing Notifications show outside of a window

Postby mgarin » Tue Oct 07, 2014 2:18 pm

No problem, I'll reply there :)
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron