From fef08c439ae7c8a310af444c10ab500bc8b14b79 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 19 Sep 2011 16:59:50 -0700 Subject: fix build --- indra/llui/lltoolbar.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 indra/llui/lltoolbar.h (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h new file mode 100644 index 0000000000..768f42309d --- /dev/null +++ b/indra/llui/lltoolbar.h @@ -0,0 +1,60 @@ +/** + * @file lltoolbar.h + * @author Richard Nelson + * @brief User customizable toolbar class + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLTOOLBAR_H +#define LL_LLTOOLBAR_H + +#include "lluictrl.h" +#include "lllayoutstack.h" +#include "llbutton.h" + +class LLToolBar +: public LLUICtrl +{ +public: + struct Params : public LLInitParam::Block + { + Mandatory orientation; + Multiple buttons; + + Params(); + }; + + void draw(); + +protected: + friend LLUICtrlFactory; + LLToolBar(const Params&); + void initFromParams(const Params&); + +private: + LLLayoutStack::ELayoutOrientation mOrientation; + LLLayoutStack* mStack; +}; + + +#endif // LL_LLTOOLBAR_H -- cgit v1.2.3 From 3df9545017a4835e162801d3e8a13d68c8bc44ad Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 19 Sep 2011 17:34:23 -0700 Subject: Fix gcc compiling error --- indra/llui/lltoolbar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 768f42309d..dd454e3f0b 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -47,7 +47,7 @@ public: void draw(); protected: - friend LLUICtrlFactory; + friend class LLUICtrlFactory; LLToolBar(const Params&); void initFromParams(const Params&); -- cgit v1.2.3 From 64f30a302dfbcaf56502676fa4b8d8a06f355b40 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 20 Sep 2011 16:37:21 -0700 Subject: EXP-1228 FIX Create toolbar widget class that displays list of buttons horizontally or vertically buttons are now centered and sized according to content created floater_test_toolbar.xml to test --- indra/llui/lltoolbar.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index dd454e3f0b..fb03095c56 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -32,28 +32,44 @@ #include "lllayoutstack.h" #include "llbutton.h" +class LLToolBarButton : public LLButton +{ +public: + struct Params : public LLInitParam::Block + { + }; + + LLToolBarButton(const Params& p) : LLButton(p) {} + +}; + class LLToolBar : public LLUICtrl { public: + struct Params : public LLInitParam::Block { - Mandatory orientation; - Multiple buttons; + Mandatory orientation; + Multiple buttons; Params(); }; - void draw(); + /*virtual*/ void draw(); protected: friend class LLUICtrlFactory; LLToolBar(const Params&); void initFromParams(const Params&); + void addButton(LLToolBarButton* buttonp); + void updateLayout(); private: - LLLayoutStack::ELayoutOrientation mOrientation; - LLLayoutStack* mStack; + LLLayoutStack::ELayoutOrientation mOrientation; + LLLayoutStack* mStack; + std::list mButtons; }; -- cgit v1.2.3 From 305b65f6f600b81de9a78e1246d2a5353cc3189b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 21 Sep 2011 12:11:23 -0700 Subject: EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars EXP-1210 FIX -- Implement new toybox floater window EXP-1231 FIX -- Add menu option to toggle the toybox floater on and off * Basic toybox floater implemented as its own class * Toybox is available through "Me -> Toolbars..." menu option or ctrl-T shortcut * Toolbars now have "side" type rather than simple orientation, as well as button state for "icons only" or "icons with text". Reviewed by Richard --- indra/llui/lltoolbar.h | 55 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index fb03095c56..60a848a6e3 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -32,6 +32,7 @@ #include "lllayoutstack.h" #include "llbutton.h" + class LLToolBarButton : public LLButton { public: @@ -40,9 +41,44 @@ public: }; LLToolBarButton(const Params& p) : LLButton(p) {} - }; + +namespace LLToolBarEnums +{ + enum ButtonType + { + BTNTYPE_ICONS_ONLY = 0, + BTNTYPE_ICONS_WITH_TEXT, + }; + + enum SideType + { + SIDE_NONE = 0, + SIDE_BOTTOM, + SIDE_LEFT, + SIDE_RIGHT, + SIDE_TOP, + }; +} + +// NOTE: This needs to occur before Param block declaration for proper compilation. +namespace LLInitParam +{ + template<> + struct TypeValues : public TypeValuesHelper + { + static void declareValues(); + }; + + template<> + struct TypeValues : public TypeValuesHelper + { + static void declareValues(); + }; +} + + class LLToolBar : public LLUICtrl { @@ -50,26 +86,29 @@ public: struct Params : public LLInitParam::Block { - Mandatory orientation; - Multiple buttons; + Mandatory button_display_mode; + Multiple buttons; + Mandatory side; Params(); }; - /*virtual*/ void draw(); + // virtuals + void draw(); protected: friend class LLUICtrlFactory; LLToolBar(const Params&); + void initFromParams(const Params&); void addButton(LLToolBarButton* buttonp); void updateLayout(); private: - LLLayoutStack::ELayoutOrientation mOrientation; - LLLayoutStack* mStack; - std::list mButtons; + std::list mButtons; + LLToolBarEnums::ButtonType mButtonType; + LLToolBarEnums::SideType mSideType; + LLLayoutStack* mStack; }; -- cgit v1.2.3 From 7e308b551c7fde9178e354dba005a5b35f793245 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 21 Sep 2011 18:48:39 -0700 Subject: EXP-1239 WIP make toolbars wrap when there is not enough room initial pass at wrapping --- indra/llui/lltoolbar.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 60a848a6e3..3a593e42d9 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -87,14 +87,25 @@ public: struct Params : public LLInitParam::Block { Mandatory button_display_mode; - Multiple buttons; Mandatory side; + Optional button_icon, + button_icon_and_text; + + Optional wrap; + Optional min_width, + max_width; + // get rid of this + Multiple buttons; + + Optional background_image; + Params(); }; // virtuals void draw(); + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); protected: friend class LLUICtrlFactory; @@ -105,10 +116,22 @@ protected: void updateLayout(); private: + void addRow(); + std::list mButtons; LLToolBarEnums::ButtonType mButtonType; + LLLayoutStack* mCenteringStack; + LLLayoutStack* mWrapStack; + LLLayoutPanel* mCenterPanel; LLToolBarEnums::SideType mSideType; - LLLayoutStack* mStack; + + std::vector mStacks; + bool mWrap; + bool mNeedsLayout; + S32 mMinWidth, + mMaxWidth; + + LLUIImagePtr mBackgroundImage; }; -- cgit v1.2.3 From 00f66ccf409b0f7fb974f23cd157cdd0b8a6ab96 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 22 Sep 2011 15:08:59 -0700 Subject: EXP-1239 WIP make toolbars wrap when there is not enough room added more toolbars to floater_test_toolbar.xml removed layout stack and got basic wrapping working reviewed by Leslie --- indra/llui/lltoolbar.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3a593e42d9..31729e32b4 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -93,8 +93,8 @@ public: button_icon_and_text; Optional wrap; - Optional min_width, - max_width; + Optional min_button_width, + max_button_width; // get rid of this Multiple buttons; @@ -112,11 +112,9 @@ protected: LLToolBar(const Params&); void initFromParams(const Params&); - void addButton(LLToolBarButton* buttonp); - void updateLayout(); private: - void addRow(); + void updateLayoutAsNeeded(); std::list mButtons; LLToolBarEnums::ButtonType mButtonType; @@ -125,11 +123,10 @@ private: LLLayoutPanel* mCenterPanel; LLToolBarEnums::SideType mSideType; - std::vector mStacks; bool mWrap; bool mNeedsLayout; - S32 mMinWidth, - mMaxWidth; + S32 mMinButtonWidth, + mMaxButtonWidth; LLUIImagePtr mBackgroundImage; }; -- cgit v1.2.3 From 565483ee1f2ea7b8d525c6d89700452216481c5e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 22 Sep 2011 15:43:08 -0700 Subject: EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars EXP-1233 PROGRESS -- Populate the toybox floater window with all FUI toolbar buttons EXP-1236 FIX -- The toybox floater should remember its position for the user * Basic addCommand function to the LLToolBar. Need proper implementation. * Added map for faster lookup of commands * Toybox now adds commands to its toolbar for basic button setup Reviewed by Richard. --- indra/llui/lltoolbar.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 31729e32b4..85cd6d5170 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -33,6 +33,9 @@ #include "llbutton.h" +class LLCommand; + + class LLToolBarButton : public LLButton { public: @@ -50,6 +53,8 @@ namespace LLToolBarEnums { BTNTYPE_ICONS_ONLY = 0, BTNTYPE_ICONS_WITH_TEXT, + + BTNTYPE_COUNT }; enum SideType @@ -107,6 +112,8 @@ public: void draw(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + bool addCommand(LLCommand * command); + protected: friend class LLUICtrlFactory; LLToolBar(const Params&); @@ -129,6 +136,8 @@ private: mMaxButtonWidth; LLUIImagePtr mBackgroundImage; + + LLToolBarButton::Params mButtonParams[LLToolBarEnums::BTNTYPE_COUNT]; }; -- cgit v1.2.3 From c155483fc206768e21d180fac9ccdd85db8f582e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 22 Sep 2011 17:34:42 -0700 Subject: EXP-1239 WIP make toolbars wrap when there is not enough room toolbar button height configured by button_height attribute vertical toolbar buttons now share common width wrap attribute now controls wrapping --- indra/llui/lltoolbar.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 31729e32b4..83e482a946 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -94,7 +94,8 @@ public: Optional wrap; Optional min_button_width, - max_button_width; + max_button_width, + button_height; // get rid of this Multiple buttons; @@ -115,6 +116,7 @@ protected: private: void updateLayoutAsNeeded(); + void resizeButtonsInRow(std::vector& buttons_in_row, S32 max_row_girth); std::list mButtons; LLToolBarEnums::ButtonType mButtonType; @@ -126,7 +128,8 @@ private: bool mWrap; bool mNeedsLayout; S32 mMinButtonWidth, - mMaxButtonWidth; + mMaxButtonWidth, + mButtonHeight; LLUIImagePtr mBackgroundImage; }; -- cgit v1.2.3 From b6d7f99f065c87f7409a1e5e1ba1b59f3f4a3efb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 23 Sep 2011 17:01:15 -0700 Subject: EXP-1239 FIX make toolbars wrap when there is not enough room spacing between buttons now configurable and correct background art now wraps buttons correctly created customizable panel for button background --- indra/llui/lltoolbar.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 9b08b26ce4..92c289cd3f 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -59,7 +59,6 @@ namespace LLToolBarEnums enum SideType { - SIDE_NONE = 0, SIDE_BOTTOM, SIDE_LEFT, SIDE_RIGHT, @@ -101,10 +100,16 @@ public: Optional min_button_width, max_button_width, button_height; + + Optional pad_left, + pad_top, + pad_right, + pad_bottom, + pad_between; // get rid of this Multiple buttons; - Optional background_image; + Optional button_panel; Params(); }; @@ -129,16 +134,19 @@ private: LLToolBarEnums::ButtonType mButtonType; LLLayoutStack* mCenteringStack; LLLayoutStack* mWrapStack; - LLLayoutPanel* mCenterPanel; + LLPanel* mButtonPanel; LLToolBarEnums::SideType mSideType; bool mWrap; bool mNeedsLayout; S32 mMinButtonWidth, mMaxButtonWidth, - mButtonHeight; - - LLUIImagePtr mBackgroundImage; + mButtonHeight, + mPadLeft, + mPadRight, + mPadTop, + mPadBottom, + mPadBetween; LLToolBarButton::Params mButtonParams[LLToolBarEnums::BTNTYPE_COUNT]; }; -- cgit v1.2.3 From 9da5a8d01085f13c0586bba4c818ed540335ae2e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 26 Sep 2011 14:34:42 -0700 Subject: EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars EXP-1233 PROGRESS -- Populate the toybox floater window with all FUI toolbar buttons EXP-1235 FIX -- Make the toybox available through the context menus associated with the other toolbars EXP-1248 FIX -- Implement context menu on toolbars * New commands are listed * Toolbars can now be made read-only (as in the toybox) or editable (as in the others) * Toolbars that are not read-only have a context menu that allows button type editing. Reviewed by Richard. --- indra/llui/lltoolbar.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 92c289cd3f..5028c39fb8 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -51,8 +51,8 @@ namespace LLToolBarEnums { enum ButtonType { - BTNTYPE_ICONS_ONLY = 0, - BTNTYPE_ICONS_WITH_TEXT, + BTNTYPE_ICONS_WITH_TEXT = 0, + BTNTYPE_ICONS_ONLY, BTNTYPE_COUNT }; @@ -96,7 +96,9 @@ public: Optional button_icon, button_icon_and_text; - Optional wrap; + Optional read_only, + wrap; + Optional min_button_width, max_button_width, button_height; @@ -116,6 +118,7 @@ public: // virtuals void draw(); + BOOL postBuild(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); bool addCommand(LLCommand * command); @@ -123,13 +126,20 @@ public: protected: friend class LLUICtrlFactory; LLToolBar(const Params&); + ~LLToolBar(); void initFromParams(const Params&); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + BOOL isSettingChecked(const LLSD& userdata); + void onSettingEnable(const LLSD& userdata); + private: void updateLayoutAsNeeded(); void resizeButtonsInRow(std::vector& buttons_in_row, S32 max_row_girth); + const bool mReadOnly; + std::list mButtons; LLToolBarEnums::ButtonType mButtonType; LLLayoutStack* mCenteringStack; @@ -149,6 +159,8 @@ private: mPadBetween; LLToolBarButton::Params mButtonParams[LLToolBarEnums::BTNTYPE_COUNT]; + + LLHandle mPopupMenuHandle; }; -- cgit v1.2.3 From bb1776de6865715b2dd96185140d35e46d63c837 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 26 Sep 2011 16:06:57 -0700 Subject: EXP-1207 : Introduced an hasCommand() method for toolbars and toolbar view --- indra/llui/lltoolbar.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 5028c39fb8..00e6ed131a 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -122,6 +122,7 @@ public: void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); bool addCommand(LLCommand * command); + bool hasCommand(const std::string& command_name); protected: friend class LLUICtrlFactory; -- cgit v1.2.3 From 53a486649381af53d21de28aced388bc2aacac0f Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 26 Sep 2011 17:38:10 -0700 Subject: EXP-1205 PROGRESS -- As a User, I want a toybox which will contain all buttons that I can d&d into the toolbars * Command buttons are now enabled/disabled in toybox based on whether or not the LLToolBarView has them anywhere. * Commands now have argument to specify whether or not they should be in the toybox. * LLCommandId is now used a universal reference for commands. Reviewed by Richard. --- indra/llui/lltoolbar.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 00e6ed131a..f7562b29d2 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -28,9 +28,10 @@ #ifndef LL_LLTOOLBAR_H #define LL_LLTOOLBAR_H -#include "lluictrl.h" -#include "lllayoutstack.h" #include "llbutton.h" +#include "llcommandmanager.h" +#include "lllayoutstack.h" +#include "lluictrl.h" class LLCommand; @@ -121,8 +122,9 @@ public: BOOL postBuild(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - bool addCommand(LLCommand * command); - bool hasCommand(const std::string& command_name); + bool addCommand(const LLCommandId& commandId); + bool hasCommand(const LLCommandId& commandId) const; + bool enableCommand(const LLCommandId& commandId, bool enabled); protected: friend class LLUICtrlFactory; @@ -142,6 +144,7 @@ private: const bool mReadOnly; std::list mButtons; + std::list mButtonCommands; LLToolBarEnums::ButtonType mButtonType; LLLayoutStack* mCenteringStack; LLLayoutStack* mWrapStack; -- cgit v1.2.3 From 7fd0e8c69e6dced4a770da4fac10c154eac5899f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 26 Sep 2011 18:51:43 -0700 Subject: fixed toolbar context menu deprecated pointless LLView::deleteViewByHandle --- indra/llui/lltoolbar.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index f7562b29d2..657e928319 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -119,8 +119,8 @@ public: // virtuals void draw(); - BOOL postBuild(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); bool addCommand(const LLCommandId& commandId); bool hasCommand(const LLCommandId& commandId) const; @@ -133,13 +133,12 @@ protected: void initFromParams(const Params&); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - BOOL isSettingChecked(const LLSD& userdata); - void onSettingEnable(const LLSD& userdata); - private: + void createContextMenu(); void updateLayoutAsNeeded(); void resizeButtonsInRow(std::vector& buttons_in_row, S32 max_row_girth); + BOOL isSettingChecked(const LLSD& userdata); + void onSettingEnable(const LLSD& userdata); const bool mReadOnly; @@ -164,7 +163,7 @@ private: LLToolBarButton::Params mButtonParams[LLToolBarEnums::BTNTYPE_COUNT]; - LLHandle mPopupMenuHandle; + LLHandle mPopupMenuHandle; }; -- cgit v1.2.3 From f56bf69dfed63d8b7d5d8994c0c3cafced803a0f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 26 Sep 2011 19:48:17 -0700 Subject: initial support for switching between icons only and icons + text --- indra/llui/lltoolbar.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 657e928319..75ae499a3d 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -32,9 +32,7 @@ #include "llcommandmanager.h" #include "lllayoutstack.h" #include "lluictrl.h" - - -class LLCommand; +#include "llcommandmanager.h" class LLToolBarButton : public LLButton @@ -110,7 +108,7 @@ public: pad_bottom, pad_between; // get rid of this - Multiple buttons; + Multiple commands; Optional button_panel; @@ -136,6 +134,7 @@ protected: private: void createContextMenu(); void updateLayoutAsNeeded(); + void createButtons(); void resizeButtonsInRow(std::vector& buttons_in_row, S32 max_row_girth); BOOL isSettingChecked(const LLSD& userdata); void onSettingEnable(const LLSD& userdata); -- cgit v1.2.3 From 78eb989e50e7f91298294d34a743f8ac0e3dcce1 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 27 Sep 2011 19:22:09 -0700 Subject: EXP-1258 FIX toggle buttons between icons and icons+text modes fixed button layout for icon only buttons --- indra/llui/lltoolbar.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 75ae499a3d..02db58128c 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -135,6 +135,7 @@ private: void createContextMenu(); void updateLayoutAsNeeded(); void createButtons(); + void createButton(const LLCommandId& id); void resizeButtonsInRow(std::vector& buttons_in_row, S32 max_row_girth); BOOL isSettingChecked(const LLSD& userdata); void onSettingEnable(const LLSD& userdata); -- cgit v1.2.3 From 15f3ea39d7deb0c956b56703a94f6d072b7f2d21 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 27 Sep 2011 22:45:09 -0700 Subject: EXP-1257 : Save toolbar settings in a per user toolbars.xml file --- indra/llui/lltoolbar.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 02db58128c..8e484c7e13 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -123,6 +123,7 @@ public: bool addCommand(const LLCommandId& commandId); bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); + command_id_list_t& getCommandsList() { return mButtonCommands; } protected: friend class LLUICtrlFactory; @@ -143,7 +144,7 @@ private: const bool mReadOnly; std::list mButtons; - std::list mButtonCommands; + command_id_list_t mButtonCommands; LLToolBarEnums::ButtonType mButtonType; LLLayoutStack* mCenteringStack; LLLayoutStack* mWrapStack; -- cgit v1.2.3 From 6a49f2947f05963c577a1644c16a8affc779da63 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 28 Sep 2011 16:25:32 -0700 Subject: EXP-1234 WIP experimental drag and drop --- indra/llui/lltoolbar.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 8e484c7e13..77bac87dbc 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -42,7 +42,15 @@ public: { }; - LLToolBarButton(const Params& p) : LLButton(p) {} + LLToolBarButton(const Params& p); + + BOOL handleMouseDown(S32 x, S32 y, MASK mask); + BOOL handleHover(S32 x, S32 y, MASK mask); + void setCommandId(const LLCommandId& id) { mId = id; } +private: + LLCommandId mId; + S32 mMouseDownX; + S32 mMouseDownY; }; @@ -125,6 +133,8 @@ public: bool enableCommand(const LLCommandId& commandId, bool enabled); command_id_list_t& getCommandsList() { return mButtonCommands; } + LLToolBarButton* createButton(const LLCommandId& id); + protected: friend class LLUICtrlFactory; LLToolBar(const Params&); @@ -136,7 +146,6 @@ private: void createContextMenu(); void updateLayoutAsNeeded(); void createButtons(); - void createButton(const LLCommandId& id); void resizeButtonsInRow(std::vector& buttons_in_row, S32 max_row_girth); BOOL isSettingChecked(const LLSD& userdata); void onSettingEnable(const LLSD& userdata); @@ -145,6 +154,9 @@ private: std::list mButtons; command_id_list_t mButtonCommands; + typedef std::map command_id_map; + command_id_map mButtonMap; + LLToolBarEnums::ButtonType mButtonType; LLLayoutStack* mCenteringStack; LLLayoutStack* mWrapStack; -- cgit v1.2.3 From b07e7c7198fbc78ca852b3ba48d516ec2901da21 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 29 Sep 2011 15:01:15 -0700 Subject: EXP-1211, EXP-1257 : Save and load the button type along with the toolbars, add a force default load option, enforce consistency between menus and toolbars --- indra/llui/lltoolbar.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 8e484c7e13..03b1756988 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -123,7 +123,6 @@ public: bool addCommand(const LLCommandId& commandId); bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); - command_id_list_t& getCommandsList() { return mButtonCommands; } protected: friend class LLUICtrlFactory; @@ -132,6 +131,13 @@ protected: void initFromParams(const Params&); +public: + // Methods used in loading and saving toolbar settings + void setButtonType(LLToolBarEnums::ButtonType button_type); + LLToolBarEnums::ButtonType getButtonType() { return mButtonType; } + command_id_list_t& getCommandsList() { return mButtonCommands; } + void clearCommandsList(); + private: void createContextMenu(); void updateLayoutAsNeeded(); -- cgit v1.2.3 From 63a8fce12b1e1c0d40d97e2f029776fed6e300fb Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 30 Sep 2011 18:51:17 -0700 Subject: made toolbars conform to visual specs added ability to specify clip rects in textures.xml --- indra/llui/lltoolbar.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 0bb95f4e9c..5d64630fa6 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -37,9 +37,20 @@ class LLToolBarButton : public LLButton { + friend class LLToolBar; public: struct Params : public LLInitParam::Block { + Optional min_button_width, + max_button_width, + desired_height; + + Params() + : min_button_width("min_button_width", 0), + max_button_width("max_button_width", S32_MAX), + desired_height("desired_height", 20) + {} + }; LLToolBarButton(const Params& p); @@ -51,6 +62,9 @@ private: LLCommandId mId; S32 mMouseDownX; S32 mMouseDownY; + S32 mMinWidth; + S32 mMaxWidth; + S32 mDesiredHeight; }; @@ -106,10 +120,6 @@ public: Optional read_only, wrap; - Optional min_button_width, - max_button_width, - button_height; - Optional pad_left, pad_top, pad_right, @@ -171,10 +181,7 @@ private: bool mWrap; bool mNeedsLayout; - S32 mMinButtonWidth, - mMaxButtonWidth, - mButtonHeight, - mPadLeft, + S32 mPadLeft, mPadRight, mPadTop, mPadBottom, -- cgit v1.2.3 From cd467cc34f876920b35d3570f50dbad54ce4a42c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 3 Oct 2011 16:27:24 -0700 Subject: EXP-1286 : First pass at Drag and Drop of tools. Not functional. Most hooks into the LLToolDragAndDrop system in to support the new AT_WIDGET and SOURCE_VIEWER --- indra/llui/lltoolbar.h | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 03b1756988..6dcf620861 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -33,7 +33,11 @@ #include "lllayoutstack.h" #include "lluictrl.h" #include "llcommandmanager.h" +#include "llassettype.h" +typedef boost::function startdrag_callback_t; +typedef boost::function handledrag_callback_t; +typedef boost::function handledrop_callback_t; class LLToolBarButton : public LLButton { @@ -42,7 +46,17 @@ public: { }; - LLToolBarButton(const Params& p) : LLButton(p) {} + LLToolBarButton(const Params& p); + + virtual BOOL handleHover( S32 x, S32 y, MASK mask ); + + void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } + void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } +protected: + bool mIsDragged; + startdrag_callback_t mStartDragItemCallback; + handledrag_callback_t mHandleDragItemCallback; + LLUUID mUUID; }; @@ -86,7 +100,6 @@ class LLToolBar : public LLUICtrl { public: - struct Params : public LLInitParam::Block { Mandatory button_display_mode; @@ -119,10 +132,18 @@ public: void draw(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - + virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + bool addCommand(const LLCommandId& commandId); bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); + void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } + void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } + void setHandleDropCallback(handledrop_callback_t cb) { mHandleDropCallback = cb; } protected: friend class LLUICtrlFactory; @@ -130,6 +151,10 @@ protected: ~LLToolBar(); void initFromParams(const Params&); + startdrag_callback_t mStartDragItemCallback; + handledrag_callback_t mHandleDragItemCallback; + handledrop_callback_t mHandleDropCallback; + bool mDragAndDropTarget; public: // Methods used in loading and saving toolbar settings @@ -147,6 +172,7 @@ private: BOOL isSettingChecked(const LLSD& userdata); void onSettingEnable(const LLSD& userdata); + LLUUID mUUID; const bool mReadOnly; std::list mButtons; -- cgit v1.2.3 From edacb7b3363dca6cd28a4ff7ea27154d6a30702f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 3 Oct 2011 18:52:22 -0700 Subject: implemented Range and ClampedValue classes to standardize min/max settings fixed not serializing named values when values provided from code --- indra/llui/lltoolbar.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 5d64630fa6..48ca6c62b3 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -41,13 +41,11 @@ class LLToolBarButton : public LLButton public: struct Params : public LLInitParam::Block { - Optional min_button_width, - max_button_width, - desired_height; + Optional > button_width; + Optional desired_height; Params() - : min_button_width("min_button_width", 0), - max_button_width("max_button_width", S32_MAX), + : button_width("button_width"), desired_height("desired_height", 20) {} @@ -62,8 +60,7 @@ private: LLCommandId mId; S32 mMouseDownX; S32 mMouseDownY; - S32 mMinWidth; - S32 mMaxWidth; + LLUI::Range mWidthRange; S32 mDesiredHeight; }; -- cgit v1.2.3 From a8fcfc5e19811ce579799d415a9ad63a0f1f6dc7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 4 Oct 2011 14:11:45 -0700 Subject: removed attempt at templating LLUI::Clamp values in order to get build working again --- indra/llui/lltoolbar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 407cbde7d2..3c317e10a2 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -45,7 +45,7 @@ class LLToolBarButton : public LLButton public: struct Params : public LLInitParam::Block { - Optional > button_width; + Optional button_width; Optional desired_height; Params() @@ -67,7 +67,7 @@ private: LLCommandId mId; S32 mMouseDownX; S32 mMouseDownY; - LLUI::Range mWidthRange; + LLUI::RangeS32 mWidthRange; S32 mDesiredHeight; bool mIsDragged; startdrag_callback_t mStartDragItemCallback; -- cgit v1.2.3 From 3b3a13707309eb4b7d6ed5d309081c99e5f28eca Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Oct 2011 11:18:17 -0700 Subject: EXP-1286 : DaD is functional though has bugs... Working on it... --- indra/llui/lltoolbar.h | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 10e5f49c0f..ddf2e048b6 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -35,9 +35,11 @@ #include "llcommandmanager.h" #include "llassettype.h" -typedef boost::function startdrag_callback_t; -typedef boost::function handledrag_callback_t; -typedef boost::function handledrop_callback_t; +class LLToolBar; + +typedef boost::function tool_startdrag_callback_t; +typedef boost::function tool_handledrag_callback_t; +typedef boost::function tool_handledrop_callback_t; class LLToolBarButton : public LLButton { @@ -63,8 +65,8 @@ public: BOOL handleHover(S32 x, S32 y, MASK mask); void setCommandId(const LLCommandId& id) { mId = id; } - void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } - void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } + void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } + void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } private: LLCommandId mId; S32 mMouseDownX; @@ -72,10 +74,9 @@ private: S32 mMinWidth; S32 mMaxWidth; S32 mDesiredHeight; - bool mIsDragged; - startdrag_callback_t mStartDragItemCallback; - handledrag_callback_t mHandleDragItemCallback; - LLUUID mUUID; + bool mIsDragged; + tool_startdrag_callback_t mStartDragItemCallback; + tool_handledrag_callback_t mHandleDragItemCallback; }; @@ -146,6 +147,7 @@ public: // virtuals void draw(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + int getRankFromPosition(S32 x, S32 y); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, @@ -153,12 +155,13 @@ public: EAcceptance* accept, std::string& tooltip_msg); - bool addCommand(const LLCommandId& commandId); + bool addCommand(const LLCommandId& commandId, int rank = -1); + bool removeCommand(const LLCommandId& commandId); bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); - void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } - void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } - void setHandleDropCallback(handledrop_callback_t cb) { mHandleDropCallback = cb; } + void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } + void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } + void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback = cb; } LLToolBarButton* createButton(const LLCommandId& id); @@ -168,10 +171,10 @@ protected: ~LLToolBar(); void initFromParams(const Params&); - startdrag_callback_t mStartDragItemCallback; - handledrag_callback_t mHandleDragItemCallback; - handledrop_callback_t mHandleDropCallback; - bool mDragAndDropTarget; + tool_startdrag_callback_t mStartDragItemCallback; + tool_handledrag_callback_t mHandleDragItemCallback; + tool_handledrop_callback_t mHandleDropCallback; + bool mDragAndDropTarget; public: // Methods used in loading and saving toolbar settings @@ -188,7 +191,6 @@ private: BOOL isSettingChecked(const LLSD& userdata); void onSettingEnable(const LLSD& userdata); - LLUUID mUUID; const bool mReadOnly; std::list mButtons; -- cgit v1.2.3 From 93e3c8e4a51dd60c202bc2e3f11b9ae850b2b6c8 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 5 Oct 2011 16:28:40 -0700 Subject: EXP-1280 FIX -- Minimized floaters associated with toolbar buttons should change the state of their parent button * Toolbar buttons now display green when its corresponding floater is open or minimized. * Made changes to buttons so flash time and rate is configurable * Removed unused "highlight_color" attribute from LLButton * Implemented "isVisible" function for toolbar button floaters. It returns true when the floater is visible or minimized. * Toolbar floater unminimize now also puts focus to the floater * All commands now specify their "is_running_function" for toolbar button state * ButtonFlashCount and ButtonFlashRate have been moved to button.xml settings and are now configurable on the button. Toolbar buttons are set to never flash and this functionality is used to show which buttons have windows open. * All toybox buttons show hover glow even when disabled Reviewed by Richard. --- indra/llui/lltoolbar.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3c317e10a2..b649ab28ff 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -56,6 +56,7 @@ public: }; LLToolBarButton(const Params& p); + ~LLToolBarButton(); BOOL handleMouseDown(S32 x, S32 y, MASK mask); BOOL handleHover(S32 x, S32 y, MASK mask); @@ -63,6 +64,9 @@ public: void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } + + void onMouseEnter(S32 x, S32 y, MASK mask); + private: LLCommandId mId; S32 mMouseDownX; @@ -73,6 +77,10 @@ private: startdrag_callback_t mStartDragItemCallback; handledrag_callback_t mHandleDragItemCallback; LLUUID mUUID; + + enable_signal_t* mIsEnabledSignal; + enable_signal_t* mIsRunningSignal; + enable_signal_t* mIsStartingSignal; }; @@ -153,6 +161,7 @@ public: bool addCommand(const LLCommandId& commandId); bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); + void setStartDragCallback(startdrag_callback_t cb) { mStartDragItemCallback = cb; } void setHandleDragCallback(handledrag_callback_t cb) { mHandleDragItemCallback = cb; } void setHandleDropCallback(handledrop_callback_t cb) { mHandleDropCallback = cb; } @@ -188,7 +197,8 @@ private: LLUUID mUUID; const bool mReadOnly; - std::list mButtons; + typedef std::list toolbar_button_list; + toolbar_button_list mButtons; command_id_list_t mButtonCommands; typedef std::map command_id_map; command_id_map mButtonMap; -- cgit v1.2.3 From 64d005bfed6c5adcd29df3ae0774747480a0d839 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 5 Oct 2011 17:04:07 -0700 Subject: EXP-1286 : Add DaD to toybox --- indra/llui/lltoolbar.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index a35f6d9db1..b630b82d0f 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -159,6 +159,7 @@ public: void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback = cb; } + bool isReadOnly() const { return mReadOnly; } LLToolBarButton* createButton(const LLCommandId& id); -- cgit v1.2.3 From 740b3547d6b4685bcd89bb2781ccb423ab935799 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 6 Oct 2011 16:48:19 -0700 Subject: EXP-1303 FIX Drag and dropping button over viewer area can select objects inworld fixed close button not working on floaters against right edge of window fixed drag and drop only working once per toolbar button reimplemented drag and drop threshold --- indra/llui/lltoolbar.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3fbe5a7703..4fac081130 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -68,6 +68,7 @@ public: void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } void onMouseEnter(S32 x, S32 y, MASK mask); + void onMouseCaptureLost(); private: LLCommandId mId; -- cgit v1.2.3 From 13a2431cb3ca24be1de51c041a046df6fe641b9e Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Fri, 7 Oct 2011 21:07:03 +0300 Subject: EXP-1255 FIXED (More spillover does not contain separator and "Open Landmarks" menuitem) - Added menu item "Open landmarks" as the last menu item in favorites menu --- indra/llui/lltoolbar.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 4fac081130..e4534dea5f 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -173,6 +173,8 @@ public: LLToolBarButton* createButton(const LLCommandId& id); + bool hasButtons() { return !mButtons.empty(); } + protected: friend class LLUICtrlFactory; LLToolBar(const Params&); -- cgit v1.2.3 From feabe29f356ca2bae5275a5cb0d772614166d2c5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 7 Oct 2011 18:30:57 -0700 Subject: EXP-1300 : Completed the drawing of drop zones on toolbars when dragging tools --- indra/llui/lltoolbar.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 4fac081130..be0589f3c6 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -141,7 +141,8 @@ public: pad_top, pad_right, pad_bottom, - pad_between; + pad_between, + min_girth; // get rid of this Multiple commands; @@ -219,7 +220,8 @@ private: mPadRight, mPadTop, mPadBottom, - mPadBetween; + mPadBetween, + mMinGirth; LLToolBarButton::Params mButtonParams[LLToolBarEnums::BTNTYPE_COUNT]; -- cgit v1.2.3 From ec5ea33c8113a63e956c195ccf051b2a03979be9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 9 Oct 2011 15:52:45 -0700 Subject: EXP-1300 : drop tool animation. First shot. Works but still a bit hacky and with some bugs (tools can be duplicated at times). --- indra/llui/lltoolbar.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index be0589f3c6..9e48dee608 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -184,6 +184,8 @@ protected: tool_handledrag_callback_t mHandleDragItemCallback; tool_handledrop_callback_t mHandleDropCallback; bool mDragAndDropTarget; + int mRank; + LLCommandId mDraggedCommand; public: // Methods used in loading and saving toolbar settings @@ -205,7 +207,7 @@ private: typedef std::list toolbar_button_list; toolbar_button_list mButtons; command_id_list_t mButtonCommands; - typedef std::map command_id_map; + typedef std::map command_id_map; command_id_map mButtonMap; LLToolBarEnums::ButtonType mButtonType; -- cgit v1.2.3 From da3c7da7a585ea14a5a494ac7f36e7714bc86ab8 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 10 Oct 2011 15:04:00 -0700 Subject: side toolbar buttons are now squares again --- indra/llui/lltoolbar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 9e48dee608..84fa7ec0df 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -47,8 +47,8 @@ class LLToolBarButton : public LLButton public: struct Params : public LLInitParam::Block { - Optional button_width; - Optional desired_height; + Optional button_width; + Optional desired_height; Params() : button_width("button_width"), -- cgit v1.2.3 From 6a570a9bdc2660e4db87e8e7a65b724e1ad8d1b2 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 10 Oct 2011 17:52:37 -0700 Subject: fixed icons moving when clicking on icon-only toolbars --- indra/llui/lltoolbar.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 84fa7ec0df..a81a5fdb39 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -62,6 +62,8 @@ public: BOOL handleMouseDown(S32 x, S32 y, MASK mask); BOOL handleHover(S32 x, S32 y, MASK mask); + void reshape(S32 width, S32 height, BOOL called_from_parent = true); + void setCommandId(const LLCommandId& id) { mId = id; } void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } -- cgit v1.2.3 From 1478f22857c24f4f3ecfcf7a08fdd4d5392ee3e6 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 10 Oct 2011 18:00:24 -0700 Subject: EXP-1300 : Simplify and clean up of the DaD which now doesn't duplicate the dragged tool. --- indra/llui/lltoolbar.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 84fa7ec0df..56bc8b9bb3 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -47,8 +47,8 @@ class LLToolBarButton : public LLButton public: struct Params : public LLInitParam::Block { - Optional button_width; - Optional desired_height; + Optional button_width; + Optional desired_height; Params() : button_width("button_width"), @@ -161,9 +161,11 @@ public: void* cargo_data, EAcceptance* accept, std::string& tooltip_msg); + + static const int RANK_NONE = -1; - bool addCommand(const LLCommandId& commandId, int rank = -1); - bool removeCommand(const LLCommandId& commandId); + bool addCommand(const LLCommandId& commandId, int rank = RANK_NONE); + int removeCommand(const LLCommandId& commandId); // Returns the rank the removed command was at, RANK_NONE if not found bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); @@ -184,8 +186,6 @@ protected: tool_handledrag_callback_t mHandleDragItemCallback; tool_handledrop_callback_t mHandleDropCallback; bool mDragAndDropTarget; - int mRank; - LLCommandId mDraggedCommand; public: // Methods used in loading and saving toolbar settings -- cgit v1.2.3 From fd1a688f463703ec78a399b35fed19b3d907c91b Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 10 Oct 2011 19:21:01 -0700 Subject: fixed bad merge --- indra/llui/lltoolbar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index ca04a0e5d5..321064a0fd 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -47,8 +47,8 @@ class LLToolBarButton : public LLButton public: struct Params : public LLInitParam::Block { - Optional button_width; - Optional desired_height; + Optional button_width; + Optional desired_height; Params() : button_width("button_width"), -- cgit v1.2.3 From 3596c0f7e139724f31258ffb96157146aeba77b1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 11 Oct 2011 15:06:16 -0700 Subject: EXP-1300 : Implemented carets for DaD. Works with small bugs but OK for demo. Still in need of some cleanup --- indra/llui/lltoolbar.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index ca04a0e5d5..f3457028e7 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -156,7 +156,7 @@ public: // virtuals void draw(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - int getRankFromPosition(S32 x, S32 y); + int getRankFromPosition(S32& x, S32& y); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, @@ -188,6 +188,9 @@ protected: tool_handledrag_callback_t mHandleDragItemCallback; tool_handledrop_callback_t mHandleDropCallback; bool mDragAndDropTarget; + int mDragRank; + S32 mDragx, + mDragy; public: // Methods used in loading and saving toolbar settings @@ -217,7 +220,7 @@ private: LLLayoutStack* mWrapStack; LLPanel* mButtonPanel; LLToolBarEnums::SideType mSideType; - + bool mWrap; bool mNeedsLayout; S32 mPadLeft, -- cgit v1.2.3 From 20358ea89dc9823ac0b539030fdf03268dbdf4e9 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 12 Oct 2011 17:45:21 -0700 Subject: * Added mModified flag and isModified() query to check it. (currently it is not connect to actual data) --- indra/llui/lltoolbar.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 709399c59f..2c66f29c16 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -178,7 +178,8 @@ public: LLToolBarButton* createButton(const LLCommandId& id); - bool hasButtons() { return !mButtons.empty(); } + bool hasButtons() const { return !mButtons.empty(); } + bool isModified() const { return mModified; } protected: friend class LLUICtrlFactory; @@ -225,6 +226,7 @@ private: bool mWrap; bool mNeedsLayout; + bool mModified; S32 mPadLeft, mPadRight, mPadTop, -- cgit v1.2.3 From aa1f0215c764fa346625ace43c467a0e0f803057 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 12 Oct 2011 18:01:50 -0700 Subject: EXP-1331 : Implement new longer caret and make it work on multi lines or columns of tools. EXP-1304 : handle only tools in DaD on toolbars --- indra/llui/lltoolbar.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 709399c59f..8fd509bacc 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -156,7 +156,7 @@ public: // virtuals void draw(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - int getRankFromPosition(S32& x, S32& y); + int getRankFromPosition(S32 x, S32 y); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, @@ -192,7 +192,9 @@ protected: bool mDragAndDropTarget; int mDragRank; S32 mDragx, - mDragy; + mDragy, + mDragGirth; + LLCommandId mDragCommand; public: // Methods used in loading and saving toolbar settings -- cgit v1.2.3 From 9206226a377c88d34036ebd8a3ac6d9d55bc4146 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 12 Oct 2011 18:16:59 -0700 Subject: tooltips now only show labels for toolbar buttons when label is hidden or truncated tooltips are no longer instantaneous once a tooltip is visible --- indra/llui/lltoolbar.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 709399c59f..72fc5630bc 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -72,6 +72,10 @@ public: void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseCaptureLost(); + virtual const std::string getToolTip() const; + + + private: LLCommandId mId; S32 mMouseDownX; -- cgit v1.2.3 From c14aa1b64e1190ff4bd7deef864d5393988e7f91 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 12 Oct 2011 19:48:13 -0700 Subject: EXP-1331 : Avoid showing the caret if the tool is dragged over itself --- indra/llui/lltoolbar.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 7f8ae4f839..49750a9ac2 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -157,6 +157,7 @@ public: void draw(); void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); int getRankFromPosition(S32 x, S32 y); + int getRankFromPosition(const LLCommandId& id); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, -- cgit v1.2.3 From 4c6f04c50225a4a5494974c3a6e13bee76cfbb6f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 14 Oct 2011 16:47:43 -0700 Subject: EXP-1363 : Fix caret position in multiple lines or columns situation --- indra/llui/lltoolbar.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3be252298d..e78c99cb37 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -200,7 +200,6 @@ protected: S32 mDragx, mDragy, mDragGirth; - LLCommandId mDragCommand; public: // Methods used in loading and saving toolbar settings -- cgit v1.2.3 From 0976964f8315aab5879678f07318267b6887ed95 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 14 Oct 2011 18:25:30 -0700 Subject: EXP-1336 FIX Move Notifications to upper right also made toolbar buttons not trigger if enabled callback returns false --- indra/llui/lltoolbar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 3be252298d..5fac613f50 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -72,9 +72,9 @@ public: void onMouseEnter(S32 x, S32 y, MASK mask); void onMouseCaptureLost(); - virtual const std::string getToolTip() const; - + void onCommit(); + virtual const std::string getToolTip() const; private: LLCommandId mId; -- cgit v1.2.3 From 6d1ae4e0d6668983dc9386903155e426bd2912a3 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Sun, 16 Oct 2011 23:37:55 -0700 Subject: wip on dragging disabled toolbar buttons --- indra/llui/lltoolbar.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index f7ec318652..47af039d52 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -48,7 +48,7 @@ public: struct Params : public LLInitParam::Block { Optional button_width; - Optional desired_height; + Optional desired_height; Params() : button_width("button_width"), @@ -63,7 +63,7 @@ public: BOOL handleMouseDown(S32 x, S32 y, MASK mask); BOOL handleHover(S32 x, S32 y, MASK mask); void reshape(S32 width, S32 height, BOOL called_from_parent = true); - + void setEnabled(BOOL enabled); void setCommandId(const LLCommandId& id) { mId = id; } void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } @@ -89,6 +89,13 @@ private: enable_signal_t* mIsEnabledSignal; enable_signal_t* mIsRunningSignal; enable_signal_t* mIsStartingSignal; + LLPointer mOriginalImageSelected, + mOriginalImageUnselected, + mOriginalImagePressed, + mOriginalImagePressedSelected; + LLUIColor mOriginalLabelColor, + mOriginalLabelColorSelected, + mOriginalImageOverlayColor; }; -- cgit v1.2.3 From a2e32429bbe222342c413eb06e2820f6292e251a Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 17 Oct 2011 13:42:35 -0700 Subject: fix for not being able to drag disabled buttons --- indra/llui/lltoolbar.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/llui/lltoolbar.h') diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 47af039d52..616710ea70 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -77,6 +77,8 @@ public: virtual const std::string getToolTip() const; private: + void callIfEnabled(LLUICtrl::commit_callback_t commit, LLUICtrl* ctrl, const LLSD& param ); + LLCommandId mId; S32 mMouseDownX; S32 mMouseDownY; @@ -95,7 +97,8 @@ private: mOriginalImagePressedSelected; LLUIColor mOriginalLabelColor, mOriginalLabelColorSelected, - mOriginalImageOverlayColor; + mOriginalImageOverlayColor, + mOriginalImageOverlaySelectedColor; }; -- cgit v1.2.3