Commit 25b118a0 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

Merge branch 'develop' into feature/parameterReader

parents c54b99e5 3626d16a
......@@ -12,8 +12,6 @@
##
### Code:
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/examples)
add_subdirectory(dtkWidgetsLayout)
add_subdirectory(dtkWidgetsMenu)
add_subdirectory(dtkWidgetsOverlayPaneItems)
......
......@@ -234,7 +234,7 @@ dtkWidgetsMenuItemParameterFacade::dtkWidgetsMenuItemParameterFacade(dtkWidgetsM
QFormLayout *layout = new QFormLayout(this);
layout->addRow(source->title(), source->widget());
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
}
dtkWidgetsMenuItemParameterFacade::~dtkWidgetsMenuItemParameterFacade(void)
......
......@@ -214,6 +214,7 @@ void dtkWidgetsMenuBarButton::touch(bool selected)
}
this->setPixmap(dtkFontAwesome::instance()->icon(this->icon_id).pixmap(QSize(::size * 3 / 4, ::size * 3 / 4)));
dtkThemesEngine::instance()->polish(this);
}
......
#!/usr/bin/env python3
import json
import argparse
def parse_group(json_o, type_map):
for c in json_o["contents"]:
if 'group' in c:
parse_group(c['group'], type_map)
else:
uid = c['parameter']['uid']
newtype = c['parameter']['type']
del c['parameter']['type']
type_map[uid] = newtype
parser = argparse.ArgumentParser(description='Process Convert dtk parameters file to new format (type in def).')
parser.add_argument('def_file', help='definition file')
parser.add_argument('menu_file', help='menu file')
args = parser.parse_args()
def_data = open(args.def_file)
menu_data = open(args.menu_file)
def_json = json.load(def_data)
menu_json = json.load(menu_data)
type_map = {}
for c in menu_json["contents"]:
parse_group(c['group'], type_map)
for uid in def_json["contents"].keys():
if uid in type_map:
def_json["contents"][uid]['type'] = type_map[uid]
else:
print(uid, "not used !")
with open('new_menu.json', 'w') as outfile:
print("write new_menu.json")
json.dump(menu_json, outfile, indent = 4,)
with open('new_definition.json', 'w') as outfile:
print("write new_definition.json")
json.dump(def_json, outfile, indent = 4,)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment