Skip to content
Snippets Groups Projects
Commit 0876df6e authored by Mike Antipov's avatar Mike Antipov
Browse files

No ticket. Code to resize bottom tray is refuctored after the latest fix for EXT-2616:

 - Removed unused param while extending bottom tray
 - Moved some debug messages

--HG--
branch : product-engine
parent 91fdbd92
No related branches found
No related tags found
No related merge requests found
...@@ -536,7 +536,6 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) ...@@ -536,7 +536,6 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
// how many room we have to show hidden buttons // how many room we have to show hidden buttons
S32 total_available_width = delta_width + chatbar_available_shrink_width + available_width_chiclet; S32 total_available_width = delta_width + chatbar_available_shrink_width + available_width_chiclet;
S32 buttons_required_width = 0; //How many room will take shown buttons
lldebugs << "Processing extending, available width:" lldebugs << "Processing extending, available width:"
<< ", chatbar - " << chatbar_available_shrink_width << ", chatbar - " << chatbar_available_shrink_width
...@@ -547,26 +546,22 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) ...@@ -547,26 +546,22 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
S32 available_width = total_available_width; S32 available_width = total_available_width;
if (available_width > 0) if (available_width > 0)
{ {
lldebugs << "Trying to process: RS_BUTTON_GESTURES" << llendl; processShowButton(RS_BUTTON_GESTURES, &available_width);
processShowButton(RS_BUTTON_GESTURES, &available_width, &buttons_required_width);
} }
if (available_width > 0) if (available_width > 0)
{ {
lldebugs << "Trying to process: RS_BUTTON_MOVEMENT" << llendl; processShowButton(RS_BUTTON_MOVEMENT, &available_width);
processShowButton(RS_BUTTON_MOVEMENT, &available_width, &buttons_required_width);
} }
if (available_width > 0) if (available_width > 0)
{ {
lldebugs << "Trying to process: RS_BUTTON_CAMERA" << llendl; processShowButton(RS_BUTTON_CAMERA, &available_width);
processShowButton(RS_BUTTON_CAMERA, &available_width, &buttons_required_width);
} }
if (available_width > 0) if (available_width > 0)
{ {
lldebugs << "Trying to process: RS_BUTTON_SNAPSHOT" << llendl; processShowButton(RS_BUTTON_SNAPSHOT, &available_width);
processShowButton(RS_BUTTON_SNAPSHOT, &available_width, &buttons_required_width);
} }
processExtendButtons(&available_width); processExtendButtons(&available_width);
...@@ -626,8 +621,10 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) ...@@ -626,8 +621,10 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
} }
} }
bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* available_width, S32* buttons_required_width) bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* available_width)
{ {
lldebugs << "Trying to show object type: " << shown_object_type << llendl;
LLPanel* panel = mStateProcessedObjectMap[shown_object_type]; LLPanel* panel = mStateProcessedObjectMap[shown_object_type];
if (NULL == panel) if (NULL == panel)
{ {
...@@ -643,12 +640,11 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa ...@@ -643,12 +640,11 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa
if (can_be_shown) if (can_be_shown)
{ {
*available_width -= required_width; *available_width -= required_width;
*buttons_required_width += required_width;
setTrayButtonVisible(shown_object_type, true); setTrayButtonVisible(shown_object_type, true);
lldebugs << "processing object type: " << shown_object_type lldebugs << "processed object type: " << shown_object_type
<< ", buttons_required_width: " << *buttons_required_width << ", rest available width: " << *available_width
<< llendl; << llendl;
mResizeState &= ~shown_object_type; mResizeState &= ~shown_object_type;
} }
...@@ -658,6 +654,8 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa ...@@ -658,6 +654,8 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa
void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width) void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width)
{ {
lldebugs << "Trying to hide object type: " << processed_object_type << llendl;
LLPanel* panel = mStateProcessedObjectMap[processed_object_type]; LLPanel* panel = mStateProcessedObjectMap[processed_object_type];
if (NULL == panel) if (NULL == panel)
{ {
......
...@@ -109,7 +109,7 @@ class LLBottomTray ...@@ -109,7 +109,7 @@ class LLBottomTray
S32 processWidthDecreased(S32 delta_width); S32 processWidthDecreased(S32 delta_width);
void processWidthIncreased(S32 delta_width); void processWidthIncreased(S32 delta_width);
void log(LLView* panel, const std::string& descr); void log(LLView* panel, const std::string& descr);
bool processShowButton(EResizeState shown_object_type, S32* available_width, S32* buttons_required_width); bool processShowButton(EResizeState shown_object_type, S32* available_width);
void processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width); void processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width);
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment