summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-02-18 15:45:48 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2010-02-18 15:45:48 +0200
commitf33a1d7ad994633f398c3e5ba9f668cf72d31099 (patch)
treee427da4de5ed1e3c533114a32dc6f8c7f6f378f8 /indra
parent5ab2980f9c4d6c33484b18d5d87c79d52acffaa3 (diff)
parenta52a761460a882a7890033b29ed203e4ce54c486 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llsearcheditor.cpp2
-rw-r--r--indra/newview/llfloaterpreference.cpp16
-rw-r--r--indra/newview/llgrouplist.cpp2
-rw-r--r--indra/newview/llpanelpicks.cpp9
-rw-r--r--indra/newview/llpreviewtexture.cpp112
5 files changed, 104 insertions, 37 deletions
diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp
index 491eeeab54..e6c5e3f334 100644
--- a/indra/llui/llsearcheditor.cpp
+++ b/indra/llui/llsearcheditor.cpp
@@ -155,7 +155,7 @@ void LLSearchEditor::setFocus( BOOL b )
void LLSearchEditor::onClearButtonClick(const LLSD& data)
{
- setText(LLStringUtil::null);
+ mSearchEditor->selectAll();
mSearchEditor->doDelete(); // force keystroke callback
}
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index e5c8ddf0a4..5240ce36c7 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -315,7 +315,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this));
mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this));
mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this));
- mCommitCallbackRegistrar.add("Pref.UpdateMeterText", boost::bind(&LLFloaterPreference::updateMeterText, this, _1));
mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this));
mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this));
mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this));
@@ -674,21 +673,6 @@ void LLFloaterPreference::refreshEnabledGraphics()
}
}
-void LLFloaterPreference::updateMeterText(LLUICtrl* ctrl)
-{
- // get our UI widgets
- LLSliderCtrl* slider = (LLSliderCtrl*) ctrl;
-
- LLTextBox* m1 = getChild<LLTextBox>("DrawDistanceMeterText1");
- LLTextBox* m2 = getChild<LLTextBox>("DrawDistanceMeterText2");
-
- // toggle the two text boxes based on whether we have 1 or two digits
- F32 val = slider->getValueF32();
- bool two_digits = val < 100;
- m1->setVisible(two_digits);
- m2->setVisible(!two_digits);
-}
-
void LLFloaterPreference::onClickBrowserClearCache()
{
LLNotificationsUtil::add("ConfirmClearBrowserCache", LLSD(), LLSD(), callback_clear_browser_cache);
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index 1ed1113f4d..bcfb516b81 100644
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -287,7 +287,7 @@ bool LLGroupList::onContextMenuItemEnable(const LLSD& userdata)
return gAgent.getGroupID() != selected_group_id;
if (userdata.asString() == "call")
- return LLVoiceClient::voiceEnabled()&&gVoiceClient->voiceWorking();
+ return real_group_selected && LLVoiceClient::voiceEnabled()&&gVoiceClient->voiceWorking();
return real_group_selected;
}
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 8eb0b69491..2ff2597f08 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -351,7 +351,14 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type)
if (mNoPicks && mNoClassifieds)
{
- childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText"));
+ if(getAvatarId() == gAgentID)
+ {
+ childSetValue("picks_panel_text", LLTrans::getString("NoPicksClassifiedsText"));
+ }
+ else
+ {
+ childSetValue("picks_panel_text", LLTrans::getString("NoAvatarPicksClassifiedsText"));
+ }
}
}
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index 76b02f07ec..c0c859e9ac 100644
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -248,6 +248,7 @@ void LLPreviewTexture::draw()
}
}
}
+
}
@@ -282,18 +283,52 @@ void LLPreviewTexture::saveAs()
// virtual
void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent)
{
-// mLastHeight = 0;
-// mLastWidth = 0;
- mUpdateDimensions = TRUE;
LLPreview::reshape(width, height, called_from_parent);
+
+ LLRect dim_rect;
+ childGetRect("dimensions", dim_rect);
+
+ S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE;
+
+ // add space for dimensions and aspect ratio
+ S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD;
+
+ LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0);
+ client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
+ client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ;
+
+ S32 client_width = client_rect.getWidth();
+ S32 client_height = client_rect.getHeight();
+
+ if (mAspectRatio > 0.f)
+ {
+ if(mAspectRatio > 1.f)
+ {
+ client_height = llceil((F32)client_width / mAspectRatio);
+ if(client_height > client_rect.getHeight())
+ {
+ client_height = client_rect.getHeight();
+ client_width = llceil((F32)client_height * mAspectRatio);
+ }
+ }
+ else//mAspectRatio < 1.f
+ {
+ client_width = llceil((F32)client_height * mAspectRatio);
+ if(client_width > client_rect.getWidth())
+ {
+ client_width = client_rect.getWidth();
+ client_height = llceil((F32)client_width / mAspectRatio);
+ }
+ }
+ }
+
+ mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() + (client_height / 2), client_width, client_height);
+
}
// virtual
void LLPreviewTexture::onFocusReceived()
{
- mLastHeight = 0;
- mLastWidth = 0;
- mUpdateDimensions = TRUE;
LLPreview::onFocusReceived();
}
@@ -364,13 +399,19 @@ void LLPreviewTexture::updateDimensions()
{
if (!mImage)
return;
+
+ if(mImage->getFullWidth() == 0 || mImage->getFullHeight() == 0)
+ {
+ return;
+ }
+
mUpdateDimensions = FALSE;
-
- // set text on dimensions display (should be moved out of here and into a callback of some sort)
+
childSetTextArg("dimensions", "[WIDTH]", llformat("%d", mImage->getFullWidth()));
childSetTextArg("dimensions", "[HEIGHT]", llformat("%d", mImage->getFullHeight()));
+
LLRect dim_rect;
childGetRect("dimensions", dim_rect);
@@ -379,34 +420,68 @@ void LLPreviewTexture::updateDimensions()
// add space for dimensions and aspect ratio
S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD;
- LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0);
- client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
- client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ;
+ S32 screen_width = gFloaterView->getSnapRect().getWidth();
+ S32 screen_height = gFloaterView->getSnapRect().getHeight();
- S32 client_width = client_rect.getWidth();
- S32 client_height = client_rect.getHeight();
+ S32 max_image_width = screen_width - 2*horiz_pad;
+ S32 max_image_height = screen_height - (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD)
+ - (PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height);
+
+ S32 client_width = llmin(max_image_width,mImage->getFullWidth());
+ S32 client_height = llmin(max_image_height,mImage->getFullHeight());
if (mAspectRatio > 0.f)
{
if(mAspectRatio > 1.f)
{
client_height = llceil((F32)client_width / mAspectRatio);
- if(client_height > client_rect.getHeight())
+ if(client_height > max_image_height)
{
- client_height = client_rect.getHeight();
+ client_height = max_image_height;
client_width = llceil((F32)client_height * mAspectRatio);
}
}
- else
+ else//mAspectRatio < 1.f
{
client_width = llceil((F32)client_height * mAspectRatio);
- if(client_width > client_rect.getWidth())
+ if(client_width > max_image_width)
{
- client_width = client_rect.getWidth();
+ client_width = max_image_width;
client_height = llceil((F32)client_width / mAspectRatio);
}
}
}
+ else
+ {
+
+ if(client_height > max_image_height)
+ {
+ F32 ratio = (F32)max_image_height/client_height;
+ client_height = max_image_height;
+ client_width = llceil((F32)client_height * ratio);
+ }
+
+ if(client_width > max_image_width)
+ {
+ F32 ratio = (F32)max_image_width/client_width;
+ client_width = max_image_width;
+ client_height = llceil((F32)client_width * ratio);
+ }
+ }
+
+ //now back to whole floater
+ S32 floater_width = llmax(getMinWidth(),client_width + 2*horiz_pad);
+ S32 floater_height = llmax(getMinHeight(),client_height + (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD)
+ + (PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height));
+
+ //reshape floater
+ reshape( floater_width, floater_height );
+ gFloaterView->adjustToFitScreen(this, FALSE);
+
+ //setup image rect...
+ LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0);
+ client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
+ client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ;
mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() + (client_height / 2), client_width, client_height);
@@ -468,6 +543,7 @@ void LLPreviewTexture::loadAsset()
mImage->setBoostLevel(LLViewerTexture::BOOST_PREVIEW);
mImage->forceToSaveRawImage(0) ;
mAssetStatus = PREVIEW_ASSET_LOADING;
+ mUpdateDimensions = TRUE;
updateDimensions();
childSetVisible("save_tex_btn", canSaveAs());
}