diff options
author | toger5 <toger5@hotmail.de> | 2017-06-04 17:58:29 -0700 |
---|---|---|
committer | toger5 <toger5@hotmail.de> | 2017-06-07 02:41:08 -0700 |
commit | 50e5c7f9807d85fea1fe549fa357cbad737a7961 (patch) | |
tree | fa4743a750c23ded5c82f54ce3ab5fee7f5c34f6 /scene/gui | |
parent | 9e5efa4abd2a9cfdcf637cc393222948f8f6cc3f (diff) |
fixed overlapping of temp. colors (script editor)
+ added a little bit more spacing to the scripts in the script list.
the temp colors now expand to the vseperation, instead of having the same size than the stylebox
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/item_list.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 371cf929fe..2f0c7b9aaf 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -931,23 +931,26 @@ void ItemList::_notification(int p_what) { rcache.size.width = width - rcache.position.x; } - Rect2 r = rcache; - r.position += base_ofs; - - // Use stylebox to dimension potential bg color, even if not selected - r.position.x -= sbsel->get_margin(MARGIN_LEFT); - r.size.x += sbsel->get_margin(MARGIN_LEFT) + sbsel->get_margin(MARGIN_RIGHT); - r.position.y -= sbsel->get_margin(MARGIN_TOP); - r.size.y += sbsel->get_margin(MARGIN_TOP) + sbsel->get_margin(MARGIN_BOTTOM); - if (items[i].selected) { + Rect2 r = rcache; + r.position += base_ofs; + + // Use stylebox to dimension potential bg color + r.position.x -= sbsel->get_margin(MARGIN_LEFT); + r.size.x += sbsel->get_margin(MARGIN_LEFT) + sbsel->get_margin(MARGIN_RIGHT); + r.position.y -= sbsel->get_margin(MARGIN_TOP); + r.size.y += sbsel->get_margin(MARGIN_TOP) + sbsel->get_margin(MARGIN_BOTTOM); draw_style_box(sbsel, r); } + if (items[i].custom_bg.a > 0.001) { - r.position.x += 2; - r.size.x -= 4; - r.position.y += 2; - r.size.y -= 4; + + Rect2 r = rcache; + r.position += base_ofs; + + // Size rect to make the align the temperature colors + r.position.y -= vseparation / 2; + r.size.y += vseparation; draw_rect(r, items[i].custom_bg); } |