STORM-666 FIXED Menu spawned by the overflow button had invalid position in Place Profile and Avatar Profile panels.
Changes: * Changed the button class from LLButton to LLMenuButton to avoid duplicating menu positioning logic. * Enabled LLMenuButton to support aligning menu to the top right corner of the button.master
parent
d7d23d1624
commit
552ddf4be4
|
|
@ -175,6 +175,13 @@ void LLMenuButton::updateMenuOrigin()
|
|||
mY = rect.mTop + mMenuHandle.get()->getRect().getHeight();
|
||||
break;
|
||||
}
|
||||
case MP_TOP_RIGHT:
|
||||
{
|
||||
const LLRect& menu_rect = mMenuHandle.get()->getRect();
|
||||
mX = rect.mRight - menu_rect.getWidth();
|
||||
mY = rect.mTop + menu_rect.getHeight();
|
||||
break;
|
||||
}
|
||||
case MP_BOTTOM_LEFT:
|
||||
{
|
||||
mX = rect.mLeft;
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public:
|
|||
typedef enum e_menu_position
|
||||
{
|
||||
MP_TOP_LEFT,
|
||||
MP_TOP_RIGHT,
|
||||
MP_BOTTOM_LEFT
|
||||
} EMenuPosition;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "llcombobox.h"
|
||||
#include "lldateutil.h" // ageFromDate()
|
||||
#include "llimview.h"
|
||||
#include "llmenubutton.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "lltexteditor.h"
|
||||
#include "lltexturectrl.h"
|
||||
|
|
@ -479,7 +480,6 @@ BOOL LLPanelAvatarProfile::postBuild()
|
|||
childSetCommitCallback("im",(boost::bind(&LLPanelAvatarProfile::onIMButtonClick,this)),NULL);
|
||||
childSetCommitCallback("call",(boost::bind(&LLPanelAvatarProfile::onCallButtonClick,this)),NULL);
|
||||
childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL);
|
||||
childSetCommitCallback("overflow_btn", boost::bind(&LLPanelAvatarProfile::onOverflowButtonClicked, this), NULL);
|
||||
childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL);
|
||||
childSetCommitCallback("show_on_map_btn", (boost::bind(
|
||||
&LLPanelAvatarProfile::onMapButtonClick, this)), NULL);
|
||||
|
|
@ -500,7 +500,8 @@ BOOL LLPanelAvatarProfile::postBuild()
|
|||
enable.add("Profile.EnableBlock", boost::bind(&LLPanelAvatarProfile::enableBlock, this));
|
||||
enable.add("Profile.EnableUnblock", boost::bind(&LLPanelAvatarProfile::enableUnblock, this));
|
||||
|
||||
mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
LLToggleableMenu* profile_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
getChild<LLMenuButton>("overflow_btn")->setMenu(profile_menu, LLMenuButton::MP_TOP_RIGHT);
|
||||
|
||||
LLVoiceClient::getInstance()->addObserver((LLVoiceClientStatusObserver*)this);
|
||||
|
||||
|
|
@ -752,23 +753,6 @@ void LLPanelAvatarProfile::onShareButtonClick()
|
|||
//*TODO not implemented
|
||||
}
|
||||
|
||||
void LLPanelAvatarProfile::onOverflowButtonClicked()
|
||||
{
|
||||
if (!mProfileMenu->toggleVisibility())
|
||||
return;
|
||||
|
||||
LLView* btn = getChild<LLView>("overflow_btn");
|
||||
|
||||
if (mProfileMenu->getButtonRect().isEmpty())
|
||||
{
|
||||
mProfileMenu->setButtonRect(btn);
|
||||
}
|
||||
mProfileMenu->updateParent(LLMenuGL::sMenuContainer);
|
||||
|
||||
LLRect rect = btn->getRect();
|
||||
LLMenuGL::showPopup(this, mProfileMenu, rect.mRight, rect.mTop);
|
||||
}
|
||||
|
||||
LLPanelAvatarProfile::~LLPanelAvatarProfile()
|
||||
{
|
||||
if(getAvatarId().notNull())
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
class LLComboBox;
|
||||
class LLLineEditor;
|
||||
class LLToggleableMenu;
|
||||
|
||||
enum EOnlineStatus
|
||||
{
|
||||
|
|
@ -207,14 +206,11 @@ protected:
|
|||
void onCallButtonClick();
|
||||
void onTeleportButtonClick();
|
||||
void onShareButtonClick();
|
||||
void onOverflowButtonClicked();
|
||||
|
||||
private:
|
||||
|
||||
typedef std::map< std::string,LLUUID> group_map_t;
|
||||
group_map_t mGroups;
|
||||
|
||||
LLToggleableMenu* mProfileMenu;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "llfiltereditor.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llmenubutton.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "lltabcontainer.h"
|
||||
#include "lltexteditor.h"
|
||||
|
|
@ -282,8 +283,8 @@ BOOL LLPanelPlaces::postBuild()
|
|||
mCloseBtn = getChild<LLButton>("close_btn");
|
||||
mCloseBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onBackButtonClicked, this));
|
||||
|
||||
mOverflowBtn = getChild<LLButton>("overflow_btn");
|
||||
mOverflowBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this));
|
||||
mOverflowBtn = getChild<LLMenuButton>("overflow_btn");
|
||||
mOverflowBtn->setMouseDownCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this));
|
||||
|
||||
mPlaceInfoBtn = getChild<LLButton>("profile_btn");
|
||||
mPlaceInfoBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onProfileButtonClicked, this));
|
||||
|
|
@ -783,16 +784,7 @@ void LLPanelPlaces::onOverflowButtonClicked()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!menu->toggleVisibility())
|
||||
return;
|
||||
|
||||
if (menu->getButtonRect().isEmpty())
|
||||
{
|
||||
menu->setButtonRect(mOverflowBtn);
|
||||
}
|
||||
menu->updateParent(LLMenuGL::sMenuContainer);
|
||||
LLRect rect = mOverflowBtn->getRect();
|
||||
LLMenuGL::showPopup(this, menu, rect.mRight, rect.mTop);
|
||||
mOverflowBtn->setMenu(menu, LLMenuButton::MP_TOP_RIGHT);
|
||||
}
|
||||
|
||||
void LLPanelPlaces::onProfileButtonClicked()
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class LLPlacesParcelObserver;
|
|||
class LLRemoteParcelInfoObserver;
|
||||
class LLTabContainer;
|
||||
class LLToggleableMenu;
|
||||
class LLMenuButton;
|
||||
|
||||
typedef std::pair<LLUUID, std::string> folder_pair_t;
|
||||
|
||||
|
|
@ -123,7 +124,7 @@ private:
|
|||
LLButton* mSaveBtn;
|
||||
LLButton* mCancelBtn;
|
||||
LLButton* mCloseBtn;
|
||||
LLButton* mOverflowBtn;
|
||||
LLMenuButton* mOverflowBtn;
|
||||
LLButton* mPlaceInfoBtn;
|
||||
|
||||
LLPlacesInventoryObserver* mInventoryObserver;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="Redigér" name="edit_btn" tool_tip="Redigér landemærke information"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Vis flere valg"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Vis flere valg"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<button label="Teleportér" name="teleport" tool_tip="Tilbyd teleport"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Betal eller del beholdning med denne beboer"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Betal eller del beholdning med denne beboer"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="Bearbeiten" name="edit_btn" tool_tip="Landmarken-Info bearbeiten"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Zusätzliche Optionen anzeigen"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Zusätzliche Optionen anzeigen"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
<button label="Teleportieren" name="teleport" tool_tip="Teleport anbieten"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Dem Einwohner Geld geben oder Inventar an den Einwohner schicken"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Dem Einwohner Geld geben oder Inventar an den Einwohner schicken"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ background_visible="true"
|
|||
user_resize="false"
|
||||
auto_resize="true"
|
||||
width="24">
|
||||
<button
|
||||
<menu_button
|
||||
follows="bottom|left|right"
|
||||
height="23"
|
||||
label="▼"
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@
|
|||
user_resize="false"
|
||||
auto_resize="false"
|
||||
width="24">
|
||||
<button
|
||||
<menu_button
|
||||
follows="bottom|left|right"
|
||||
height="23"
|
||||
label="▼"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="Editar" name="edit_btn" tool_tip="Editar la información del hito"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Ver más opciones"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Ver más opciones"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
<button label="Teleporte" name="teleport" tool_tip="Ofrecer teleporte"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Pagar dinero al Residente o compartir algo del inventario con él"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Pagar dinero al Residente o compartir algo del inventario con él"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="Modifier" name="edit_btn" tool_tip="Modifier les informations du repère"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Afficher d'autres options"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Afficher d'autres options"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
<button label="Téléporter" name="teleport" tool_tip="Proposer une téléportation"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Payer le résident ou partager l'inventaire avec lui"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Payer le résident ou partager l'inventaire avec lui"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="Modifica" name="edit_btn" tool_tip="Modifica le informazioni del punto di riferimento"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Mostra ulteriori opzioni"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Mostra ulteriori opzioni"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
<button label="Teleport" name="teleport" tool_tip="Offri teleport"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Paga del denaro o condividi qualcosa dall'inventario con il residente"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Paga del denaro o condividi qualcosa dall'inventario con il residente"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="編集" name="edit_btn" tool_tip="ランドマークの情報を編集します"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="オプションを表示します"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="オプションを表示します"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
<button label="テレポート" name="teleport" tool_tip="テレポートを送ります"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="住人にお金を渡すか持ち物を共有します"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="住人にお金を渡すか持ち物を共有します"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="Edytuj" name="edit_btn" tool_tip="Edytuj informacje landmarka"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Pokaż opcje dodatkowe"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Pokaż opcje dodatkowe"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<button label="Teleportuj" name="teleport" tool_tip="Teleportuj"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Zapłać lub udostępnij obiekt Rezydentowi"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Zapłać lub udostępnij obiekt Rezydentowi"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<button label="Editar" name="edit_btn" tool_tip="Editar dados do marco"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Mostrar opções adicionais"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Mostrar opções adicionais"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
<layout_stack name="bottom_bar_ls3">
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
<button label="Teletransportar" name="teleport" tool_tip="Oferecer teletransporte"/>
|
||||
</layout_panel>
|
||||
<layout_panel name="overflow_btn_lp">
|
||||
<button label="▼" name="overflow_btn" tool_tip="Pagar ou compartilhar inventário com o residente"/>
|
||||
<menu_button label="▼" name="overflow_btn" tool_tip="Pagar ou compartilhar inventário com o residente"/>
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue