From 9175bc0e165332f4525537eaf3c857350b1a5f1a Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Thu, 10 Jan 2013 18:11:45 +0100 Subject: [PATCH] Fixed LLUploadDialog to display it's text. Also made the view rectangle have some minimal size (1/10th of the screens width and height). Increased the used font a bit. Fixed removal of the dialog in the case of uploading to profile feed. --- indra/llui/llview.cpp | 2 +- indra/newview/llfloaterpostcard.cpp | 3 --- indra/newview/llfloatersnapshot.cpp | 3 +++ indra/newview/lluploaddialog.cpp | 13 ++++++++----- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index ae81cce24..07f99132b 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1185,7 +1185,7 @@ void LLView::drawChildren() { // Only draw views that are within the root view LLRect screen_rect = viewp->calcScreenRect(); - if ( rootp->getLocalRect().overlaps(screen_rect) ) + if ( rootp->getRect().overlaps(screen_rect) ) { //gGL.matrixMode(LLRender::MM_MODELVIEW); LLUI::pushMatrix(); diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index 6c05f60a5..0a4663f2e 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -251,7 +251,6 @@ public: /*virtual*/ void uploadComplete(const LLSD& content) { // we don't care about what the server returns from this post, just clean up the UI - LLUploadDialog::modalUploadFinished(); LLFloaterSnapshot::savePostcardDone(true, mSnapshotIndex); } /*virtual*/ void uploadFailure(const LLSD& content) @@ -313,8 +312,6 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data, { LLFloaterPostcard *self = (LLFloaterPostcard *)user_data; - LLUploadDialog::modalUploadFinished(); - LLFloaterSnapshot::savePostcardDone(!result, self->mSnapshotIndex); if (result) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index dda174656..b25aa9383 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -73,6 +73,7 @@ #include "llworld.h" #include "llagentui.h" #include "llvoavatar.h" +#include "lluploaddialog.h" #include "llgl.h" #include "llglheaders.h" @@ -2018,6 +2019,7 @@ void LLFloaterSnapshot::saveLocalDone(bool success, int index) //static void LLFloaterSnapshot::saveFeedDone(bool success, int index) { + LLUploadDialog::modalUploadFinished(); LLSnapshotLivePreview* previewp = LLFloaterSnapshot::Impl::getPreviewView(); if (previewp) { @@ -2028,6 +2030,7 @@ void LLFloaterSnapshot::saveFeedDone(bool success, int index) //static void LLFloaterSnapshot::savePostcardDone(bool success, int index) { + LLUploadDialog::modalUploadFinished(); LLSnapshotLivePreview* previewp = LLFloaterSnapshot::Impl::getPreviewView(); if (previewp) { diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp index a860e5303..a4f758ff8 100644 --- a/indra/newview/lluploaddialog.cpp +++ b/indra/newview/lluploaddialog.cpp @@ -75,7 +75,7 @@ LLUploadDialog::LLUploadDialog( const std::string& msg) } LLUploadDialog::sDialog = this; - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_BIG ); LLRect msg_rect; for (int line_num=0; line_num<16; ++line_num) { @@ -91,7 +91,10 @@ LLUploadDialog::LLUploadDialog( const std::string& msg) void LLUploadDialog::setMessage( const std::string& msg) { - const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + S32 const min_width = gViewerWindow->getWindowWidthRaw() / 10; + S32 const min_height = gViewerWindow->getWindowHeightRaw() / 10; + + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_BIG ); const S32 VPAD = 16; const S32 HPAD = 25; @@ -127,14 +130,14 @@ void LLUploadDialog::setMessage( const std::string& msg) S32 line_height = S32( font->getLineHeight() + 0.99f ); - S32 dialog_width = max_msg_width + 2 * HPAD; - S32 dialog_height = line_height * msg_lines.size() + 2 * VPAD; + S32 dialog_width = llmax(max_msg_width + 2 * HPAD, min_width); + S32 dialog_height = llmax(line_height * (S32)msg_lines.size() + 2 * VPAD, min_height); reshape( dialog_width, dialog_height, FALSE ); // Message S32 msg_x = (getRect().getWidth() - max_msg_width) / 2; - S32 msg_y = getRect().getHeight() - VPAD - line_height; + S32 msg_y = (getRect().getHeight() + line_height * msg_lines.size()) / 2 - line_height; int line_num; for (line_num=0; line_num<16; ++line_num) {