Several HTML widgets fixes.

This commit is contained in:
Martín Lucas Golini
2026-04-29 14:07:56 -03:00
parent 4ab9942e37
commit 04d69e2871
9 changed files with 140 additions and 55 deletions

View File

@@ -230,10 +230,10 @@ enum class PropertyId : Uint32 {
DisplayOptions = String::hash( "display-options" ),
MenuWidthMode = String::hash( "menu-width-mode" ),
ExpandText = String::hash( "expand-text" ),
Colspan = String::hash( "colspan" ),
ColSpan = String::hash( "colspan" ),
TableLayout = String::hash( "table-layout" ),
Cellpadding = String::hash( "cellpadding" ),
Cellspacing = String::hash( "cellspacing" ),
CellPadding = String::hash( "cellpadding" ),
CellSpacing = String::hash( "cellspacing" ),
Size = String::hash( "size" ),
Type = String::hash( "type" ),
Rows = String::hash( "rows" ),

View File

@@ -1,8 +1,8 @@
#ifndef EE_UI_TABLELAYOUTER_HPP
#define EE_UI_TABLELAYOUTER_HPP
#include <eepp/ui/uilayouter.hpp>
#include <eepp/core/small_vector.hpp>
#include <eepp/ui/uilayouter.hpp>
namespace EE { namespace UI {
@@ -17,17 +17,25 @@ enum class TableLayout { Auto, Fixed };
class EE_API TableLayouter : public UILayouter {
public:
TableLayouter( UIWidget* container ) : UILayouter( container ) {}
void updateLayout() override;
void computeIntrinsicWidths() override;
void setTableLayout( TableLayout layout );
TableLayout getTableLayout() const;
void setCellpadding( Float padding );
Float getCellpadding() const;
void setCellspacing( Float spacing );
Float getCellspacing() const;
void setCellPadding( Float padding );
Float getCellPadding() const;
void setCellSpacing( Float spacing );
Float getCellSpacing() const;
Float getMinIntrinsicWidth() override;
Float getMaxIntrinsicWidth() override;
protected:

View File

@@ -22,6 +22,11 @@ class EE_API UIHTMLTable : public UIHTMLWidget {
virtual Float getMaxIntrinsicWidth() const;
virtual std::vector<PropertyId> getPropertiesImplemented() const;
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
const Uint32& state = 0 ) const;
virtual bool applyProperty( const StyleSheetProperty& attribute );
protected:
@@ -43,14 +48,19 @@ class EE_API UIHTMLTableCell : public UIRichText {
virtual bool isType( const Uint32& type ) const;
virtual std::vector<PropertyId> getPropertiesImplemented() const;
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
const Uint32& state = 0 ) const;
virtual bool applyProperty( const StyleSheetProperty& attribute );
Uint32 getColspan() const;
Uint32 getColSpan() const;
virtual void onSizeChange();
protected:
Uint32 mColspan{ 1 };
Uint32 mColSpan{ 1 };
};
class EE_API UIHTMLTableRow : public UIHTMLWidget {

View File

@@ -42,8 +42,11 @@ class EE_API UIHTMLWidget : public UILayout {
int getZIndex() const { return mZIndex; }
void setZIndex( int zIndex );
virtual std::vector<PropertyId> getPropertiesImplemented() const;
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
const Uint32& state = 0 ) const;
virtual bool applyProperty( const StyleSheetProperty& attribute );
virtual void updateLayout();