mirror of https://github.com/anoshenko/rui.git
Added DismissWithoutAnimation methos to Popup interface
This commit is contained in:
parent
ca68b80b38
commit
620a81ae1b
|
|
@ -4,6 +4,7 @@
|
||||||
* Added GoogleFonts field to AppParams
|
* Added GoogleFonts field to AppParams
|
||||||
* Added functions: GetWhiteSpace, GetWordBreak, ScrollIntoViewIfNeeded
|
* Added functions: GetWhiteSpace, GetWordBreak, ScrollIntoViewIfNeeded
|
||||||
* Added PopupShowAnimation and SetPopupShowAnimation methods to Session interface
|
* Added PopupShowAnimation and SetPopupShowAnimation methods to Session interface
|
||||||
|
* Added DismissWithoutAnimation methos to Popup interface
|
||||||
* Added ToBoundsProperty method to Bounds struct
|
* Added ToBoundsProperty method to Bounds struct
|
||||||
|
|
||||||
# v0.20.0
|
# v0.20.0
|
||||||
|
|
|
||||||
13
popup.go
13
popup.go
|
|
@ -296,6 +296,9 @@ type Popup interface {
|
||||||
// Dismiss closes a popup
|
// Dismiss closes a popup
|
||||||
Dismiss()
|
Dismiss()
|
||||||
|
|
||||||
|
// DismissWithoutAnimation closes a popup without animation
|
||||||
|
DismissWithoutAnimation()
|
||||||
|
|
||||||
onDismiss()
|
onDismiss()
|
||||||
html(buffer *strings.Builder)
|
html(buffer *strings.Builder)
|
||||||
viewByHTMLID(id string) View
|
viewByHTMLID(id string) View
|
||||||
|
|
@ -933,7 +936,11 @@ func (popup *popupData) cancel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (popup *popupData) Dismiss() {
|
func (popup *popupData) Dismiss() {
|
||||||
popup.Session().popupManager().dismissPopup(popup)
|
popup.Session().popupManager().dismissPopup(popup, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (popup *popupData) DismissWithoutAnimation() {
|
||||||
|
popup.Session().popupManager().dismissPopup(popup, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (popup *popupData) Show() {
|
func (popup *popupData) Show() {
|
||||||
|
|
@ -1530,7 +1537,7 @@ func (manager *popupManager) showPopup(popup Popup) {
|
||||||
popup.showAnimation()
|
popup.showAnimation()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *popupManager) dismissPopup(popup Popup) {
|
func (manager *popupManager) dismissPopup(popup Popup, animation bool) {
|
||||||
if manager.popups == nil {
|
if manager.popups == nil {
|
||||||
manager.popups = []Popup{}
|
manager.popups = []Popup{}
|
||||||
return
|
return
|
||||||
|
|
@ -1574,7 +1581,7 @@ func (manager *popupManager) dismissPopup(popup Popup) {
|
||||||
popup.onDismiss()
|
popup.onDismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
if !popup.dismissAnimation(listener) {
|
if !animation || !popup.dismissAnimation(listener) {
|
||||||
listener("")
|
listener("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue