aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-07-31 13:06:41 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-18 21:04:25 (GMT)
commit1e7221b7daabdd057d88ca65956be187e6c0f75e (patch)
treed83e9b86232ced54adbc23412235f127b4f0032e /src
parent54ed350776d4f78de9aabb0273f085aa7c2ce124 (diff)
downloadfluxbox_pavel-1e7221b7daabdd057d88ca65956be187e6c0f75e.zip
fluxbox_pavel-1e7221b7daabdd057d88ca65956be187e6c0f75e.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/MenuCreator.cc5
1 files changed, 4 insertions, 1 deletions
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,
293 lua::stack_sentry s(l, -1); 293 lua::stack_sentry s(l, -1);
294 l.checkstack(1); 294 l.checkstack(1);
295 295
296 inject_into.setLabel(getField(l, -1, "label", &conv)); 296 std::string title = getField(l, -1, "title", &conv);
297 if(title.empty())
298 title = getField(l, -1, "label", &conv);
299 inject_into.setLabel(title);
297 300
298 for(int i = 1; l.rawgeti(-1, i), !l.isnil(-1); ++i) { 301 for(int i = 1; l.rawgeti(-1, i), !l.isnil(-1); ++i) {
299 try { 302 try {