summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-21 19:00:25 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-21 19:01:00 -0300
commit0aa7242624fcd74eaf13db006274829c284fab3b (patch)
tree85ae8bc9d725f191da68f1b9ffe1e426025e8fb2 /scene/gui
parentc4d6e54e93431e94888c5594386bcd0aa22528ee (diff)
WIP new AudioServer, with buses, effects, etc.
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/texture_progress.cpp5
-rw-r--r--scene/gui/texture_rect.cpp2
-rw-r--r--scene/gui/tree.cpp24
-rw-r--r--scene/gui/tree.h5
-rw-r--r--scene/gui/video_player.cpp1
5 files changed, 32 insertions, 5 deletions
diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp
index f6a33b5643..7d8373976b 100644
--- a/scene/gui/texture_progress.cpp
+++ b/scene/gui/texture_progress.cpp
@@ -46,7 +46,9 @@ void TextureProgress::set_over_texture(const Ref<Texture>& p_texture) {
over=p_texture;
update();
- minimum_size_changed();
+ if (under.is_null()) {
+ minimum_size_changed();
+ }
}
Ref<Texture> TextureProgress::get_over_texture() const{
@@ -302,4 +304,5 @@ TextureProgress::TextureProgress()
rad_init_angle=0;
rad_center_off=Point2();
rad_max_degrees=360;
+ set_mouse_filter(MOUSE_FILTER_PASS);
}
diff --git a/scene/gui/texture_rect.cpp b/scene/gui/texture_rect.cpp
index cbb077ef5d..6a4b59c5ec 100644
--- a/scene/gui/texture_rect.cpp
+++ b/scene/gui/texture_rect.cpp
@@ -160,7 +160,7 @@ TextureRect::TextureRect() {
expand=false;
- set_mouse_filter(MOUSE_FILTER_IGNORE);
+ set_mouse_filter(MOUSE_FILTER_PASS);
stretch_mode=STRETCH_SCALE_ON_EXPAND;
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index c52283ecde..1a7392f27e 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1008,7 +1008,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
/* Draw label, if height fits */
- bool skip=(p_item==root && hide_root);
+ bool skip=(p_item==root && hide_root);
if (!skip && (p_pos.y+label_h-cache.offset.y)>0) {
@@ -1711,8 +1711,15 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
case TreeItem::CELL_MODE_CHECK: {
bring_up_editor=false; //checkboxes are not edited with editor
- p_item->set_checked(col, !c.checked);
- item_edited(col, p_item);
+ if (force_edit_checkbox_only_on_checkbox) {
+ if (x < cache.checked->get_width()) {
+ p_item->set_checked(col, !c.checked);
+ item_edited(col, p_item);
+ }
+ } else {
+ p_item->set_checked(col, !c.checked);
+ item_edited(col, p_item);
+ }
click_handled = true;
//p_item->edited_signal.call(col);
@@ -3555,6 +3562,16 @@ bool Tree::get_single_select_cell_editing_only_when_already_selected() const {
return force_select_on_already_selected;
}
+void Tree::set_edit_checkbox_cell_only_when_checkbox_is_pressed(bool p_enable) {
+
+ force_edit_checkbox_only_on_checkbox=p_enable;
+}
+
+bool Tree::get_edit_checkbox_cell_only_when_checkbox_is_pressed() const {
+
+ return force_edit_checkbox_only_on_checkbox;
+}
+
void Tree::set_allow_rmb_select(bool p_allow) {
@@ -3733,6 +3750,7 @@ Tree::Tree() {
force_select_on_already_selected=false;
allow_rmb_select=false;
+ force_edit_checkbox_only_on_checkbox=false;
set_clip_contents(true);
}
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index d715ff4772..351cc4cb50 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -452,6 +452,7 @@ friend class TreeItem;
bool scrolling;
bool force_select_on_already_selected;
+ bool force_edit_checkbox_only_on_checkbox;
bool hide_folding;
@@ -531,6 +532,10 @@ public:
void set_single_select_cell_editing_only_when_already_selected(bool p_enable);
bool get_single_select_cell_editing_only_when_already_selected() const;
+ void set_edit_checkbox_cell_only_when_checkbox_is_pressed(bool p_enable);
+ bool get_edit_checkbox_cell_only_when_checkbox_is_pressed() const;
+
+
void set_allow_rmb_select(bool p_allow);
bool get_allow_rmb_select() const;
diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp
index 907b5a771f..46c0eeca65 100644
--- a/scene/gui/video_player.cpp
+++ b/scene/gui/video_player.cpp
@@ -28,6 +28,7 @@
/*************************************************************************/
#include "video_player.h"
#include "os/os.h"
+#include "servers/audio_server.h"
/*
int VideoPlayer::InternalStream::get_channel_count() const {