Revert old Material palette style

https://files.facepunch.com/louie/1b1611b1/sbox-dev_ryYgKhzZ5X.png
This commit is contained in:
bakscratch
2025-12-17 00:13:37 +00:00
committed by GitHub
parent 84f0839ee4
commit dd62d51b63
2 changed files with 17 additions and 18 deletions

View File

@@ -16,19 +16,18 @@ class ActiveMaterialWidget : ControlWidget
ToolTip = "";
_paletteStrip = Layout.Add( new MaterialPaletteWidget() );
_paletteStrip.MaterialClicked += OnPaletteMaterialClicked;
_paletteStrip.FixedHeight = FixedHeight - 8;
_paletteStrip.FixedWidth = 64;
_paletteStrip.GetActiveMaterial = () => _materialWidget.Material;
Layout.AddSpacingCell( 1 );
_materialWidget = Layout.Add( new MaterialWidget() );
_materialWidget.ToolTip = "Active Material";
_materialWidget.FixedSize = FixedHeight - 22;
_materialWidget.Cursor = CursorShape.Finger;
Layout.AddSpacingCell( 1 );
_paletteStrip = Layout.Add( new MaterialPaletteWidget() );
_paletteStrip.MaterialClicked += OnPaletteMaterialClicked;
_paletteStrip.FixedHeight = FixedHeight - 8;
_paletteStrip.FixedWidth = 64;
_paletteStrip.GetActiveMaterial = () => _materialWidget.Material;
Frame();
}
@@ -98,7 +97,7 @@ class ActiveMaterialWidget : ControlWidget
base.OnMouseClick( e );
// If we are selecting the Material Widget continue. (Probably better way of doing this)
if ( _materialWidget.ContentRect.IsInside( e.LocalPosition ) )
if ( !_materialWidget.ContentRect.IsInside( e.LocalPosition ) )
return;
if ( ReadOnly ) return;

View File

@@ -502,21 +502,21 @@ public class MaterialPaletteWidget : Widget
}
else
{
var baseFill = Theme.ControlBackground;
var baseLine = Color.Transparent;
var iconColor = Theme.TextLight;
var baseFill = Theme.Text.WithAlpha( 0.01f );
var baseLine = Theme.Text.WithAlpha( 0.1f );
var iconColor = Theme.Text.WithAlpha( 0.1f );
if ( Paint.HasMouseOver )
{
baseFill = Theme.ControlBackground;
baseLine = Color.Transparent;
iconColor = Theme.TextLight.Lighten( 0.8f );
baseFill = Theme.Text.WithAlpha( 0.04f );
baseLine = Theme.Text.WithAlpha( 0.2f );
iconColor = Theme.Text.WithAlpha( 0.2f );
}
else
{
baseFill = Theme.ControlBackground;
baseLine = Color.Transparent;
iconColor = Theme.TextLight;
baseFill = Theme.Text.WithAlpha( 0.01f );
baseLine = Theme.Text.WithAlpha( 0.1f );
iconColor = Theme.Text.WithAlpha( 0.1f );
}
if ( _isValidDropHover )