From 865f13a6b3c822b7a30a6a9d0d99e03e150d3e2c Mon Sep 17 00:00:00 2001 From: urnati Date: Sun, 21 Nov 2021 06:26:38 -0500 Subject: [PATCH] - Add back accidentily removed routine - Utils to add 'Right Side' menu option --- TitanClassic/TitanClassicUtils.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/TitanClassic/TitanClassicUtils.lua b/TitanClassic/TitanClassicUtils.lua index 5859c41..f34582a 100644 --- a/TitanClassic/TitanClassicUtils.lua +++ b/TitanClassic/TitanClassicUtils.lua @@ -1064,6 +1064,29 @@ function TitanPanelRightClickMenu_ToggleColoredText(value) end --[[ API +NAME: TitanPanelRightClickMenu_AddToggleRightSide +DESC: Menu - add a toggle Right Side (localized) command at the given level in the form of a button. Titan will properly control the "DisplayOnRightSide" +VAR: id - id of the plugin +VAR: level - level to put the line +OUT: None +--]] +function TitanPanelRightClickMenu_AddToggleRightSide(id, level) + -- copy of TitanPanelRightClickMenu_AddToggleVar adding a remove button + local info = {}; + info.text = L["TITAN_CLOCK_MENU_DISPLAY_ON_RIGHT_SIDE"]; + info.value = {id, "DisplayOnRightSide"}; + info.func = function() + local bar = TitanUtils_GetWhichBar(id) + TitanPanelRightClickMenu_ToggleVar({id, "DisplayOnRightSide"}) + TitanPanel_RemoveButton(id); + TitanUtils_AddButtonOnBar(bar, id) + end + info.checked = TitanGetVar(id, "DisplayOnRightSide"); + info.keepShownOnClick = 1; + L_UIDropDownMenu_AddButton(info, level); +end + +--[[ API NAME: TitanPanelRightClickMenu_SetCustomBackdrop DESC: This will set the backdrop of the given button. This is used for custom created controls such as Clock offset or Volume sliders to give a consistent look. VAR: frame - the control frame of the plugin -- 1.7.9.5