diff options
Diffstat (limited to 'indra')
24 files changed, 35 insertions, 54 deletions
diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index ac568a83e4..eed0085273 100644 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -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; diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 9e91b9e99d..7b657595da 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -47,6 +47,7 @@ public: typedef enum e_menu_position { MP_TOP_LEFT, + MP_TOP_RIGHT, MP_BOTTOM_LEFT } EMenuPosition; diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 57180f63b5..1249d5d856 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -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()) diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 11c7716322..71d9d0a95a 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -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; }; /** diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index f0e60386b6..c524fd7059 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -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() diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index c3b2ab806f..5523122a0f 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -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; diff --git a/indra/newview/skins/default/xui/da/panel_places.xml b/indra/newview/skins/default/xui/da/panel_places.xml index ca3d7c71bb..fe8ca69f34 100644 --- a/indra/newview/skins/default/xui/da/panel_places.xml +++ b/indra/newview/skins/default/xui/da/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/da/panel_profile.xml b/indra/newview/skins/default/xui/da/panel_profile.xml index b2d1e9791a..b8b99a9c21 100644 --- a/indra/newview/skins/default/xui/da/panel_profile.xml +++ b/indra/newview/skins/default/xui/da/panel_profile.xml @@ -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> diff --git a/indra/newview/skins/default/xui/de/panel_places.xml b/indra/newview/skins/default/xui/de/panel_places.xml index 0e85829a0b..36c77d4fe1 100644 --- a/indra/newview/skins/default/xui/de/panel_places.xml +++ b/indra/newview/skins/default/xui/de/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/de/panel_profile.xml b/indra/newview/skins/default/xui/de/panel_profile.xml index 40fa2f922a..938631f65d 100644 --- a/indra/newview/skins/default/xui/de/panel_profile.xml +++ b/indra/newview/skins/default/xui/de/panel_profile.xml @@ -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> diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 21314703b0..d9c357f277 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -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="▼" diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index efc37c2127..7caf425058 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -432,7 +432,7 @@ user_resize="false" auto_resize="false" width="24"> - <button + <menu_button follows="bottom|left|right" height="23" label="▼" diff --git a/indra/newview/skins/default/xui/es/panel_places.xml b/indra/newview/skins/default/xui/es/panel_places.xml index 2e349c7fe2..4c90a7e6b4 100644 --- a/indra/newview/skins/default/xui/es/panel_places.xml +++ b/indra/newview/skins/default/xui/es/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/es/panel_profile.xml b/indra/newview/skins/default/xui/es/panel_profile.xml index 5cfe83cd61..339a1f236b 100644 --- a/indra/newview/skins/default/xui/es/panel_profile.xml +++ b/indra/newview/skins/default/xui/es/panel_profile.xml @@ -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> diff --git a/indra/newview/skins/default/xui/fr/panel_places.xml b/indra/newview/skins/default/xui/fr/panel_places.xml index 7f3601b90d..e252c224f8 100644 --- a/indra/newview/skins/default/xui/fr/panel_places.xml +++ b/indra/newview/skins/default/xui/fr/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/fr/panel_profile.xml b/indra/newview/skins/default/xui/fr/panel_profile.xml index 4606f5a0c6..6b611923af 100644 --- a/indra/newview/skins/default/xui/fr/panel_profile.xml +++ b/indra/newview/skins/default/xui/fr/panel_profile.xml @@ -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> diff --git a/indra/newview/skins/default/xui/it/panel_places.xml b/indra/newview/skins/default/xui/it/panel_places.xml index e33f8190eb..61830f186f 100644 --- a/indra/newview/skins/default/xui/it/panel_places.xml +++ b/indra/newview/skins/default/xui/it/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/it/panel_profile.xml b/indra/newview/skins/default/xui/it/panel_profile.xml index 8a8d8f5846..c11adeda3d 100644 --- a/indra/newview/skins/default/xui/it/panel_profile.xml +++ b/indra/newview/skins/default/xui/it/panel_profile.xml @@ -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> diff --git a/indra/newview/skins/default/xui/ja/panel_places.xml b/indra/newview/skins/default/xui/ja/panel_places.xml index 3e364c9b3a..e19b86e552 100644 --- a/indra/newview/skins/default/xui/ja/panel_places.xml +++ b/indra/newview/skins/default/xui/ja/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/ja/panel_profile.xml b/indra/newview/skins/default/xui/ja/panel_profile.xml index 860020c87c..c2ffd74ec0 100644 --- a/indra/newview/skins/default/xui/ja/panel_profile.xml +++ b/indra/newview/skins/default/xui/ja/panel_profile.xml @@ -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> diff --git a/indra/newview/skins/default/xui/pl/panel_places.xml b/indra/newview/skins/default/xui/pl/panel_places.xml index e0a0cfd96a..34c105225d 100644 --- a/indra/newview/skins/default/xui/pl/panel_places.xml +++ b/indra/newview/skins/default/xui/pl/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/pl/panel_profile.xml b/indra/newview/skins/default/xui/pl/panel_profile.xml index f4a5699f8d..4152c00386 100644 --- a/indra/newview/skins/default/xui/pl/panel_profile.xml +++ b/indra/newview/skins/default/xui/pl/panel_profile.xml @@ -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> diff --git a/indra/newview/skins/default/xui/pt/panel_places.xml b/indra/newview/skins/default/xui/pt/panel_places.xml index 2e443bc057..828ef3e469 100644 --- a/indra/newview/skins/default/xui/pt/panel_places.xml +++ b/indra/newview/skins/default/xui/pt/panel_places.xml @@ -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"> diff --git a/indra/newview/skins/default/xui/pt/panel_profile.xml b/indra/newview/skins/default/xui/pt/panel_profile.xml index e4200ae5da..f984ed6a7b 100644 --- a/indra/newview/skins/default/xui/pt/panel_profile.xml +++ b/indra/newview/skins/default/xui/pt/panel_profile.xml @@ -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> |