mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Show visual notice for visibility on Scene Dock
(cherry picked from commit f33e21e7af)
This commit is contained in:
parent
580031e6f5
commit
f520e7788e
4 changed files with 28 additions and 3 deletions
|
|
@ -554,6 +554,15 @@ void TreeItem::set_button(int p_column,int p_idx,const Ref<Texture>& p_button){
|
|||
|
||||
}
|
||||
|
||||
void TreeItem::set_button_color(int p_column,int p_idx,const Color& p_color) {
|
||||
|
||||
ERR_FAIL_INDEX( p_column, cells.size() );
|
||||
ERR_FAIL_INDEX( p_idx, cells[p_column].buttons.size() );
|
||||
cells[p_column].buttons[p_idx].color=p_color;
|
||||
_changed_notify(p_column);
|
||||
|
||||
}
|
||||
|
||||
void TreeItem::set_editable(int p_column,bool p_editable) {
|
||||
|
||||
ERR_FAIL_INDEX( p_column, cells.size() );
|
||||
|
|
@ -1042,7 +1051,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
|
|||
o.y+=(label_h-s.height)/2;
|
||||
o+=cache.button_pressed->get_offset();
|
||||
|
||||
b->draw(ci,o,p_item->cells[i].buttons[j].disabled?Color(1,1,1,0.5):Color(1,1,1,1));
|
||||
b->draw(ci,o,p_item->cells[i].buttons[j].disabled?Color(1,1,1,0.5):p_item->cells[i].buttons[j].color);
|
||||
w-=s.width+cache.button_margin;
|
||||
bw+=s.width+cache.button_margin;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,8 @@ friend class Tree;
|
|||
int id;
|
||||
bool disabled;
|
||||
Ref<Texture> texture;
|
||||
Button() { id=0; disabled=false; }
|
||||
Color color;
|
||||
Button() { id=0; disabled=false; color=Color(1,1,1,1); }
|
||||
};
|
||||
|
||||
Vector< Button > buttons;
|
||||
|
|
@ -185,6 +186,7 @@ public:
|
|||
int get_button_by_id(int p_column,int p_id) const;
|
||||
bool is_button_disabled(int p_column,int p_idx) const;
|
||||
void set_button(int p_column,int p_idx,const Ref<Texture>& p_button);
|
||||
void set_button_color(int p_column,int p_idx,const Color& p_color);
|
||||
|
||||
/* range works for mode number or mode combo */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue