I’ve just met UI:Notification and Its great!
But I’ve 3 suggestions:
1- It lasts too short on screen (like 3s). There should be a time param;
2- We should be able to break/jump message line with “\n”;
3- The top bar color should be custom.
Why do I want to use it?
a) UI.messagebox is too big and modal wich usually annoys users and can’t stack;
b) UI::HtmlDialog is just too big/crude for this application;
c) UI:Notification fits rlly nice on UI style, isn’t modal and its perfect for notifications that u may preffer to ignore (such operation end message; during operation partial reports, hints/advices, manipulative religious speeches from selective karens just bc it’s convenient to their agenda);
d) I’ve no idea how to develop an advanced custom UI such “Curic Pie Menus” (would love to hear advices on it).
But even that SU team adds my suggestions, it would probly break backwards compatibility
So in order to have a better UI:Notification in older SU we must find a workaround.
So I’ve made this:
module Taxsola
module UI_notification_test
require 'sketchup.rb'
require 'extensions.rb'
@extension = SketchupExtension.new('Plugin name', 'core.rb')
@Stats = 0
@message = "SUCESS!\r\nRuntime: 45s"
@notification = UI::Notification.new(@extension, @message)
@notification.on_accept("Ok") { puts "Closes"; @Stats = 1; }
@notification.on_dismiss("Statistics") { puts "Shows statistics"; @Stats = 1; }
@notification.show
@Timer = UI.start_timer(4,true) {
if (@Stats == 1)
UI.stop_timer(@Timer)
else
@notification.show #unless @notification.shown? <<< there should be this feature so they dont stack when mouse is over it.
end
}
end
end
Wich is almost Okay, except it does stack flooding if you keep the mouse over the notification.
Questions:
Is there a way to check if the notification is visible? ie. “object.visible?” or “object.shown?”
Is there a way to check if the mouse is above the notification?
is there a way to show/hide it instantly/without transition? so we could make it return seamlessly.
Final considerations:
Yes, we could set a time range where it would keep returning.
Thanks for reading!
Related topic: