summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/color_picker.cpp42
-rw-r--r--scene/gui/color_picker.h8
-rw-r--r--scene/gui/color_ramp_edit.cpp2
-rw-r--r--scene/gui/graph_node.cpp18
-rw-r--r--scene/gui/graph_node.h5
-rw-r--r--scene/gui/texture_button.cpp18
-rw-r--r--scene/gui/texture_button.h5
7 files changed, 31 insertions, 67 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index a0a7442849..da2fb1bc91 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -75,7 +75,7 @@ void ColorPicker::_update_controls() {
}
-void ColorPicker::set_color(const Color& p_color) {
+void ColorPicker::set_pick_color(const Color& p_color) {
color=p_color;
if (color != last_hsv) {
@@ -121,7 +121,7 @@ void ColorPicker::_value_changed(double) {
color.components[i] = scroll[i]->get_value()/(raw_mode_enabled?1.0:255.0);
}
- set_color(color);
+ set_pick_color(color);
_update_text_value();
@@ -139,7 +139,7 @@ void ColorPicker::_html_entered(const String& p_html) {
if (!is_inside_tree())
return;
- set_color(color);
+ set_pick_color(color);
emit_signal("color_changed",color);
}
@@ -208,7 +208,7 @@ void ColorPicker::_text_type_toggled()
_update_color();
}
-Color ColorPicker::get_color() const {
+Color ColorPicker::get_pick_color() const {
return color;
}
@@ -320,7 +320,7 @@ void ColorPicker::_uv_input(const InputEvent &ev) {
v=1.0-y/256.0;
color.set_hsv(h,s,v,color.a);
last_hsv = color;
- set_color(color);
+ set_pick_color(color);
_update_color();
emit_signal("color_changed", color);
} else {
@@ -336,7 +336,7 @@ void ColorPicker::_uv_input(const InputEvent &ev) {
v=1.0-y/256.0;
color.set_hsv(h,s,v,color.a);
last_hsv = color;
- set_color(color);
+ set_pick_color(color);
_update_color();
emit_signal("color_changed", color);
}
@@ -354,7 +354,7 @@ void ColorPicker::_w_input(const InputEvent &ev) {
}
color.set_hsv(h,s,v,color.a);
last_hsv = color;
- set_color(color);
+ set_pick_color(color);
_update_color();
emit_signal("color_changed", color);
} else if (ev.type == InputEvent::MOUSE_MOTION) {
@@ -365,7 +365,7 @@ void ColorPicker::_w_input(const InputEvent &ev) {
h=1.0-y/256.0;
color.set_hsv(h,s,v,color.a);
last_hsv = color;
- set_color(color);
+ set_pick_color(color);
_update_color();
emit_signal("color_changed", color);
}
@@ -376,7 +376,7 @@ void ColorPicker::_preset_input(const InputEvent &ev) {
const InputEventMouseButton &bev = ev.mouse_button;
if (bev.pressed && bev.button_index==BUTTON_LEFT) {
int index = bev.x/(preset->get_size().x/presets.size());
- set_color(presets[index]);
+ set_pick_color(presets[index]);
} else if (bev.pressed && bev.button_index==BUTTON_RIGHT) {
int index = bev.x/(preset->get_size().x/presets.size());
presets.erase(presets[index]);
@@ -425,7 +425,7 @@ void ColorPicker::_screen_input(const InputEvent &ev)
Color c( r[ofs+0]/255.0, r[ofs+1]/255.0, r[ofs+2]/255.0 );
- set_color(c);
+ set_pick_color(c);
}
}
}
@@ -451,8 +451,8 @@ void ColorPicker::_screen_pick_pressed()
void ColorPicker::_bind_methods() {
- ClassDB::bind_method(_MD("set_color","color"),&ColorPicker::set_color);
- ClassDB::bind_method(_MD("get_color"),&ColorPicker::get_color);
+ ClassDB::bind_method(_MD("set_pick_color","color"),&ColorPicker::set_pick_color);
+ ClassDB::bind_method(_MD("get_pick_color"),&ColorPicker::get_pick_color);
ClassDB::bind_method(_MD("set_raw_mode","mode"),&ColorPicker::set_raw_mode);
ClassDB::bind_method(_MD("is_raw_mode"),&ColorPicker::is_raw_mode);
ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPicker::set_edit_alpha);
@@ -584,7 +584,7 @@ ColorPicker::ColorPicker() :
//_update_color();
updating=false;
- set_color(Color(1,1,1));
+ set_pick_color(Color(1,1,1));
HBoxContainer *bbc = memnew( HBoxContainer );
@@ -632,20 +632,20 @@ void ColorPickerButton::_notification(int p_what) {
if (p_what==NOTIFICATION_DRAW) {
Ref<StyleBox> normal = get_stylebox("normal" );
- draw_rect(Rect2(normal->get_offset(),get_size()-normal->get_minimum_size()),picker->get_color());
+ draw_rect(Rect2(normal->get_offset(),get_size()-normal->get_minimum_size()),picker->get_pick_color());
}
}
-void ColorPickerButton::set_color(const Color& p_color){
+void ColorPickerButton::set_pick_color(const Color& p_color){
- picker->set_color(p_color);
+ picker->set_pick_color(p_color);
update();
emit_signal("color_changed",p_color);
}
-Color ColorPickerButton::get_color() const{
+Color ColorPickerButton::get_pick_color() const{
- return picker->get_color();
+ return picker->get_pick_color();
}
void ColorPickerButton::set_edit_alpha(bool p_show) {
@@ -665,15 +665,15 @@ ColorPicker *ColorPickerButton::get_picker() {
void ColorPickerButton::_bind_methods(){
- ClassDB::bind_method(_MD("set_color","color"),&ColorPickerButton::set_color);
- ClassDB::bind_method(_MD("get_color"),&ColorPickerButton::get_color);
+ ClassDB::bind_method(_MD("set_pick_color","color"),&ColorPickerButton::set_pick_color);
+ ClassDB::bind_method(_MD("get_pick_color"),&ColorPickerButton::get_pick_color);
ClassDB::bind_method(_MD("get_picker:ColorPicker"),&ColorPickerButton::get_picker);
ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPickerButton::set_edit_alpha);
ClassDB::bind_method(_MD("is_editing_alpha"),&ColorPickerButton::is_editing_alpha);
ClassDB::bind_method(_MD("_color_changed"),&ColorPickerButton::_color_changed);
ADD_SIGNAL( MethodInfo("color_changed",PropertyInfo(Variant::COLOR,"color")));
- ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color") );
+ ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_pick_color"),_SCS("get_pick_color") );
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"edit_alpha"),_SCS("set_edit_alpha"),_SCS("is_editing_alpha") );
}
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index b6f9e9a070..d9db9c89f7 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -98,8 +98,8 @@ public:
void set_edit_alpha(bool p_show);
bool is_editing_alpha() const;
- void set_color(const Color& p_color);
- Color get_color() const;
+ void set_pick_color(const Color& p_color);
+ Color get_pick_color() const;
void add_preset(const Color& p_color);
void set_raw_mode(bool p_enabled);
@@ -126,8 +126,8 @@ protected:
static void _bind_methods();
public:
- void set_color(const Color& p_color);
- Color get_color() const;
+ void set_pick_color(const Color& p_color);
+ Color get_pick_color() const;
void set_edit_alpha(bool p_show);
bool is_editing_alpha() const;
diff --git a/scene/gui/color_ramp_edit.cpp b/scene/gui/color_ramp_edit.cpp
index c3ed3d821d..5d5d6c31a2 100644
--- a/scene/gui/color_ramp_edit.cpp
+++ b/scene/gui/color_ramp_edit.cpp
@@ -60,7 +60,7 @@ void ColorRampEdit::_show_color_picker() {
if (grabbed==-1)
return;
Size2 ms = Size2(350, picker->get_combined_minimum_size().height+10);
- picker->set_color(points[grabbed].color);
+ picker->set_pick_color(points[grabbed].color);
popup->set_pos(get_global_pos()-Vector2(ms.width-get_size().width,ms.height));
popup->set_size(ms);
popup->popup();
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index 8b7b84910d..aa8c875f40 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -217,8 +217,8 @@ void GraphNode::_notification(int p_what) {
sb = get_stylebox( selected ? "selectedframe" : "frame");
}
- sb=sb->duplicate();
- sb->call("set_modulate",modulate);
+ //sb=sb->duplicate();
+ //sb->call("set_modulate",modulate);
Ref<Texture> port =get_icon("port");
Ref<Texture> close =get_icon("close");
Ref<Texture> resizer =get_icon("resizer");
@@ -675,16 +675,6 @@ void GraphNode::_gui_input(const InputEvent& p_ev) {
}
-void GraphNode::set_modulate(const Color &p_color) {
-
- modulate=p_color;
- update();
-}
-
-Color GraphNode::get_modulate() const{
-
- return modulate;
-}
void GraphNode::set_overlay(Overlay p_overlay) {
overlay=p_overlay;
@@ -758,9 +748,6 @@ void GraphNode::_bind_methods() {
ClassDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type);
ClassDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color);
- ClassDB::bind_method(_MD("set_modulate","color"),&GraphNode::set_modulate);
- ClassDB::bind_method(_MD("get_modulate"),&GraphNode::get_modulate);
-
ClassDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button);
ClassDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible);
@@ -788,7 +775,6 @@ GraphNode::GraphNode() {
show_close=false;
connpos_dirty=true;
set_mouse_filter(MOUSE_FILTER_PASS);
- modulate=Color(1,1,1,1);
comment=false;
resizeable=false;
resizing=false;
diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h
index a128426d38..9cb46fc49c 100644
--- a/scene/gui/graph_node.h
+++ b/scene/gui/graph_node.h
@@ -92,8 +92,6 @@ private:
Overlay overlay;
- Color modulate;
-
bool has_point(const Point2& p_point) const;
protected:
@@ -147,9 +145,6 @@ public:
Color get_connection_output_color(int p_idx);
- void set_modulate(const Color& p_color);
- Color get_modulate() const;
-
void set_overlay(Overlay p_overlay);
Overlay get_overlay() const;
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp
index 83cd853572..03e37e9d9f 100644
--- a/scene/gui/texture_button.cpp
+++ b/scene/gui/texture_button.cpp
@@ -120,13 +120,13 @@ void TextureButton::_notification(int p_what) {
if (texdraw.is_valid()) {
Rect2 drect(Point2(),texdraw->get_size()*scale);
- draw_texture_rect(texdraw,drect,false,modulate);
+ draw_texture_rect(texdraw,drect,false);
}
if (has_focus() && focused.is_valid()) {
Rect2 drect(Point2(),focused->get_size()*scale);
- draw_texture_rect(focused,drect,false,modulate);
+ draw_texture_rect(focused,drect,false);
};
@@ -143,7 +143,6 @@ void TextureButton::_bind_methods() {
ClassDB::bind_method(_MD("set_focused_texture","texture:Texture"),&TextureButton::set_focused_texture);
ClassDB::bind_method(_MD("set_click_mask","mask:BitMap"),&TextureButton::set_click_mask);
ClassDB::bind_method(_MD("set_texture_scale","scale"),&TextureButton::set_texture_scale);
- ClassDB::bind_method(_MD("set_modulate","color"),&TextureButton::set_modulate);
ClassDB::bind_method(_MD("get_normal_texture:Texture"),&TextureButton::get_normal_texture);
ClassDB::bind_method(_MD("get_pressed_texture:Texture"),&TextureButton::get_pressed_texture);
@@ -152,7 +151,6 @@ void TextureButton::_bind_methods() {
ClassDB::bind_method(_MD("get_focused_texture:Texture"),&TextureButton::get_focused_texture);
ClassDB::bind_method(_MD("get_click_mask:BitMap"),&TextureButton::get_click_mask);
ClassDB::bind_method(_MD("get_texture_scale"),&TextureButton::get_texture_scale);
- ClassDB::bind_method(_MD("get_modulate"),&TextureButton::get_modulate);
ADD_GROUP("Textures","texture_");
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_normal_texture"), _SCS("get_normal_texture"));
@@ -241,17 +239,7 @@ Size2 TextureButton::get_texture_scale() const{
return scale;
}
-void TextureButton::set_modulate(const Color& p_modulate) {
- modulate=p_modulate;
- update();
-}
-
-Color TextureButton::get_modulate() const {
- return modulate;
-}
-
-
TextureButton::TextureButton() {
scale=Size2(1.0, 1.0);
- modulate=Color(1,1,1);
+
}
diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h
index b6cb531c71..ef4d4d5b5b 100644
--- a/scene/gui/texture_button.h
+++ b/scene/gui/texture_button.h
@@ -42,8 +42,6 @@ class TextureButton : public BaseButton {
Ref<Texture> focused;
Ref<BitMap> click_mask;
Size2 scale;
- Color modulate;
-
protected:
@@ -71,9 +69,6 @@ public:
void set_texture_scale(Size2 p_scale);
Size2 get_texture_scale() const;
- void set_modulate(const Color& p_modulate);
- Color get_modulate() const;
-
TextureButton();
};