Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
News speed up. Info banner initial commit
- Loading branch information
1 parent
142bd01
commit 9ffcd1e
Showing
9 changed files
with
119 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var notifyStack = [] | ||
|
||
function push(info) | ||
{ | ||
notifyStack.push(info) | ||
} | ||
|
||
function pop() | ||
{ | ||
return notifyStack.pop() | ||
} | ||
|
||
function top() | ||
{ | ||
return notifyStack[0] | ||
} | ||
|
||
function deep() | ||
{ | ||
return notifyStack.length | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 | ||
import QtQuick 1.1 | ||
import com.nokia.extras 1.1 | ||
import "NotifyStack.js" as NotifyStack | ||
|
||
InfoBanner { | ||
id: banner | ||
|
||
function push(text, iconSource, callback) { | ||
var item = { | ||
"iconSource" : iconSource, | ||
"text" : text, | ||
"callback" : callback | ||
} | ||
__setInfo(item) | ||
NotifyStack.push(item) | ||
banner.show() | ||
} | ||
|
||
function pop() { | ||
var item = NotifyStack.pop() | ||
if (item.callback) | ||
item.callback() | ||
item = NotifyStack.top() | ||
console.log(NotifyStack.deep()) | ||
if (item) | ||
__setInfo(item) | ||
else | ||
banner.hide() | ||
} | ||
|
||
function __setInfo(item) | ||
{ | ||
banner.text = item.text | ||
banner.iconSource = item.iconSource | ||
} | ||
|
||
timerEnabled: false | ||
|
||
MouseArea { | ||
anchors.fill: parent | ||
onClicked: { | ||
banner.pop() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule vk
updated
from 9b8d34 to fefd72