More pie menu cleanup and added NiranV Dean's outer ring sub menu visualisation

Tue, 10 May 2016 11:44:34 +0200

author
Ansariel
date
Tue, 10 May 2016 11:44:34 +0200
changeset 48983
86bef9351d98
parent 48982
d551525e7b36
child 48984
2b552a915591

More pie menu cleanup and added NiranV Dean's outer ring sub menu visualisation

indra/newview/piemenu.cpp file | annotate | diff | revisions
indra/newview/pieslice.cpp file | annotate | diff | revisions
indra/newview/pieslice.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/piemenu.cpp	Tue May 10 10:46:17 2016 +0200
     1.2 +++ b/indra/newview/piemenu.cpp	Tue May 10 11:44:34 2016 +0200
     1.3 @@ -33,10 +33,8 @@
     1.4  #include "llviewercontrol.h"
     1.5  #include "llviewerwindow.h"
     1.6  
     1.7 -const S32 PIE_INNER_SIZE = 20;			// radius of the inner pie circle
     1.8 -const F32 PIE_POPUP_FACTOR = 1.7f;		// pie menu size factor on popup
     1.9 -const F32 PIE_POPUP_TIME = 0.25f;		// time to shrink from popup size to regular size
    1.10 -const S32 PIE_OUTER_SIZE = 96;			// radius of the outer pie circle
    1.11 +#define PIE_POPUP_EFFECT 1			// debug
    1.12 +#define PIE_DRAW_BOUNDING_BOX 0		// debug
    1.13  
    1.14  // register the pie menu globally as child widget
    1.15  static LLDefaultChildRegistry::Register<PieMenu> r1("pie_menu");
    1.16 @@ -46,13 +44,16 @@
    1.17  static PieChildRegistry::Register<PieSlice> pie_r2("pie_slice");
    1.18  static PieChildRegistry::Register<PieSeparator> pie_r3("pie_separator");
    1.19  
    1.20 -#define PIE_POPUP_EFFECT 1			// debug
    1.21 -#define PIE_DRAW_BOUNDING_BOX 0		// debug
    1.22 -
    1.23  // pie slice label text positioning
    1.24  const S32 PIE_X[] = {64, 45,  0, -45, -63, -45,   0,  45};
    1.25  const S32 PIE_Y[] = { 0, 44, 73,  44,   0, -44, -73, -44};
    1.26  
    1.27 +const S32 PIE_INNER_SIZE = 20;				// radius of the inner pie circle
    1.28 +const F32 PIE_POPUP_FACTOR = 1.7f;			// pie menu size factor on popup
    1.29 +const F32 PIE_POPUP_TIME = 0.25f;			// time to shrink from popup size to regular size
    1.30 +const S32 PIE_OUTER_SIZE = 96;				// radius of the outer pie circle
    1.31 +const F32 PIE_OUTER_SHADE_FACTOR = 1.09f;	// size factor of the outer shading ring
    1.32 +
    1.33  PieMenu::PieMenu(const LLMenuGL::Params& p) :
    1.34  	LLMenuGL(p),
    1.35  	mCurrentSegment(-1)
    1.36 @@ -347,7 +348,7 @@
    1.37  				currentSlice->setEnabled(slice_visible);
    1.38  				if (!slice_visible)
    1.39  				{
    1.40 -				//	LL_DEBUGS("Pie") << label << " is not visible" << LL_ENDL;
    1.41 +					//LL_DEBUGS("Pie") << label << " is not visible" << LL_ENDL;
    1.42  					label = "";
    1.43  				}
    1.44  
    1.45 @@ -400,7 +401,7 @@
    1.46  				currentSlice->updateEnabled();
    1.47  				if (!currentSlice->getEnabled())
    1.48  				{
    1.49 -					LL_DEBUGS("Pie") << label << " is disabled" << LL_ENDL;
    1.50 +					//LL_DEBUGS("Pie") << label << " is disabled" << LL_ENDL;
    1.51  					// fade the item color alpha to mark the item as disabled
    1.52  					itemColor %= 0.3f;
    1.53  				}
    1.54 @@ -409,6 +410,7 @@
    1.55  			else if (currentSubmenu)
    1.56  			{
    1.57  				label = currentSubmenu->getLabel();
    1.58 +				gl_washer_segment_2d(PIE_OUTER_SIZE * PIE_OUTER_SHADE_FACTOR * factor, PIE_OUTER_SIZE * factor, segmentStart + 0.02f, segmentStart + F_PI / 4.f - 0.02f, steps / 8, selectedColor, selectedColor);
    1.59  			}
    1.60  
    1.61  			// if it's a slice or submenu, the mouse pointer is over the same segment as our counter and the item is enabled
    1.62 @@ -455,6 +457,7 @@
    1.63  	if (!mFirstClick)
    1.64  	{
    1.65  		gl_washer_2d(PIE_OUTER_SIZE * factor, PIE_OUTER_SIZE * factor - 2.f, steps, lineColor, borderColor);
    1.66 +		gl_washer_2d(PIE_OUTER_SIZE * PIE_OUTER_SHADE_FACTOR * factor, PIE_OUTER_SIZE * factor - 2.f, steps, lineColor, borderColor);
    1.67  	}
    1.68  	gl_washer_2d(PIE_INNER_SIZE + 1, PIE_INNER_SIZE - 1, steps, borderColor, lineColor);
    1.69  
    1.70 @@ -589,7 +592,7 @@
    1.71  			factor = PIE_POPUP_FACTOR - (PIE_POPUP_FACTOR - 1.f) * elapsedTime / PIE_POPUP_TIME;
    1.72  		}
    1.73  	}
    1.74 +#endif
    1.75  
    1.76 -#endif
    1.77  	return factor;
    1.78  }
     2.1 --- a/indra/newview/pieslice.cpp	Tue May 10 10:46:17 2016 +0200
     2.2 +++ b/indra/newview/pieslice.cpp	Tue May 10 11:44:34 2016 +0200
     2.3 @@ -135,7 +135,7 @@
     2.4  }
     2.5  
     2.6  // accessor
     2.7 -void PieSlice::setLabel(const std::string newLabel)
     2.8 +void PieSlice::setLabel(const std::string& newLabel)
     2.9  {
    2.10  	mLabel = newLabel;
    2.11  }
     3.1 --- a/indra/newview/pieslice.h	Tue May 10 10:46:17 2016 +0200
     3.2 +++ b/indra/newview/pieslice.h	Tue May 10 11:44:34 2016 +0200
     3.3 @@ -66,7 +66,7 @@
     3.4  
     3.5  	// accessor to expose the label to the outside (value is the same as label)
     3.6  	std::string getLabel() const;
     3.7 -	void setLabel(const std::string newLabel);
     3.8 +	void setLabel(const std::string& newLabel);
     3.9  	LLSD getValue() const;
    3.10  	void setValue(const LLSD& value);
    3.11  

mercurial