aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/color_picker.h
diff options
context:
space:
mode:
authorRémi Verschelde2017-03-05 16:44:50 +0100
committerRémi Verschelde2017-03-05 16:44:50 +0100
commit5dbf1809c6e3e905b94b8764e99491e608122261 (patch)
tree5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /scene/gui/color_picker.h
parent45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff)
downloadgodot-5dbf180.tar.gz
godot-5dbf180.tar.zst
godot-5dbf180.zip
A Whole New World (clang-format edition)
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
Diffstat (limited to 'scene/gui/color_picker.h')
-rw-r--r--scene/gui/color_picker.h45
1 files changed, 21 insertions, 24 deletions
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index d9db9c89f..bd1abeecb 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -29,23 +29,22 @@
#ifndef COLOR_PICKER_H
#define COLOR_PICKER_H
-#include "scene/gui/slider.h"
-#include "scene/gui/line_edit.h"
-#include "scene/gui/spin_box.h"
-#include "scene/gui/label.h"
+#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
+#include "scene/gui/check_button.h"
+#include "scene/gui/label.h"
+#include "scene/gui/line_edit.h"
#include "scene/gui/popup.h"
-#include "scene/gui/box_container.h"
+#include "scene/gui/slider.h"
+#include "scene/gui/spin_box.h"
#include "scene/gui/texture_rect.h"
#include "scene/gui/tool_button.h"
-#include "scene/gui/check_button.h"
class ColorPicker : public BoxContainer {
- GDCLASS(ColorPicker,BoxContainer);
+ GDCLASS(ColorPicker, BoxContainer);
private:
-
Control *screen;
Image last_capture;
Control *uv_edit;
@@ -69,10 +68,10 @@ private:
bool raw_mode_enabled;
bool updating;
bool changing_color;
- float h,s,v;
+ float h, s, v;
Color last_hsv;
- void _html_entered(const String& p_html);
+ void _html_entered(const String &p_html);
void _value_changed(double);
void _update_controls();
void _update_color();
@@ -80,28 +79,27 @@ private:
void _update_text_value();
void _text_type_toggled();
void _sample_draw();
- void _hsv_draw(int p_wich,Control *c);
+ void _hsv_draw(int p_wich, Control *c);
- void _uv_input(const InputEvent& p_input);
- void _w_input(const InputEvent& p_input);
- void _preset_input(const InputEvent& p_input);
- void _screen_input(const InputEvent& p_input);
+ void _uv_input(const InputEvent &p_input);
+ void _w_input(const InputEvent &p_input);
+ void _preset_input(const InputEvent &p_input);
+ void _screen_input(const InputEvent &p_input);
void _add_preset_pressed();
void _screen_pick_pressed();
protected:
-
void _notification(int);
static void _bind_methods();
-public:
+public:
void set_edit_alpha(bool p_show);
bool is_editing_alpha() const;
- void set_pick_color(const Color& p_color);
+ void set_pick_color(const Color &p_color);
Color get_pick_color() const;
- void add_preset(const Color& p_color);
+ void add_preset(const Color &p_color);
void set_raw_mode(bool p_enabled);
bool is_raw_mode() const;
@@ -112,21 +110,20 @@ public:
class ColorPickerButton : public Button {
- GDCLASS(ColorPickerButton,Button);
+ GDCLASS(ColorPickerButton, Button);
PopupPanel *popup;
ColorPicker *picker;
- void _color_changed(const Color& p_color);
+ void _color_changed(const Color &p_color);
virtual void pressed();
protected:
-
void _notification(int);
static void _bind_methods();
-public:
- void set_pick_color(const Color& p_color);
+public:
+ void set_pick_color(const Color &p_color);
Color get_pick_color() const;
void set_edit_alpha(bool p_show);