mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Inherit UIHTMLInput from UIHTMLWidget.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#ifndef EE_UI_UIHTMLINPUT_HPP
|
||||
#define EE_UI_UIHTMLINPUT_HPP
|
||||
|
||||
#include <eepp/ui/uihtmlwidget.hpp>
|
||||
#include <eepp/ui/uiwidget.hpp>
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
class EE_API UIHTMLInput : public UIWidget {
|
||||
class EE_API UIHTMLInput : public UIHTMLWidget {
|
||||
public:
|
||||
static UIHTMLInput* New();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ UIHTMLInput* UIHTMLInput::New() {
|
||||
return eeNew( UIHTMLInput, () );
|
||||
}
|
||||
|
||||
UIHTMLInput::UIHTMLInput() : UIWidget( "input" ) {
|
||||
UIHTMLInput::UIHTMLInput() : UIHTMLWidget( "input" ) {
|
||||
mFlags |= UI_HTML_ELEMENT;
|
||||
mWidthPolicy = SizePolicy::WrapContent;
|
||||
mHeightPolicy = SizePolicy::WrapContent;
|
||||
@@ -27,7 +27,7 @@ Uint32 UIHTMLInput::getType() const {
|
||||
}
|
||||
|
||||
bool UIHTMLInput::isType( const Uint32& type ) const {
|
||||
return UIHTMLInput::getType() == type || UIWidget::isType( type );
|
||||
return UIHTMLInput::getType() == type || UIHTMLWidget::isType( type );
|
||||
}
|
||||
|
||||
bool UIHTMLInput::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
@@ -48,14 +48,15 @@ bool UIHTMLInput::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ( id != PropertyId::Id && id != PropertyId::Class && id != PropertyId::Type ) {
|
||||
if ( id != PropertyId::Id && id != PropertyId::Class && id != PropertyId::Type &&
|
||||
id != PropertyId::Display ) {
|
||||
mProperties[id] = attribute;
|
||||
if ( mChildWidget ) {
|
||||
mChildWidget->applyProperty( attribute );
|
||||
}
|
||||
}
|
||||
|
||||
return UIWidget::applyProperty( attribute );
|
||||
return UIHTMLWidget::applyProperty( attribute );
|
||||
}
|
||||
|
||||
std::string UIHTMLInput::getPropertyString( const PropertyDefinition* propertyDef,
|
||||
@@ -78,11 +79,11 @@ std::string UIHTMLInput::getPropertyString( const PropertyDefinition* propertyDe
|
||||
return val;
|
||||
}
|
||||
|
||||
return UIWidget::getPropertyString( propertyDef, propertyIndex );
|
||||
return UIHTMLWidget::getPropertyString( propertyDef, propertyIndex );
|
||||
}
|
||||
|
||||
std::vector<PropertyId> UIHTMLInput::getPropertiesImplemented() const {
|
||||
auto props = UIWidget::getPropertiesImplemented();
|
||||
auto props = UIHTMLWidget::getPropertiesImplemented();
|
||||
props.push_back( PropertyId::Type );
|
||||
props.push_back( PropertyId::Value );
|
||||
return props;
|
||||
@@ -172,7 +173,7 @@ String UIHTMLInput::getFormValue() const {
|
||||
}
|
||||
|
||||
void UIHTMLInput::onSizeChange() {
|
||||
UIWidget::onSizeChange();
|
||||
UIHTMLWidget::onSizeChange();
|
||||
}
|
||||
|
||||
}} // namespace EE::UI
|
||||
|
||||
@@ -50,6 +50,7 @@ void UIHTMLWidget::onDisplayChange() {
|
||||
|
||||
void UIHTMLWidget::setDisplay( CSSDisplay display ) {
|
||||
if ( mDisplay != display ) {
|
||||
auto oldDisplay = mDisplay;
|
||||
mDisplay = display;
|
||||
mNodeFlags |= NODE_FLAG_OVER_FIND_ALLOWED;
|
||||
|
||||
@@ -62,8 +63,12 @@ void UIHTMLWidget::setDisplay( CSSDisplay display ) {
|
||||
setLayoutWidthPolicy( SizePolicy::MatchParent );
|
||||
} else if ( mDisplay == CSSDisplay::None ) {
|
||||
mNodeFlags &= ~NODE_FLAG_OVER_FIND_ALLOWED;
|
||||
setVisible( false );
|
||||
}
|
||||
|
||||
if ( oldDisplay == CSSDisplay::None )
|
||||
setVisible( true );
|
||||
|
||||
onDisplayChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ EE_MAIN_FUNC int main( int argc, char** argv ) {
|
||||
Log::instance()->setLiveWrite( true );
|
||||
|
||||
Http::setDefaultUserAgent( "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like "
|
||||
"Gecko) eepp-html/0.0.1 Chrome/140.0.0.0 Safari/537.36" );
|
||||
"Gecko) Chrome/148.0.0.0 Safari/537.36" );
|
||||
|
||||
auto win = app.getWindow();
|
||||
auto ui = app.getUI();
|
||||
|
||||
Reference in New Issue
Block a user