Decided to allow width adjustment to ticker floater. It's a little wonky due to blocking height adjustment. LLFloater is kinda crappy and doesen't provide a real max_height/max_width mechanism to do this, so the behavior is a little wonky, but good enough for now.
This commit is contained in:
@@ -69,7 +69,20 @@ SHFloaterMediaTicker::SHFloaterMediaTicker() : LLFloater()/*, LLSingleton<SHFloa
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/void SHFloaterMediaTicker::reshape(S32 width, S32 height, BOOL called_from_parent/*=TRUE*/)
|
||||
{
|
||||
//disable height change.
|
||||
bool width_changed = (getRect().getWidth() != width);
|
||||
LLFloater::reshape(width,getRect().getHeight(), called_from_parent);
|
||||
if(width_changed)
|
||||
{
|
||||
if(mTitleText)
|
||||
mTitleScrollChars = countExtraChars(mTitleText,mszTitle);
|
||||
if(mArtistText)
|
||||
mArtistScrollChars = countExtraChars(mArtistText,mszArtist);
|
||||
resetTicker();
|
||||
}
|
||||
}
|
||||
void SHFloaterMediaTicker::updateTickerText() //called via draw.
|
||||
{
|
||||
bool stream_paused = gAudiop->getStreamingAudioImpl()->isPlaying() != 1; //will return 1 if playing.
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
/*virtual*/ void draw();
|
||||
/*virtual*/ void onOpen();
|
||||
/*virtual*/ void onClose(bool app_quitting);
|
||||
|
||||
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
static void showInstance(); //use to create.
|
||||
private:
|
||||
void updateTickerText(); //called via draw.
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="false"
|
||||
<floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="true"
|
||||
height="33" min_height="33" min_width="256" name="mediaticker" rect_control="SHMediaTickerRect" control_name="SHShowMediaTicker"
|
||||
title="" width="256">
|
||||
<icon bottom="-32" color="1, 1, 1, 1" follows="top|right" height="31"
|
||||
<icon bottom="-32" color="1, 1, 1, 1" follows="top|left|right" height="31"
|
||||
image_name="ticker_background_small.tga" left="2" mouse_opaque="false" name="ticker_background"
|
||||
width="234" />
|
||||
<icon bottom="-17" color="0, 0, 0, .2" follows="top|right" height="1"
|
||||
<icon bottom="-17" color="0, 0, 0, .2" follows="top|left|right" height="1"
|
||||
image_name="white.tga" left="2" mouse_opaque="false" name="ticker_background"
|
||||
width="234" />
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|left"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="4"
|
||||
mouse_opaque="true" name="artist_label" v_pad="0" width="50">
|
||||
Artist:
|
||||
</text>
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|left|right"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
|
||||
mouse_opaque="true" name="artist_text" v_pad="0" width="185">
|
||||
</text>
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|left"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="4"
|
||||
mouse_opaque="true" name="title_label" v_pad="0" width="50">
|
||||
Title:
|
||||
</text>
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|left|right"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
|
||||
mouse_opaque="true" name="title_text" v_pad="0" width="185">
|
||||
</text>
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="false"
|
||||
<floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="true"
|
||||
height="33" min_height="33" min_width="256" name="mediaticker" rect_control="SHMediaTickerRect" control_name="SHShowMediaTicker"
|
||||
title="" width="256">
|
||||
<icon bottom="-32" color="1, 1, 1, 1" follows="top|right" height="31"
|
||||
<icon bottom="-32" color="1, 1, 1, 1" follows="top|left|right" height="31"
|
||||
image_name="ticker_background_small.tga" left="2" mouse_opaque="false" name="ticker_background"
|
||||
width="234" />
|
||||
<icon bottom="-17" color="0, 0, 0, .2" follows="top|right" height="1"
|
||||
<icon bottom="-17" color="0, 0, 0, .2" follows="top|left|right" height="1"
|
||||
image_name="white.tga" left="2" mouse_opaque="false" name="ticker_background"
|
||||
width="175" />
|
||||
<locate bottom="-32" height="31" left="176" name="visualizer_box" width="60"/>
|
||||
<locate bottom="-32" height="31" left="177" name="visualizer_box" width="60" follows="top|right" use_bounding_rect="true"/>
|
||||
<icon bottom="-33" color="0, 0, 0, .2" follows="top|right" height="33"
|
||||
image_name="ticker_visualizer_grid.tga" left="176" mouse_opaque="false" name="visualizer_grid"
|
||||
image_name="ticker_visualizer_grid.tga" left="177" mouse_opaque="false" name="visualizer_grid"
|
||||
width="60" />
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|left"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="4"
|
||||
mouse_opaque="true" name="artist_label" v_pad="0" width="50">
|
||||
Artist:
|
||||
</text>
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-17" drop_shadow_visible="true" follows="top|left|right"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
|
||||
mouse_opaque="true" name="artist_text" v_pad="0" width="125">
|
||||
</text>
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|left"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="4"
|
||||
mouse_opaque="true" name="title_label" v_pad="0" width="50">
|
||||
Title:
|
||||
</text>
|
||||
<text text_color="0,0,0,1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|right"
|
||||
bottom="-32" drop_shadow_visible="true" follows="top|left|right"
|
||||
font="SansSerifBold" h_pad="0" halign="left" height="16" left="50"
|
||||
mouse_opaque="true" name="title_text" v_pad="0" width="125">
|
||||
</text>
|
||||
|
||||
Reference in New Issue
Block a user