diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-31 13:06:41 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-11-01 09:57:24 (GMT) |
commit | 6e6b6851bb41125cb4e2e4c2caa9b6ecce2168ee (patch) | |
tree | 7be067f12eae326417cfe35e672860ad06a000a7 /src | |
parent | fa82f62dde8a8c43f5bac93993e5a047be14c70f (diff) | |
download | fluxbox_paul-6e6b6851bb41125cb4e2e4c2caa9b6ecce2168ee.zip fluxbox_paul-6e6b6851bb41125cb4e2e4c2caa9b6ecce2168ee.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.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 01ea9b8..9898b61 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc | |||
@@ -292,7 +292,10 @@ createMenu_(FbTk::Menu &inject_into, lua::state &l, FbTk::StringConvertor &conv, | |||
292 | lua::stack_sentry s(l, -1); | 292 | lua::stack_sentry s(l, -1); |
293 | l.checkstack(1); | 293 | l.checkstack(1); |
294 | 294 | ||
295 | inject_into.setLabel(getField(l, -1, "label", &conv)); | 295 | std::string title = getField(l, -1, "title", &conv); |
296 | if(title.empty()) | ||
297 | title = getField(l, -1, "label", &conv); | ||
298 | inject_into.setLabel(title); | ||
296 | 299 | ||
297 | for(int i = 1; l.rawgeti(-1, i), !l.isnil(-1); ++i) { | 300 | for(int i = 1; l.rawgeti(-1, i), !l.isnil(-1); ++i) { |
298 | try { | 301 | try { |