void LLTeleportHistoryPanel::onGearButtonClicked() { LLMenuGL* menu = (LLMenuGL*)mGearMenuHandle.get(); if (!menu) return; // Shows the menu at the top of the button bar. // Calculate its coordinates. LLPanel* bottom_panel = getChild<LLPanel>("bottom_panel"); menu->arrangeAndClear(); S32 menu_height = menu->getRect().getHeight(); S32 menu_x = -2; // *HACK: compensates HPAD in showPopup() S32 menu_y = bottom_panel->getRect().mTop + menu_height; // Actually show the menu. menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, menu, menu_x, menu_y); }