Fix QWidget.setEnable()/setDisable()
This commit is contained in:
parent
9f9e61289b
commit
78895a002f
@ -379,12 +379,6 @@
|
|||||||
bool result = this->instance->isWindowModified(); \
|
bool result = this->instance->isWindowModified(); \
|
||||||
return Napi::Boolean::New(env, result); \
|
return Napi::Boolean::New(env, result); \
|
||||||
} \
|
} \
|
||||||
Napi::Value setDisabled(const Napi::CallbackInfo& info) { \
|
|
||||||
Napi::Env env = info.Env(); \
|
|
||||||
bool disable = info[0].As<Napi::Boolean>().Value(); \
|
|
||||||
this->instance->setDisabled(disable); \
|
|
||||||
return env.Null(); \
|
|
||||||
} \
|
|
||||||
Napi::Value setHidden(const Napi::CallbackInfo& info) { \
|
Napi::Value setHidden(const Napi::CallbackInfo& info) { \
|
||||||
Napi::Env env = info.Env(); \
|
Napi::Env env = info.Env(); \
|
||||||
bool hidden = info[0].As<Napi::Boolean>().Value(); \
|
bool hidden = info[0].As<Napi::Boolean>().Value(); \
|
||||||
@ -598,7 +592,6 @@
|
|||||||
InstanceMethod("style", &WidgetWrapName::style), \
|
InstanceMethod("style", &WidgetWrapName::style), \
|
||||||
InstanceMethod("isWindow", &WidgetWrapName::isWindow), \
|
InstanceMethod("isWindow", &WidgetWrapName::isWindow), \
|
||||||
InstanceMethod("isWindowModified", &WidgetWrapName::isWindowModified), \
|
InstanceMethod("isWindowModified", &WidgetWrapName::isWindowModified), \
|
||||||
InstanceMethod("setDisabled", &WidgetWrapName::setDisabled), \
|
|
||||||
InstanceMethod("setHidden", &WidgetWrapName::setHidden), \
|
InstanceMethod("setHidden", &WidgetWrapName::setHidden), \
|
||||||
InstanceMethod("setVisible", &WidgetWrapName::setVisible), \
|
InstanceMethod("setVisible", &WidgetWrapName::setVisible), \
|
||||||
InstanceMethod("setWindowModified", &WidgetWrapName::setWindowModified), \
|
InstanceMethod("setWindowModified", &WidgetWrapName::setWindowModified), \
|
||||||
|
|||||||
@ -595,10 +595,10 @@ export abstract class NodeWidget<Signals extends QWidgetSignals> extends YogaWid
|
|||||||
this.native.repaint();
|
this.native.repaint();
|
||||||
}
|
}
|
||||||
setDisabled(disable: boolean): void {
|
setDisabled(disable: boolean): void {
|
||||||
this.native.setDisabled(disable);
|
this.setEnabled(!disable);
|
||||||
}
|
}
|
||||||
setEnabled(enabled: boolean): void {
|
setEnabled(enabled: boolean): void {
|
||||||
this.native.setEnabled(enabled);
|
this.setProperty('enabled', enabled);
|
||||||
}
|
}
|
||||||
setFocus(reason = FocusReason.OtherFocusReason): void {
|
setFocus(reason = FocusReason.OtherFocusReason): void {
|
||||||
this.native.setFocus(reason);
|
this.native.setFocus(reason);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user