#4751 Restore navigation UI for Marketplace and Search

master
Maxim Nikolenko 2025-09-30 19:28:21 +03:00 committed by GitHub
parent 79909b8a33
commit 420bc85f97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 444 additions and 54 deletions

View File

@ -27,10 +27,11 @@
#include "llviewerprecompiledheaders.h"
#include "llfloatermarketplace.h"
#include "llviewercontrol.h"
#include "lluictrlfactory.h"
LLFloaterMarketplace::LLFloaterMarketplace(const LLSD& key)
: LLFloater(key)
: LLFloaterWebContent(key)
{
}
@ -38,10 +39,25 @@ LLFloaterMarketplace::~LLFloaterMarketplace()
{
}
// just to override LLFloaterWebContent
void LLFloaterMarketplace::onClose(bool app_quitting)
{
}
bool LLFloaterMarketplace::postBuild()
{
enableResizeCtrls(true, true, false);
LLFloaterWebContent::postBuild();
mWebBrowser = getChild<LLMediaCtrl>("marketplace_contents");
mWebBrowser->addObserver(this);
return true;
}
void LLFloaterMarketplace::openMarketplace()
{
std::string url = gSavedSettings.getString("MarketplaceURL");
if (mCurrentURL != url)
{
mWebBrowser->navigateTo(url, HTTP_CONTENT_TEXT_HTML);
}
}

View File

@ -27,14 +27,20 @@
#pragma once
#include "llfloater.h"
#include "llfloaterwebcontent.h"
class LLFloaterMarketplace:
public LLFloater
public LLFloaterWebContent
{
friend class LLFloaterReg;
public:
void openMarketplace();
private:
LLFloaterMarketplace(const LLSD& key);
~LLFloaterMarketplace();
bool postBuild() override;
void onClose(bool app_quitting) override;
};

View File

