mirror of
https://github.com/FirestormViewer/phoenix-firestorm.git
synced 2026-08-14 00:48:30 +00:00
Merge branch 'project/Flat_UI' of https://github.com/secondlife/viewer
# Conflicts: # indra/llui/lltabcontainer.cpp # indra/newview/llpanellogin.cpp
This commit is contained in:
@@ -1655,3 +1655,15 @@ void LLPluginClassMedia::initializeUrlHistory(const LLSD& url_history)
|
||||
|
||||
LL_DEBUGS("Plugin") << "Sending history" << LL_ENDL;
|
||||
}
|
||||
|
||||
void LLPluginClassMedia::forceRenderRefresh()
|
||||
{
|
||||
// Force layout recalculation by briefly hiding/showing the web content
|
||||
// Used to clear black screen issues after resize, see #5607
|
||||
const std::string refresh_script =
|
||||
"document.documentElement.style.visibility='hidden';"
|
||||
"document.documentElement.offsetHeight;"
|
||||
"document.documentElement.style.visibility='';";
|
||||
|
||||
executeJavaScript(refresh_script);
|
||||
}
|
||||
|
||||
@@ -350,6 +350,8 @@ public:
|
||||
|
||||
std::shared_ptr<LLPluginClassMedia> getSharedPtr() { return std::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this()); } // due to enable_shared_from_this
|
||||
|
||||
void forceRenderRefresh();
|
||||
|
||||
protected:
|
||||
|
||||
LLPluginClassMediaOwner *mOwner;
|
||||
|
||||
@@ -515,7 +515,7 @@ void LLTabContainer::draw()
|
||||
tuple->mButton->setVisible( true );
|
||||
}
|
||||
|
||||
S32 max_scroll_visible = getTabCount() - getMaxScrollPos() + getScrollPos();
|
||||
S32 max_scroll_visible = getVisibleTabCount() - getMaxScrollPos() + getScrollPos();
|
||||
S32 idx = 0;
|
||||
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
|
||||
{
|
||||
@@ -1522,6 +1522,20 @@ S32 LLTabContainer::getTabCount() const
|
||||
return static_cast<S32>(mTabList.size());
|
||||
}
|
||||
|
||||
S32 LLTabContainer::getVisibleTabCount() const
|
||||
{
|
||||
S32 visible_count = 0;
|
||||
for (tuple_list_t::const_iterator itr = mTabList.begin(); itr != mTabList.end(); ++itr)
|
||||
{
|
||||
const LLTabTuple* pTT = *itr;
|
||||
if (pTT->mVisible)
|
||||
{
|
||||
visible_count++;
|
||||
}
|
||||
}
|
||||
return visible_count;
|
||||
}
|
||||
|
||||
LLPanel* LLTabContainer::getPanelByIndex(S32 index) const
|
||||
{
|
||||
if (index >= 0 && index < (S32)mTabList.size())
|
||||
@@ -2349,6 +2363,14 @@ void LLTabContainer::updateMaxScrollPos()
|
||||
S32 tab_space = 0;
|
||||
S32 available_space = 0;
|
||||
tab_space = mTotalTabWidth;
|
||||
for(tuple_list_t::const_iterator tab_it = mTabList.begin(); tab_it != mTabList.end(); ++tab_it)
|
||||
{
|
||||
const LLTabTuple* tuple = *tab_it;
|
||||
if (!tuple->mVisible)
|
||||
{
|
||||
tab_space -= tuple->mButton->getRect().getWidth();
|
||||
}
|
||||
}
|
||||
available_space = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_tab_h_pad);
|
||||
|
||||
if( tab_space > available_space )
|
||||
@@ -2358,7 +2380,7 @@ void LLTabContainer::updateMaxScrollPos()
|
||||
available_width_with_arrows -= tabcntr_tab_partial_width;
|
||||
|
||||
S32 running_tab_width = 0;
|
||||
setMaxScrollPos(getTabCount());
|
||||
setMaxScrollPos(getVisibleTabCount());
|
||||
for(tuple_list_t::reverse_iterator tab_it = mTabList.rbegin(); tab_it != mTabList.rend(); ++tab_it)
|
||||
{
|
||||
// <FS:Ansariel> Only show button if tab is visible
|
||||
@@ -2372,7 +2394,7 @@ void LLTabContainer::updateMaxScrollPos()
|
||||
setMaxScrollPos(getMaxScrollPos()-1);
|
||||
}
|
||||
// in case last tab doesn't actually fit on screen, make it the last scrolling position
|
||||
setMaxScrollPos(llmin(getMaxScrollPos(), getTabCount() - 1));
|
||||
setMaxScrollPos(llmin(getMaxScrollPos(), getVisibleTabCount() - 1));
|
||||
// <FS:Ansariel> Only show button if tab is visible
|
||||
//no_scroll = false;
|
||||
no_scroll = (running_tab_width <= available_width_with_arrows);
|
||||
|
||||
@@ -205,6 +205,7 @@ public:
|
||||
LLPanel* getCurrentPanel();
|
||||
S32 getCurrentPanelIndex() const;
|
||||
S32 getTabCount() const;
|
||||
S32 getVisibleTabCount() const;
|
||||
LLPanel* getPanelByIndex(S32 index) const;
|
||||
S32 getIndexForPanel(LLPanel* panel) const;
|
||||
S32 getPanelIndexByTitle(std::string_view title) const;
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "llstartup.h"
|
||||
#include "lltextbox.h"
|
||||
#include "llui.h"
|
||||
#include "llframetimer.h"
|
||||
#include "lluiconstants.h"
|
||||
#include "llslurl.h"
|
||||
#include "llversioninfo.h"
|
||||
@@ -316,8 +317,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
||||
forgot_password_text->setClickedCallback(onClickForgotPassword, NULL);
|
||||
|
||||
// get the web browser control
|
||||
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
|
||||
web_browser->addObserver(this);
|
||||
mWebBrowser = getChild<LLMediaCtrl>("login_html");
|
||||
mWebBrowser->addObserver(this);
|
||||
|
||||
loadLoginPage();
|
||||
|
||||
@@ -852,11 +853,9 @@ void LLPanelLogin::setAlwaysRefresh(bool refresh)
|
||||
{
|
||||
if (sInstance && LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP)
|
||||
{
|
||||
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
|
||||
|
||||
if (web_browser)
|
||||
if (sInstance->mWebBrowser)
|
||||
{
|
||||
web_browser->setAlwaysRefresh(refresh);
|
||||
sInstance->mWebBrowser->setAlwaysRefresh(refresh);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -913,16 +912,28 @@ void LLPanelLogin::loadLoginPage()
|
||||
|
||||
gViewerWindow->setMenuBackgroundColor(false, !LLGridManager::getInstance()->isInProductionGrid());
|
||||
|
||||
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
|
||||
if (web_browser->getCurrentNavUrl() != login_uri.asString())
|
||||
if (sInstance->mWebBrowser->getCurrentNavUrl() != login_uri.asString())
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "loading: " << login_uri << LL_ENDL;
|
||||
web_browser->navigateTo( login_uri.asString(), "text/html" );
|
||||
sInstance->mWebBrowser->navigateTo(login_uri.asString(), "text/html");
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent event)
|
||||
void LLPanelLogin::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
|
||||
{
|
||||
constexpr F32 REFRESH_DELAY = 2.f;
|
||||
switch (event)
|
||||
{
|
||||
case MEDIA_EVENT_SIZE_CHANGED:
|
||||
{
|
||||
mForceRefreshTimer.reset();
|
||||
mForceRefreshTimer.setTimerExpirySec(REFRESH_DELAY);
|
||||
mForceRefresh = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -1385,4 +1396,20 @@ void LLPanelLogin::collapseGridPanel(bool collapse)
|
||||
mLoginStack->collapsePanel(mGridPanel, collapse);
|
||||
mLoginStack->updateLayout();
|
||||
}
|
||||
|
||||
void LLPanelLogin::draw()
|
||||
{
|
||||
LLPanel::draw();
|
||||
|
||||
// Workaround for the black screen issue (see #5607)
|
||||
// Should be removed after the proper fix for resizing is implemented
|
||||
if (mForceRefresh && mForceRefreshTimer.hasExpired())
|
||||
{
|
||||
if (mWebBrowser->getMediaPlugin())
|
||||
{
|
||||
mWebBrowser->getMediaPlugin()->forceRenderRefresh();
|
||||
}
|
||||
mForceRefresh = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -50,6 +50,8 @@ public:
|
||||
void *callback_data);
|
||||
~LLPanelLogin();
|
||||
|
||||
void draw();
|
||||
|
||||
virtual void setFocus( bool b );
|
||||
|
||||
static void show(const LLRect &rect,
|
||||
@@ -133,10 +135,15 @@ private:
|
||||
unsigned int mPasswordLength;
|
||||
unsigned int mLocationLength;
|
||||
|
||||
LLTimer mForceRefreshTimer;
|
||||
bool mForceRefresh {false};
|
||||
|
||||
bool mAlertNotif;
|
||||
LLButton* mLoginBtn;
|
||||
LLLayoutPanel* mGridPanel;
|
||||
LLLayoutStack* mLoginStack;
|
||||
|
||||
LLMediaCtrl* mWebBrowser;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user