Author: tom
Date: Tue Feb 24 08:19:12 2009
New Revision: 4439
URL: http://svn.slimdevices.com/jive?rev=4439&view=rev
Log:
Bug: N/A
Description:
showBriefly fixes - add visible check to let second quick showBriefly to still
appear.
Player showBriefly fixes - now mouse clicks and back hide the window, textarea
no longer gets focus
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Window.lua
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua
URL:
http://svn.slimdevices.com/jive/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua?rev=4439&r1=4438&r2=4439&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/slim/Player.lua Tue Feb 24
08:19:12 2009
@@ -58,6 +58,12 @@
local EVENT_KEY_ALL = jive.ui.EVENT_KEY_ALL
local EVENT_CHAR_PRESS = jive.ui.EVENT_CHAR_PRESS
+local EVENT_MOUSE_HOLD = jive.ui.EVENT_MOUSE_HOLD
+local EVENT_MOUSE_DRAG = jive.ui.EVENT_MOUSE_DRAG
+local EVENT_MOUSE_PRESS = jive.ui.EVENT_MOUSE_PRESS
+local EVENT_MOUSE_DOWN = jive.ui.EVENT_MOUSE_DOWN
+local EVENT_MOUSE_UP = jive.ui.EVENT_MOUSE_UP
+local EVENT_MOUSE_ALL = jive.ui.EVENT_MOUSE_ALL
local EVENT_SCROLL = jive.ui.EVENT_SCROLL
local EVENT_CONSUME = jive.ui.EVENT_CONSUME
local ACTION = jive.ui.ACTION
@@ -829,6 +835,12 @@
end
+local function hideAction(self)
+ self.currentSong.window:hide()
+ return EVENT_CONSUME
+end
+
+
-- onStage
-- we're being browsed!
function onStage(self)
@@ -874,14 +886,30 @@
})
self.currentSong.window:addWidget(group)
- self.currentSong.window:addListener(ACTION | EVENT_CHAR_PRESS |
EVENT_KEY_ALL | EVENT_SCROLL,
+
+ --don't let the textarea get the focus, because we want the window to
manage events
+ self.currentSong.window:focusWidget(nil)
+
+
+ --Only 'back' and mouse clicks clear the popup, all other input is
forwarded to main window
+
+ self.currentSong.window:addListener(ACTION | EVENT_SCROLL |
EVENT_MOUSE_PRESS | EVENT_MOUSE_HOLD | EVENT_MOUSE_DRAG,
function(event)
+
+ if (event:getType() & EVENT_MOUSE_ALL) > 0 then
+ return hideAction(self)
+ end
+
local prev = self.currentSong.window:getLowerWindow()
if prev then
Framework:dispatchEvent(prev, event)
end
return EVENT_CONSUME
end)
+
+
+ self.currentSong.window:addActionListener("back", self, hideAction)
+
self.currentSong.window.brieflyHandler = 1
end
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Window.lua
URL:
http://svn.slimdevices.com/jive/7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Window.lua?rev=4439&r1=4438&r2=4439&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Window.lua (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Window.lua Tue Feb 24
08:19:12 2009
@@ -62,6 +62,7 @@
local ACTION = jive.ui.ACTION
local EVENT_KEY_ALL = jive.ui.EVENT_KEY_ALL
local EVENT_MOUSE_HOLD = jive.ui.EVENT_MOUSE_HOLD
+local EVENT_MOUSE_DRAG = jive.ui.EVENT_MOUSE_DRAG
local EVENT_MOUSE_PRESS = jive.ui.EVENT_MOUSE_PRESS
local EVENT_MOUSE_DOWN = jive.ui.EVENT_MOUSE_DOWN
local EVENT_MOUSE_UP = jive.ui.EVENT_MOUSE_UP
@@ -277,7 +278,7 @@
function hideOnAllButtonInput(self)
if not self.hideOnAllButtonInputHandle then
- self.hideOnAllButtonInputHandle = self:addListener(ACTION |
EVENT_KEY_PRESS | EVENT_KEY_HOLD | EVENT_MOUSE_PRESS | EVENT_MOUSE_HOLD,
+ self.hideOnAllButtonInputHandle = self:addListener(ACTION |
EVENT_KEY_PRESS | EVENT_KEY_HOLD | EVENT_MOUSE_PRESS | EVENT_MOUSE_HOLD |
EVENT_MOUSE_DRAG,
function(event)
return
hideOnAllButtonInputListener(self, event)
end)
@@ -462,6 +463,14 @@
pushTransition,
popTransition)
+ if not self.visible and self.brieflyTimer ~= nil then
+ --other source may have hidden then window, but not cleaned up
the timer.
+ -- Without this visible check, the "briefly" window would not
appear until the old timer timeout
+ self.brieflyTimer:stop()
+ self.brieflyTimer = nil
+
+ end
+
if self.brieflyTimer ~= nil then
if msecs then
self.brieflyTimer:setInterval(msecs)
@@ -481,7 +490,7 @@
if self.brieflyHandler == nil then
self.brieflyHandler =
- self:addListener(ACTION | EVENT_CHAR_PRESS |
EVENT_KEY_PRESS | EVENT_SCROLL,
+ self:addListener(ACTION | EVENT_CHAR_PRESS |
EVENT_KEY_PRESS | EVENT_SCROLL | EVENT_MOUSE_PRESS | EVENT_MOUSE_HOLD |
EVENT_MOUSE_DRAG,
function(event)
self:hide(popTransition,
"NONE")
return EVENT_CONSUME
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins