Expose horizontal/vertical custom_step as editor property for the ScrollContainer
This commit is contained in:
@@ -482,6 +482,22 @@ int ScrollContainer::get_v_scroll() const {
|
||||
return v_scroll->get_value();
|
||||
}
|
||||
|
||||
void ScrollContainer::set_horizontal_custom_step(float p_custom_step) {
|
||||
h_scroll->set_custom_step(p_custom_step);
|
||||
}
|
||||
|
||||
float ScrollContainer::get_horizontal_custom_step() const {
|
||||
return h_scroll->get_custom_step();
|
||||
}
|
||||
|
||||
void ScrollContainer::set_vertical_custom_step(float p_custom_step) {
|
||||
v_scroll->set_custom_step(p_custom_step);
|
||||
}
|
||||
|
||||
float ScrollContainer::get_vertical_custom_step() const {
|
||||
return v_scroll->get_custom_step();
|
||||
}
|
||||
|
||||
void ScrollContainer::set_horizontal_scroll_mode(ScrollMode p_mode) {
|
||||
if (horizontal_scroll_mode == p_mode) {
|
||||
return;
|
||||
@@ -570,6 +586,12 @@ void ScrollContainer::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_v_scroll", "value"), &ScrollContainer::set_v_scroll);
|
||||
ClassDB::bind_method(D_METHOD("get_v_scroll"), &ScrollContainer::get_v_scroll);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_horizontal_custom_step", "value"), &ScrollContainer::set_horizontal_custom_step);
|
||||
ClassDB::bind_method(D_METHOD("get_horizontal_custom_step"), &ScrollContainer::get_horizontal_custom_step);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_vertical_custom_step", "value"), &ScrollContainer::set_vertical_custom_step);
|
||||
ClassDB::bind_method(D_METHOD("get_vertical_custom_step"), &ScrollContainer::get_vertical_custom_step);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_horizontal_scroll_mode", "enable"), &ScrollContainer::set_horizontal_scroll_mode);
|
||||
ClassDB::bind_method(D_METHOD("get_horizontal_scroll_mode"), &ScrollContainer::get_horizontal_scroll_mode);
|
||||
|
||||
@@ -594,6 +616,8 @@ void ScrollContainer::_bind_methods() {
|
||||
ADD_GROUP("Scroll", "scroll_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "scroll_horizontal", PROPERTY_HINT_NONE, "suffix:px"), "set_h_scroll", "get_h_scroll");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "scroll_vertical", PROPERTY_HINT_NONE, "suffix:px"), "set_v_scroll", "get_v_scroll");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "scroll_horizontal_custom_step", PROPERTY_HINT_RANGE, "-1,4096,suffix:px"), "set_horizontal_custom_step", "get_horizontal_custom_step");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "scroll_vertical_custom_step", PROPERTY_HINT_RANGE, "-1,4096,suffix:px"), "set_vertical_custom_step", "get_vertical_custom_step");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "horizontal_scroll_mode", PROPERTY_HINT_ENUM, "Disabled,Auto,Always Show,Never Show"), "set_horizontal_scroll_mode", "get_horizontal_scroll_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "vertical_scroll_mode", PROPERTY_HINT_ENUM, "Disabled,Auto,Always Show,Never Show"), "set_vertical_scroll_mode", "get_vertical_scroll_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "scroll_deadzone"), "set_deadzone", "get_deadzone");
|
||||
|
||||
Reference in New Issue
Block a user