-better integration of ndee's theme

This commit is contained in:
Juan Linietsky 2015-11-13 20:56:44 -03:00
parent 1d7e9c4ba5
commit 8420c24f7f
24 changed files with 63 additions and 33 deletions

View file

@ -962,7 +962,9 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
Point2i guide_space=Point2i( cache.guide_width , height );
if (p_item->childs) { //has childs, draw the guide box
if (!hide_folding && p_item->childs) { //has childs, draw the guide box
Ref<Texture> arrow;
@ -986,7 +988,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
int font_ascent=font->get_ascent();
int ofs = p_pos.x + cache.item_margin;
int ofs = p_pos.x + (hide_folding?cache.hseparation:cache.item_margin);
for (int i=0;i<columns.size();i++) {
int w = get_column_width(i);
@ -1062,7 +1064,10 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
if (p_item->cells[i].custom_bg_color) {
VisualServer::get_singleton()->canvas_item_add_rect(ci,cell_rect,p_item->cells[i].bg_color);
Rect2 r=cell_rect;
r.pos.x-=cache.hseparation;
r.size.x+=cache.hseparation;
VisualServer::get_singleton()->canvas_item_add_rect(ci,r,p_item->cells[i].bg_color);
}
Color col=p_item->cells[i].custom_color?p_item->cells[i].color:get_color( p_item->cells[i].selected?"font_color_selected":"font_color");
@ -1376,7 +1381,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_
if (!skip && p_pos.y<item_h) {
// check event!
if (p_pos.x >=x_ofs && p_pos.x < (x_ofs+cache.item_margin) ) {
if (!hide_folding && (p_pos.x >=x_ofs && p_pos.x < (x_ofs+cache.item_margin) )) {
if (p_item->childs)
@ -3114,6 +3119,16 @@ bool Tree::can_cursor_exit_tree() const {
return cursor_can_exit_tree;
}
void Tree::set_hide_folding(bool p_hide) {
hide_folding=p_hide;
update();
}
bool Tree::is_folding_hidden() const {
return hide_folding;
}
void Tree::_bind_methods() {
@ -3155,6 +3170,9 @@ void Tree::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_column_title","column"),&Tree::get_column_title);
ObjectTypeDB::bind_method(_MD("get_scroll"),&Tree::get_scroll);
ObjectTypeDB::bind_method(_MD("set_hide_folding","hide"),&Tree::set_hide_folding);
ObjectTypeDB::bind_method(_MD("is_folding_hidden"),&Tree::is_folding_hidden);
ADD_SIGNAL( MethodInfo("item_selected"));
ADD_SIGNAL( MethodInfo("cell_selected"));
@ -3242,6 +3260,8 @@ Tree::Tree() {
pressing_for_editor=false;
range_drag_enabled=false;
hide_folding=false;
}

View file

@ -228,6 +228,7 @@ public:
void set_tooltip(int p_column, const String& p_tooltip);
String get_tooltip(int p_column) const;
void clear_children();
void move_to_top();
@ -410,6 +411,8 @@ friend class TreeItem;
bool drag_touching_deaccel;
bool click_handled;
bool hide_folding;
protected:
static void _bind_methods();
@ -467,6 +470,11 @@ public:
VScrollBar *get_vscroll_bar() { return v_scroll; }
void set_hide_folding(bool p_hide);
bool is_folding_hidden() const;
Tree();
~Tree();

View file

@ -22,12 +22,12 @@ void InstancePlaceholder::_get_property_list( List<PropertyInfo> *p_list) const{
}
void InstancePlaceholder::set_path(const String& p_name) {
void InstancePlaceholder::set_instance_path(const String& p_name) {
path=p_name;
}
String InstancePlaceholder::get_path() const {
String InstancePlaceholder::get_instance_path() const {
return path;
}
@ -66,6 +66,7 @@ void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_s
void InstancePlaceholder::_bind_methods() {
ObjectTypeDB::bind_method(_MD("replace_by_instance","custom_scene:PackedScene"),&InstancePlaceholder::replace_by_instance,DEFVAL(Variant()));
ObjectTypeDB::bind_method(_MD("get_instance_path"),&InstancePlaceholder::get_instance_path);
}
InstancePlaceholder::InstancePlaceholder() {

View file

@ -26,8 +26,8 @@ protected:
public:
void set_path(const String& p_name);
String get_path() const;
void set_instance_path(const String& p_name);
String get_instance_path() const;
void replace_by_instance(const Ref<PackedScene>& p_custom_scene=Ref<PackedScene>());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

After

Width:  |  Height:  |  Size: 601 B

View file

@ -460,10 +460,10 @@ void make_default_theme() {
// HScrollBar
t->set_stylebox("scroll","HScrollBar", make_stylebox( scroll_bg_png,3,3,3,3,0,0,0,0) );
t->set_stylebox("scroll_focus","HScrollBar", make_stylebox( scroll_bg_png,3,3,3,3,0,0,0,0) );
t->set_stylebox("grabber","HScrollBar", make_stylebox( scroll_grabber_png,3,3,3,3,2,2,2,2) );
t->set_stylebox("grabber_hilite","HScrollBar", make_stylebox( scroll_grabber_hl_png,3,3,3,3,2,2,2,2) );
t->set_stylebox("scroll","HScrollBar", make_stylebox( scroll_bg_png,5,5,5,5,0,0,0,0) );
t->set_stylebox("scroll_focus","HScrollBar", make_stylebox( scroll_bg_png,5,5,5,5,0,0,0,0) );
t->set_stylebox("grabber","HScrollBar", make_stylebox( scroll_grabber_png,5,5,5,5,2,2,2,2) );
t->set_stylebox("grabber_hilite","HScrollBar", make_stylebox( scroll_grabber_hl_png,5,5,5,5,2,2,2,2) );
t->set_icon("increment","HScrollBar",empty_icon);
t->set_icon("increment_hilite","HScrollBar",empty_icon);
@ -474,10 +474,10 @@ void make_default_theme() {
// VScrollBar
t->set_stylebox("scroll","VScrollBar", make_stylebox( scroll_bg_png,3,3,3,3,0,0,0,0) );
t->set_stylebox("scroll_focus","VScrollBar", make_stylebox( scroll_bg_png,3,3,3,3,0,0,0,0) );
t->set_stylebox("grabber","VScrollBar", make_stylebox( scroll_grabber_png,3,3,3,3,2,2,2,2) );
t->set_stylebox("grabber_hilite","VScrollBar", make_stylebox( scroll_grabber_hl_png,3,3,3,3,2,2,2,2) );
t->set_stylebox("scroll","VScrollBar", make_stylebox( scroll_bg_png,5,5,5,5,0,0,0,0) );
t->set_stylebox("scroll_focus","VScrollBar", make_stylebox( scroll_bg_png,5,5,5,5,0,0,0,0) );
t->set_stylebox("grabber","VScrollBar", make_stylebox( scroll_grabber_png,5,5,5,5,2,2,2,2) );
t->set_stylebox("grabber_hilite","VScrollBar", make_stylebox( scroll_grabber_hl_png,5,5,5,5,2,2,2,2) );
t->set_icon("increment","VScrollBar",empty_icon);
t->set_icon("increment_hilite","VScrollBar",empty_icon);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 411 B

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

After

Width:  |  Height:  |  Size: 385 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

After

Width:  |  Height:  |  Size: 555 B

View file

@ -124,7 +124,7 @@ Node *SceneState::instance(bool p_gen_edit_state) const {
ERR_FAIL_COND_V(!node,NULL);
} else {
InstancePlaceholder *ip = memnew( InstancePlaceholder );
ip->set_path(path);
ip->set_instance_path(path);
node=ip;
}
node->set_scene_instance_load_placeholder(true);

View file

@ -5560,9 +5560,9 @@ EditorNode::EditorNode() {
Globals::get_singleton()->set("debug/indicators_enabled",true);
Globals::get_singleton()->set("render/room_cull_enabled",false);
theme->set_color("prop_category","Editor",Color::hex(0x403d41ff));
theme->set_color("prop_section","Editor",Color::hex(0x383539ff));
theme->set_color("prop_subsection","Editor",Color::hex(0x343135ff));
theme->set_color("prop_category","Editor",Color::hex(0x3f3a44ff));
theme->set_color("prop_section","Editor",Color::hex(0x35313aff));
theme->set_color("prop_subsection","Editor",Color::hex(0x312e37ff));
theme->set_color("fg_selected","Editor",Color::html("ffbd8e8e"));
theme->set_color("fg_error","Editor",Color::html("ffbd8e8e"));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

After

Width:  |  Height:  |  Size: 191 B

View file

@ -3514,6 +3514,7 @@ PropertyEditor::PropertyEditor() {
tree->connect("button_pressed", this,"_edit_button");
custom_editor->connect("variant_changed", this,"_custom_editor_edited");
custom_editor->connect("resource_edit_request", this,"_resource_edit_request",make_binds(),CONNECT_DEFERRED);
tree->set_hide_folding(true);
capitalize_paths=true;
autoclear=false;