From 1e7221b7daabdd057d88ca65956be187e6c0f75e Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 31 Jul 2011 15:06:41 +0200 Subject: Reintruduce support for setting menu title this was already present in the old menu files, but I did not notice, because generally the title is same as the label in the parent menu. Now menu title is set by the 'title' property, which falls back to 'label' if it's empty. --- src/MenuCreator.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 11bbabb..0b0baf7 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -293,7 +293,10 @@ createMenu_(FbTk::Menu &inject_into, lua::state &l, FbTk::StringConvertor &conv, lua::stack_sentry s(l, -1); l.checkstack(1); - inject_into.setLabel(getField(l, -1, "label", &conv)); + std::string title = getField(l, -1, "title", &conv); + if(title.empty()) + title = getField(l, -1, "label", &conv); + inject_into.setLabel(title); for(int i = 1; l.rawgeti(-1, i), !l.isnil(-1); ++i) { try { -- cgit v0.11.2