@ -66,7 +66,7 @@ class LLSearchHandler : public LLCommandHandler {
LLSearchHandler gSearchHandler;
LLFloaterSearch::LLFloaterSearch(const LLSD& key)
: LLFloater(key)
: LLFloaterWebContent(key)
{
mSearchType.insert("standard");
mSearchType.insert("land");
@ -86,6 +86,12 @@ LLFloaterSearch::~LLFloaterSearch()
void LLFloaterSearch::onOpen(const LLSD& tokens)
{
initiateSearch(tokens);
mWebBrowser->setFocus(true);
}
// just to override LLFloaterWebContent
void LLFloaterSearch::onClose(bool app_quitting)
{
}
void LLFloaterSearch::initiateSearch(const LLSD& tokens)
@ -161,7 +167,11 @@ void LLFloaterSearch::initiateSearch(const LLSD& tokens)
bool LLFloaterSearch::postBuild()
{
enableResizeCtrls(true, true, false);
LLFloaterWebContent::postBuild();
mWebBrowser = getChild<LLMediaCtrl>("search_contents");
mWebBrowser->addObserver(this);
getChildView("address")->setEnabled(false);
getChildView("popexternal")->setEnabled(false);
// This call is actioned by the preload code in llViewerWindow
// that creates the search floater during the login process

View File

@ -27,13 +27,15 @@
#pragma once
#include "llfloater.h"
#include "llfloaterwebcontent.h"
class LLFloaterSearch:
public LLFloater {
public LLFloaterWebContent {
friend class LLFloaterReg;
public:
void onOpen(const LLSD& key) override;
void onClose(bool app_quitting) override;
private:
LLFloaterSearch(const LLSD& key);

View File

@ -41,6 +41,7 @@
#include "llpanelpresetscamerapulldown.h"
#include "llpanelpresetspulldown.h"
#include "llpanelvolumepulldown.h"
#include "llfloatermarketplace.h"
#include "llfloaterregioninfo.h"
#include "llfloaterscriptdebug.h"
#include "llhints.h"
@ -523,7 +524,11 @@ void LLStatusBar::onClickBuyCurrency()
void LLStatusBar::onClickShop()
{
LLFloaterReg::toggleInstanceOrBringToFront("marketplace");
LLFloaterReg::showInstanceOrBringToFront("marketplace");
if (LLFloaterMarketplace* marketplace = LLFloaterReg::getTypedInstance<LLFloaterMarketplace>("marketplace"))
{
marketplace->openMarketplace();
}
}
void LLStatusBar::onMouseEnterPresetsCamera()

View File

@ -1,26 +1,201 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater
positioning="cascading"
legacy_header_height="225"
can_minimize="true"
can_close="true"
can_resize="true"
min_height="800"
min_width="800"
height="800"
layout="topleft"
name="Marketplace"
single_instance="true"
help_topic="marketplace"
save_rect="true"
save_visibility="true"
title="MARKETPLACE"
width="800">
<web_browser
top="25"
height="775"
width="800"
follows="all"
name="marketplace_contents"
trusted_content="true"/>
legacy_header_height="18"
can_minimize="true"
can_close="true"
can_resize="true"
height="775"
layout="topleft"
min_height="500"
min_width="600"
name="Marketplace"
save_rect="true"
single_instance="true"
save_visibility="true"
title="MARKETPLACE"
tab_stop="true"
width="780">
<layout_stack
bottom="775"
follows="left|right|top|bottom"
layout="topleft"
left="5"
animate="false"
name="stack1"
orientation="vertical"
top="20"
width="770">
<layout_panel
auto_resize="false"
default_tab_group="1"
height="22"
layout="topleft"
left="0"
min_height="20"
name="nav_controls"
top="400"
width="770">
<button
image_overlay="Arrow_Left_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
hover_glow_amount="0.15"
tool_tip="Navigate back"
follows="left|top"
height="22"
layout="topleft"
left="1"
name="back"
top="0"
width="22">
<button.commit_callback
function="WebContent.Back" />
</button>
<button
image_overlay="Arrow_Right_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Navigate forward"
follows="left|top"
height="22"
layout="topleft"
left="27"
name="forward"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Forward" />
</button>
<button
image_overlay="Stop_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Stop navigation"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="stop"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Stop" />
</button>
<button
image_overlay="Refresh_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Reload page"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="reload"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Reload" />
</button>
<combo_box
allow_text_entry="true"
follows="left|top|right"
tab_group="1"
height="22"
layout="topleft"
left_pad="4"
max_chars="1024"
name="address"
combo_editor.select_on_focus="true"
tool_tip="Enter URL here"
top_delta="0"
width="672">
<combo_box.commit_callback
function="WebContent.EnterAddress" />
</combo_box>
<icon
name="media_secure_lock_flag"
height="16"
follows="top|left"
image_name="Lock2"
layout="topleft"
left_delta="2"
top_delta="2"
visible="false"
tool_tip="Secured Browsing"
width="16" />
<button
image_overlay="ExternalBrowser_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Open current URL in your desktop browser"
follows="right|top"
enabled="true"
height="22"
layout="topleft"
name="popexternal"
right="770"
top_delta="-2"
width="22">
<button.commit_callback
function="WebContent.PopExternal" />
</button>
</layout_panel>
<layout_panel
height="40"
layout="topleft"
left_delta="0"
name="external_controls"
top_delta="0"
auto_resize="true"
width="585">
<web_browser
bottom="-2"
follows="all"
layout="topleft"
left="0"
name="marketplace_contents"
top="0"/>
</layout_panel>
<layout_panel name="status_bar"
height="23"
auto_resize="false">
<text
type="string"
length="200"
follows="bottom|left"
height="20"
layout="topleft"
left_delta="0"
name="statusbartext"
parse_urls="false"
text_color="0.4 0.4 0.4 1"
top_pad="3"
width="495"/>
<progress_bar
color_bar="0.3 1.0 0.3 1"
follows="bottom|right"
height="16"
top_delta="-1"
left_pad="24"
layout="topleft"
name="statusbarprogress"
width="64"/>
</layout_panel>
</layout_stack>
</floater>

View File

@ -1,26 +1,202 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater
positioning="cascading"
legacy_header_height="225"
can_minimize="true"
can_close="true"
can_resize="true"
min_height="800"
min_width="800"
height="800"
layout="topleft"
name="Search"
single_instance="true"
help_topic="search"
save_rect="true"
save_visibility="true"
title="SEARCH"
width="800">
<web_browser
top="25"
height="775"
width="800"
follows="all"
name="search_contents"
trusted_content="true"/>
legacy_header_height="18"
can_minimize="true"
can_close="true"
can_resize="true"
height="775"
layout="topleft"
min_height="500"
min_width="600"
name="Search"
save_rect="true"
single_instance="true"
save_visibility="true"
title="SEARCH"
tab_stop="true"
width="780">
<layout_stack
bottom="775"
follows="left|right|top|bottom"
layout="topleft"
left="5"
animate="false"
name="stack1"
orientation="vertical"
top="20"
width="770">
<layout_panel
auto_resize="false"
default_tab_group="1"
height="22"
layout="topleft"
left="0"
min_height="20"
name="nav_controls"
top="400"
width="770">
<button
image_overlay="Arrow_Left_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
hover_glow_amount="0.15"
tool_tip="Navigate back"
follows="left|top"
height="22"
layout="topleft"
left="1"
name="back"
top="0"
width="22">
<button.commit_callback
function="WebContent.Back" />
</button>
<button
image_overlay="Arrow_Right_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Navigate forward"
follows="left|top"
height="22"
layout="topleft"
left="27"
name="forward"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Forward" />
</button>
<button
image_overlay="Stop_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Stop navigation"
enabled="true"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="stop"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Stop" />
</button>
<button
image_overlay="Refresh_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Reload page"
follows="left|top"
height="22"
layout="topleft"
left="51"
name="reload"
top_delta="0"
width="22">
<button.commit_callback
function="WebContent.Reload" />
</button>
<combo_box
allow_text_entry="true"
follows="left|top|right"
tab_group="1"
height="22"
layout="topleft"
left_pad="4"
max_chars="1024"
name="address"
combo_editor.select_on_focus="true"
tool_tip="Enter URL here"
top_delta="0"
width="672">
<combo_box.commit_callback
function="WebContent.EnterAddress" />
</combo_box>
<icon
name="media_secure_lock_flag"
height="16"
follows="top|left"
image_name="Lock2"
layout="topleft"
left_delta="2"
top_delta="2"
visible="false"
tool_tip="Secured Browsing"
width="16" />
<button
image_overlay="ExternalBrowser_Off"
image_disabled="PushButton_Disabled"
image_disabled_selected="PushButton_Disabled"
image_selected="PushButton_Selected"
image_unselected="PushButton_Off"
chrome="true"
tool_tip="Open current URL in your desktop browser"
follows="right|top"
enabled="true"
height="22"
layout="topleft"
name="popexternal"
right="770"
top_delta="-2"
width="22">
<button.commit_callback
function="WebContent.PopExternal" />
</button>
</layout_panel>
<layout_panel
height="40"
layout="topleft"
left_delta="0"
name="external_controls"
top_delta="0"
auto_resize="true"
width="585">
<web_browser
bottom="-2"
follows="all"
layout="topleft"
left="0"
trusted_content="true"
name="search_contents"
top="0"/>
</layout_panel>
<layout_panel name="status_bar"
height="23"
auto_resize="false">
<text
type="string"
length="200"
follows="bottom|left"
height="20"
layout="topleft"
left_delta="0"
name="statusbartext"
parse_urls="false"
text_color="0.4 0.4 0.4 1"
top_pad="3"
width="495"/>
<progress_bar
color_bar="0.3 1.0 0.3 1"
follows="bottom|right"
height="16"
top_delta="-1"
left_pad="24"
layout="topleft"
name="statusbarprogress"
width="64"/>
</layout_panel>
</layout_stack>
</floater>