summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-06-08 07:34:27 +0200
committerGitHub <noreply@github.com>2017-06-08 07:34:27 +0200
commit606b4ee9dfeb68df58a2f3f3180dff4e982c1b45 (patch)
treebba49681ca602fcc51f66e2ad318e12e044f80dc /scene/gui
parent89a7fb35306dea9a9571f8886f5d84ed02dd3875 (diff)
parent50e5c7f9807d85fea1fe549fa357cbad737a7961 (diff)
Merge pull request #9051 from toger5/fixedScriptEditorListSeperation
fixed spacing for script editor script list
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/item_list.cpp29
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);
}