28 lines
792 B
Plaintext
28 lines
792 B
Plaintext
import "pkg:/components/Dialog/DialogUtils.bs"
|
|
import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs"
|
|
import "pkg:/source/utils/FocusManagement.bs"
|
|
import "pkg:/source/utils/Locale.bs"
|
|
|
|
function Init()
|
|
m.top.focusable = true
|
|
m.top.itemSpacings = [8]
|
|
m.button = m.top.findNode("Button")
|
|
m.button.observeField("buttonSelected", FuncName(OnButtonSelected))
|
|
end function
|
|
|
|
function OnFocusChange() as void
|
|
if not m.top.focus
|
|
return
|
|
end if
|
|
NodeSetFocus(m.button, true)
|
|
end function
|
|
|
|
function BindPreference(_preferences as object, _key as string)
|
|
' Do nothing
|
|
end function
|
|
|
|
function OnButtonSelected()
|
|
SearchHistoryUtils.Clear()
|
|
DialogUtils.ShowDialog(Tr(Locale.Settings.SearchHistoryCleared), Tr(Locale.Generic.Success))
|
|
end function
|