diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-11-05 10:52:23 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2014-11-05 10:52:23 -0500 |
commit | 13b4909a3ca066105695afc174642409daa46df2 (patch) | |
tree | f12b1c2d32fda122bcd1f6f79ebfe2226325d9a8 /indra/newview/llfloatertwitter.cpp | |
parent | 52ed6ac28697ffcfd7300602aec34db8eafc171a (diff) | |
parent | 02e2235277a90f2e291557a429ae4e5de3e0d3b6 (diff) |
merge
Diffstat (limited to 'indra/newview/llfloatertwitter.cpp')
-rw-r--r-- | indra/newview/llfloatertwitter.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 78e9259919..868d623d57 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -64,7 +64,6 @@ const std::string DEFAULT_STATUS_TEXT = " #SecondLife"; /////////////////////////// LLTwitterPhotoPanel::LLTwitterPhotoPanel() : -mSnapshotPanel(NULL), mResolutionComboBox(NULL), mRefreshBtn(NULL), mBtnPreview(NULL), @@ -94,7 +93,6 @@ BOOL LLTwitterPhotoPanel::postBuild() { setVisibleCallback(boost::bind(&LLTwitterPhotoPanel::onVisibilityChange, this, _2)); - mSnapshotPanel = getChild<LLUICtrl>("snapshot_panel"); mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox"); mResolutionComboBox->setValue("[i800,i600]"); // hardcoded defaults ftw! mResolutionComboBox->setCommitCallback(boost::bind(&LLTwitterPhotoPanel::updateResolution, this, TRUE)); @@ -194,15 +192,8 @@ void LLTwitterPhotoPanel::draw() // calc preview offset within the preview rect const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; - - // calc preview offset within the floater rect - // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater. - // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity. - // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time. - S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39; - - mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType<LLFloater>()); + S32 offset_x = thumbnail_rect.mLeft + local_offset_x; + S32 offset_y = thumbnail_rect.mBottom + local_offset_y; gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. @@ -238,7 +229,7 @@ void LLTwitterPhotoPanel::onVisibilityChange(BOOL visible) LLSnapshotLivePreview* preview = getPreviewView(); if(preview) { - lldebugs << "opened, updating snapshot" << llendl; + LL_DEBUGS() << "opened, updating snapshot" << LL_ENDL; preview->updateSnapshot(TRUE); } } @@ -455,7 +446,7 @@ void LLTwitterPhotoPanel::updateControls() BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; updateResolution(FALSE); } @@ -485,13 +476,13 @@ void LLTwitterPhotoPanel::updateResolution(BOOL do_update) if (width == 0 || height == 0) { // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } else { // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL; previewp->setSize(width, height); } @@ -755,7 +746,7 @@ void LLFloaterTwitter::showPhotoPanel() LLTabContainer* parent = dynamic_cast<LLTabContainer*>(mTwitterPhotoPanel->getParent()); if (!parent) { - llwarns << "Cannot find panel container" << llendl; + LL_WARNS() << "Cannot find panel container" << LL_ENDL; return; } |