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/newview/lltoolbarview.h | 102 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 indra/newview/lltoolbarview.h (limited to 'indra/newview/lltoolbarview.h') diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h new file mode 100644 index 0000000000..4e1b855e3d --- /dev/null +++ b/indra/newview/lltoolbarview.h @@ -0,0 +1,102 @@ +/** + * @file lltoolbarview.h + * @author Merov Linden + * @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_LLTOOLBARVIEW_H +#define LL_LLTOOLBARVIEW_H + +#include "lluictrl.h" +#include "lltoolbar.h" +#include "llcommandmanager.h" + +class LLUICtrlFactory; + +// Parent of all LLToolBar + +class LLToolBarView : public LLUICtrl +{ +public: + // Xui structure of the toolbar panel + struct Params : public LLInitParam::Block {}; + + // Note: valid children for LLToolBarView are stored in this registry + typedef LLDefaultChildRegistry child_registry_t; + + // Xml structure of the toolbars.xml setting + // Those live in a toolbars.xml found in app_settings (for the default) and in + // the user folder for the user specific (saved) settings + struct Toolbar : public LLInitParam::Block + { + Mandatory button_display_mode; + Multiple commands; + Toolbar(); + }; + struct ToolbarSet : public LLInitParam::Block + { + Optional left_toolbar, + right_toolbar, + bottom_toolbar; + ToolbarSet(); + }; + + // Derived methods + virtual ~LLToolBarView(); + virtual BOOL postBuild(); + virtual void draw(); + + // Toolbar view interface with the rest of the world + // Checks if the commandId is being used somewhere in one of the toolbars + bool hasCommand(const LLCommandId& commandId) const; + // Loads the toolbars from the existing user or default settings + bool loadToolbars(bool force_default = false); // return false if load fails + bool loadDefaultToolbars() { return loadToolbars(true); } + + static void startDragItem( S32 x, S32 y, const LLUUID& uuid); + static BOOL handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); + static BOOL handleDrop( EDragAndDropType cargo_type, void* cargo_data, const LLUUID& folder_id); + +protected: + friend class LLUICtrlFactory; + LLToolBarView(const Params&); + + void initFromParams(const Params&); + +private: + void saveToolbars() const; + bool addCommand(const LLCommandId& commandId, LLToolBar* toolbar); + void addToToolset(command_id_list_t& command_list, Toolbar& toolbar) const; + + // Pointers to the toolbars handled by the toolbar view + LLToolBar* mToolbarLeft; + LLToolBar* mToolbarRight; + LLToolBar* mToolbarBottom; + + static bool sDragStarted; +}; + +extern LLToolBarView* gToolBarView; + +#endif // LL_LLTOOLBARVIEW_H -- 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/newview/lltoolbarview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltoolbarview.h') diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index b7d3a4033a..3d488f837f 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -76,7 +76,7 @@ public: static void startDragItem( S32 x, S32 y, const LLUUID& uuid); static BOOL handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); - static BOOL handleDrop( EDragAndDropType cargo_type, void* cargo_data, const LLUUID& folder_id); + static BOOL handleDrop( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); protected: friend class LLUICtrlFactory; -- 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/newview/lltoolbarview.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/lltoolbarview.h') diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 414fcd8751..a0c526ac54 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -74,9 +74,10 @@ public: static bool loadDefaultToolbars(); - static void startDragItem( S32 x, S32 y, const LLUUID& uuid); - static BOOL handleDragItem( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); - static BOOL handleDrop( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); + static void startDragTool( S32 x, S32 y, const LLUUID& uuid); + static BOOL handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); + static BOOL handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); + static void stopDragTool(); protected: friend class LLUICtrlFactory; -- 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/newview/lltoolbarview.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/lltoolbarview.h') diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index a0c526ac54..6623e63f8a 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -78,6 +78,7 @@ public: static BOOL handleDragTool( S32 x, S32 y, const LLUUID& uuid, LLAssetType::EType type); static BOOL handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); static void stopDragTool(); + void onEndDrag(); protected: friend class LLUICtrlFactory; @@ -94,12 +95,11 @@ private: LLToolBar* mToolbarLeft; LLToolBar* mToolbarRight; LLToolBar* mToolbarBottom; - bool mDragging; - LLToolBarButton* mDragButton; - S32 mMouseX; - S32 mMouseY; - static bool sDragStarted; + LLCommandId mDragCommand; + int mDragRank; + LLToolBar* mDragToolbar; + bool mDragStarted; }; extern LLToolBarView* gToolBarView; -- cgit v1.2.3 From d0cda13235079c6626ebc7bbe4de542784d50fa0 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 11 Oct 2011 22:49:00 -0700 Subject: EXP-1275 FIX A UI element or Keyboard shortcut to clear the viewport Ctrl+Shift+U now toggles UI and hides floaters refactored main_view.xml made all members of llviewerwindow private --- indra/newview/lltoolbarview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/lltoolbarview.h') diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 6623e63f8a..01ff137c15 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -72,6 +72,8 @@ public: // Loads the toolbars from the existing user or default settings bool loadToolbars(bool force_default = false); // return false if load fails + void setToolBarsVisible(bool visible); + static bool loadDefaultToolbars(); static void startDragTool( S32 x, S32 y, const LLUUID& uuid); -- 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/newview/lltoolbarview.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/lltoolbarview.h') diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index 01ff137c15..8b3af43875 100644 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -81,6 +81,8 @@ public: static BOOL handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* toolbar); static void stopDragTool(); void onEndDrag(); + + bool isModified() const; protected: friend class LLUICtrlFactory; -- cgit v1.2.3