mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #1652 from Areloch/ABAssetPreviewBitmapsFix
Some checks failed
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Has been cancelled
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Has been cancelled
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Has been cancelled
Some checks failed
Linux Build / ${{matrix.config.name}} (map[build_type:Release cc:gcc cxx:g++ generator:Ninja name:Ubuntu Latest GCC]) (push) Has been cancelled
MacOSX Build / ${{matrix.config.name}} (map[build_type:Release cc:clang cxx:clang++ generator:Ninja name:MacOSX Latest Clang]) (push) Has been cancelled
Windows Build / ${{matrix.config.name}} (map[build_type:Release cc:cl cxx:cl environment_script:C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat generator:Visual Studio 17 2022 name:Windows Latest MSVC]) (push) Has been cancelled
Fix for AB Preview Button Bitmaps display
This commit is contained in:
commit
62ab78cb55
2 changed files with 43 additions and 55 deletions
|
|
@ -202,11 +202,10 @@ bool GuiIconButtonCtrl::resize(const Point2I &newPosition, const Point2I &newExt
|
||||||
|
|
||||||
void GuiIconButtonCtrl::setBitmap(const char *name)
|
void GuiIconButtonCtrl::setBitmap(const char *name)
|
||||||
{
|
{
|
||||||
|
_setBitmap(name);
|
||||||
if(!isAwake())
|
if(!isAwake())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_setBitmap(name);
|
|
||||||
|
|
||||||
// So that extent is recalculated if autoSize is set.
|
// So that extent is recalculated if autoSize is set.
|
||||||
resize( getPosition(), getExtent() );
|
resize( getPosition(), getExtent() );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -686,22 +686,7 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
%tooltip = %assetName;
|
%tooltip = %assetName;
|
||||||
|
|
||||||
%textBottomPad = 20;
|
%textBottomPad = 20;
|
||||||
|
|
||||||
%previewButton = new GuiIconButtonCtrl()
|
|
||||||
{
|
|
||||||
class = "AssetBrowserPreviewButton";
|
|
||||||
useMouseEvents = true;
|
|
||||||
iconLocation = "Center";
|
|
||||||
sizeIconToButton = true;
|
|
||||||
makeIconSquare = true;
|
|
||||||
textLocation = "Bottom";
|
|
||||||
extent = %previewSize.x SPC %previewSize.y + %textBottomPad;
|
|
||||||
buttonType = "RadioButton";
|
|
||||||
buttonMargin = "0 -10";
|
|
||||||
profile = ToolsGuiDefaultIconBtnProfile;
|
|
||||||
assetBrowser = %this;
|
|
||||||
};
|
|
||||||
|
|
||||||
%previewScaleSize = %this-->previewSlider.getValue();
|
%previewScaleSize = %this-->previewSlider.getValue();
|
||||||
|
|
||||||
if(%previewScaleSize $= "")
|
if(%previewScaleSize $= "")
|
||||||
|
|
@ -710,29 +695,6 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
%this-->previewSlider.setValue(1);
|
%this-->previewSlider.setValue(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%previewScaleSize == 0 || startsWith(%this.dirHandler.currentAddress, "Creator"))
|
|
||||||
{
|
|
||||||
%previewButton.iconLocation = "Left";
|
|
||||||
%previewButton.textLocation = "Right";
|
|
||||||
%previewButton.setextent(160,34);
|
|
||||||
%previewButton.buttonMargin = "8 8";
|
|
||||||
%previewButton.textMargin = "6";
|
|
||||||
|
|
||||||
%this.previewListMode = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%size = %previewSize.x * %previewScaleSize;
|
|
||||||
%previewButton.setextent(%size,%size + %textBottomPad);
|
|
||||||
|
|
||||||
%this.previewListMode = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//%previewButton.extent = %previewSize.x + %previewBounds SPC %previewSize.y + %previewBounds + 24;
|
|
||||||
%previewButton.assetName = %assetName;
|
|
||||||
%previewButton.moduleName = %moduleName;
|
|
||||||
%previewButton.assetType = %assetType;
|
|
||||||
|
|
||||||
if(%this.selectMode)
|
if(%this.selectMode)
|
||||||
{
|
{
|
||||||
%doubleClickCommand = %this @ ".selectAsset( "@ %this @ ".selectedAsset );";
|
%doubleClickCommand = %this @ ".selectAsset( "@ %this @ ".selectedAsset );";
|
||||||
|
|
@ -754,22 +716,49 @@ function AssetBrowser::buildAssetPreview( %this, %asset, %moduleName )
|
||||||
|
|
||||||
if(%this.previewData.doubleClickCommand !$= "")
|
if(%this.previewData.doubleClickCommand !$= "")
|
||||||
%doubleClickCommand = %this.previewData.doubleClickCommand;
|
%doubleClickCommand = %this.previewData.doubleClickCommand;
|
||||||
|
|
||||||
|
%previewButton = new GuiIconButtonCtrl()
|
||||||
|
{
|
||||||
|
class = "AssetBrowserPreviewButton";
|
||||||
|
useMouseEvents = true;
|
||||||
|
iconLocation = "Center";
|
||||||
|
sizeIconToButton = true;
|
||||||
|
makeIconSquare = true;
|
||||||
|
textLocation = "Bottom";
|
||||||
|
extent = %previewSize.x SPC %previewSize.y + %textBottomPad;
|
||||||
|
buttonType = "RadioButton";
|
||||||
|
buttonMargin = "0 -10";
|
||||||
|
profile = ToolsGuiDefaultIconBtnProfile;
|
||||||
|
tooltip = %this.previewData.tooltip;
|
||||||
|
assetBrowser = %this;
|
||||||
|
assetName = %assetName;
|
||||||
|
moduleName = %moduleName;
|
||||||
|
assetType = %assetType;
|
||||||
|
bitmapAsset = %this.previewData.previewImage;
|
||||||
|
Command = %this @ ".updateSelection( $ThisControl.assetName, $ThisControl.moduleName );";
|
||||||
|
altCommand = %doubleClickCommand;
|
||||||
|
text = %this.previewData.assetName;
|
||||||
|
originalAssetName = %this.previewData.assetName;
|
||||||
|
};
|
||||||
|
|
||||||
%previewButton.assetName = %assetName;
|
if(%previewScaleSize == 0 || startsWith(%this.dirHandler.currentAddress, "Creator"))
|
||||||
%previewButton.moduleName = %moduleName;
|
{
|
||||||
%previewButton.assetType = %assetType;
|
%previewButton.iconLocation = "Left";
|
||||||
%previewButton.assetBrowser = %this;
|
%previewButton.textLocation = "Right";
|
||||||
|
%previewButton.setextent(160,34);
|
||||||
|
%previewButton.buttonMargin = "8 8";
|
||||||
|
%previewButton.textMargin = "6";
|
||||||
|
|
||||||
|
%this.previewListMode = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%size = %previewSize.x * %previewScaleSize;
|
||||||
|
%previewButton.setextent(%size,%size + %textBottomPad);
|
||||||
|
|
||||||
|
%this.previewListMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
%previewButton.setBitmap(%this.previewData.previewImage);
|
|
||||||
|
|
||||||
%previewButton.profile = "AssetBrowserPreview" @ %previewButton.assetType;
|
|
||||||
%previewButton.tooltip = %this.previewData.tooltip;
|
|
||||||
%previewButton.Command = %this @ ".updateSelection( $ThisControl.assetName, $ThisControl.moduleName );";
|
|
||||||
%previewButton.altCommand = %doubleClickCommand;
|
|
||||||
|
|
||||||
%previewButton.text = %this.previewData.assetName;
|
|
||||||
%previewButton.text.originalAssetName = %this.previewData.assetName;
|
|
||||||
|
|
||||||
// add to the gui control array
|
// add to the gui control array
|
||||||
%this-->assetList.add(%previewButton);
|
%this-->assetList.add(%previewButton);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue