Merge pull request #983 from Areloch/GuiPanelDeGradient

Removes the unnecessary gradient effect from GuiPanel when rendered.
This commit is contained in:
Brian Roberts 2023-03-04 21:32:49 -06:00 committed by GitHub
commit f1d42d3867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -33,9 +33,7 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
ConsoleDocClass( GuiPanel, ConsoleDocClass( GuiPanel,
"@brief The GuiPanel panel is a container that when opaque will " "@brief The GuiPanel panel is a container that when rendered will fill with the gui profile's fill color.\n\n"
"draw a left to right gradient using its profile fill and "
"fill highlight colors.\n\n"
"@tsexample\n" "@tsexample\n"
"// Mandatory GuiDefaultProfile\n" "// Mandatory GuiDefaultProfile\n"
@ -44,7 +42,6 @@ ConsoleDocClass( GuiPanel,
"new GuiControlProfile (GuiDefaultProfile)\n" "new GuiControlProfile (GuiDefaultProfile)\n"
"{\n" "{\n"
" // fill color\n" " // fill color\n"
" opaque = false;\n"
" fillColor = \"242 241 240\";\n" " fillColor = \"242 241 240\";\n"
" fillColorHL =\"228 228 235\";\n" " fillColorHL =\"228 228 235\";\n"
" fillColorSEL = \"98 100 137\";\n" " fillColorSEL = \"98 100 137\";\n"
@ -99,7 +96,7 @@ void GuiPanel::onRender(Point2I offset, const RectI &updateRect)
// Draw a gradient left to right. // Draw a gradient left to right.
PrimBuild::begin( GFXTriangleStrip, 4 ); PrimBuild::begin( GFXTriangleStrip, 4 );
PrimBuild::color( mProfile->mFillColorHL ); PrimBuild::color( mProfile->mFillColor);
PrimBuild::vertex2i( ctrlRect.point.x, ctrlRect.point.y ); PrimBuild::vertex2i( ctrlRect.point.x, ctrlRect.point.y );
PrimBuild::vertex2i( ctrlRect.point.x, ctrlRect.point.y + ctrlRect.extent.y ); PrimBuild::vertex2i( ctrlRect.point.x, ctrlRect.point.y + ctrlRect.extent.y );
@ -110,4 +107,4 @@ void GuiPanel::onRender(Point2I offset, const RectI &updateRect)
} }
Parent::onRender( offset, updateRect ); Parent::onRender( offset, updateRect );
} }

View file

@ -33,9 +33,7 @@
#endif #endif
/// The GuiPanel panel is a container that when opaque will /// The GuiPanel panel is a container that when rendered will render with the profile's fill colors
/// draw a left to right gradient using its profile fill and
/// fill highlight colors.
/// ///
/// @addtogroup gui_container_group Containers /// @addtogroup gui_container_group Containers
/// ///
@ -59,4 +57,4 @@ public:
}; };
/// @} /// @}
#endif // _GUI_PANEL_H_ #endif // _GUI_PANEL_H_