Add spacers to the main toolbar

Originally committed to SVN as r5194.
This commit is contained in:
Thomas Goyne 2011-01-16 07:15:11 +00:00
parent 77cb5b75b8
commit f604e0bacd
3 changed files with 30 additions and 2 deletions

View File

@ -53,6 +53,7 @@ private:
enum ToolbarTypes {
Standard = 1,
Spacer = 100
};
void BuildToolbar(wxToolBar *toolbar, const json::Array& array);

View File

@ -12,6 +12,9 @@
"type" : 1,
"command" : "subtitle/save"
},
{
"type" : 100
},
{
"type" : 1,
"command" : "video/jump"
@ -32,6 +35,9 @@
"type" : 1,
"command" : "video/jump/end"
},
{
"type" : 100
},
{
"type" : 1,
"command" : "time/snap/start_video"
@ -52,6 +58,9 @@
"type" : 1,
"command" : "time/snap/frame"
},
{
"type" : 100
},
{
"type" : 1,
"command" : "tool/style/manager"
@ -68,14 +77,23 @@
"type" : 1,
"command" : "tool/font_collector"
},
{
"type" : 100
},
{
"type" : 1,
"command" : "am/manager"
},
{
"type" : 100
},
{
"type" : 1,
"command" : "tool/assdraw"
},
{
"type" : 100
},
{
"type" : 1,
"command" : "time/shift"
@ -104,6 +122,9 @@
"type" : 1,
"command" : "subtitle/spellcheck"
},
{
"type" : 100
},
{
"type" : 1,
"command" : "app/options"
@ -111,6 +132,9 @@
{
"type" : 1,
"command" : "grid/tag/cycle_hiding"
},
{
"type" : 100
}
]
}

View File

@ -71,8 +71,11 @@ void Toolbar::BuildToolbar(wxToolBar *toolbar, const json::Array& array) {
for (json::Array::const_iterator index(array.Begin()); index != array.End(); index++) {
const json::Object& obj = *index;
const json::Number& type_number = obj["type"];
int type = type_number.Value();
int type = static_cast<json::Number>(obj["type"]).Value();
if (type == Toolbar::Spacer) {
toolbar->AddSeparator();
continue;
}
const json::String& command = obj["command"];
cmd::Command *cmd = cmd::get(command.Value());