mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!48999 【js】button FA模型涉及代回退
Merge pull request !48999 from yyuanche/FA_revert
This commit is contained in:
commit
ce9d2661ef
@ -35,20 +35,26 @@
|
||||
#include "frameworks/bridge/declarative_frontend/view_stack_processor.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
std::unique_ptr<ButtonModel> ButtonModel::instance_ = nullptr;
|
||||
std::mutex ButtonModel::mutex_;
|
||||
|
||||
ButtonModel* ButtonModel::GetInstance()
|
||||
{
|
||||
if (!instance_) {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (!instance_) {
|
||||
#ifdef NG_BUILD
|
||||
static NG::ButtonModelNG instance;
|
||||
return &instance;
|
||||
instance_.reset(new NG::ButtonModelNG());
|
||||
#else
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
static NG::ButtonModelNG instance;
|
||||
return &instance;
|
||||
} else {
|
||||
static Framework::ButtonModelImpl instance;
|
||||
return &instance;
|
||||
}
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
instance_.reset(new NG::ButtonModelNG());
|
||||
} else {
|
||||
instance_.reset(new Framework::ButtonModelImpl());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return instance_.get();
|
||||
}
|
||||
} // namespace OHOS::Ace
|
||||
|
||||
|
@ -32,26 +32,30 @@
|
||||
#include "core/components_ng/base/view_stack_processor.h"
|
||||
#include "core/components_ng/pattern/checkbox/checkbox_model_ng.h"
|
||||
#include "core/components_v2/inspector/inspector_constants.h"
|
||||
|
||||
namespace OHOS::Ace {
|
||||
namespace {
|
||||
constexpr float CHECK_BOX_MARK_SIZE_INVALID_VALUE = -1.0f;
|
||||
}
|
||||
std::unique_ptr<CheckBoxModel> CheckBoxModel::instance_ = nullptr;
|
||||
std::mutex CheckBoxModel::mutex_;
|
||||
|
||||
CheckBoxModel* CheckBoxModel::GetInstance()
|
||||
{
|
||||
if (!instance_) {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (!instance_) {
|
||||
#ifdef NG_BUILD
|
||||
static NG::CheckBoxModelNG instance;
|
||||
return &instance;
|
||||
instance_.reset(new NG::CheckBoxModelNG());
|
||||
#else
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
static NG::CheckBoxModelNG instance;
|
||||
return &instance;
|
||||
} else {
|
||||
static Framework::CheckBoxModelImpl instance;
|
||||
return &instance;
|
||||
}
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
instance_.reset(new NG::CheckBoxModelNG());
|
||||
} else {
|
||||
instance_.reset(new Framework::CheckBoxModelImpl());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return instance_.get();
|
||||
}
|
||||
} // namespace OHOS::Ace
|
||||
|
||||
|
@ -32,6 +32,9 @@
|
||||
|
||||
namespace OHOS::Ace {
|
||||
|
||||
std::unique_ptr<RadioModel> RadioModel::instance_ = nullptr;
|
||||
std::mutex RadioModel::mutex_;
|
||||
|
||||
enum class RadioIndicatorType {
|
||||
TICK = 0,
|
||||
DOT,
|
||||
@ -40,18 +43,21 @@ enum class RadioIndicatorType {
|
||||
|
||||
RadioModel* RadioModel::GetInstance()
|
||||
{
|
||||
if (!instance_) {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (!instance_) {
|
||||
#ifdef NG_BUILD
|
||||
static NG::RadioModelNG instance;
|
||||
return &instance;
|
||||
instance_.reset(new NG::RadioModelNG());
|
||||
#else
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
static NG::RadioModelNG instance;
|
||||
return &instance;
|
||||
} else {
|
||||
static Framework::RadioModelImpl instance;
|
||||
return &instance;
|
||||
}
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
instance_.reset(new NG::RadioModelNG());
|
||||
} else {
|
||||
instance_.reset(new Framework::RadioModelImpl());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return instance_.get();
|
||||
}
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
@ -22,20 +22,26 @@
|
||||
|
||||
namespace OHOS::Ace {
|
||||
|
||||
std::unique_ptr<RatingModel> RatingModel::instance_ = nullptr;
|
||||
std::mutex RatingModel::mutex_;
|
||||
|
||||
RatingModel* RatingModel::GetInstance()
|
||||
{
|
||||
if (!instance_) {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if (!instance_) {
|
||||
#ifdef NG_BUILD
|
||||
static NG::RatingModelNG instance;
|
||||
return &instance;
|
||||
instance_.reset(new NG::RatingModelNG());
|
||||
#else
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
static NG::RatingModelNG instance;
|
||||
return &instance;
|
||||
} else {
|
||||
static Framework::RatingModelImpl instance;
|
||||
return &instance;
|
||||
}
|
||||
if (Container::IsCurrentUseNewPipeline()) {
|
||||
instance_.reset(new NG::RatingModelNG());
|
||||
} else {
|
||||
instance_.reset(new Framework::RatingModelImpl());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return instance_.get();
|
||||
}
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
@ -293,8 +293,7 @@ void ButtonModelImpl::SetSize(const std::optional<Dimension>& width, const std::
|
||||
{
|
||||
if (width.has_value()) {
|
||||
SetWidth(width.value());
|
||||
}
|
||||
if (height.has_value()) {
|
||||
} else {
|
||||
SetHeight(height.value());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user