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 { enum ToolbarTypes {
Standard = 1, Standard = 1,
Spacer = 100
}; };
void BuildToolbar(wxToolBar *toolbar, const json::Array& array); void BuildToolbar(wxToolBar *toolbar, const json::Array& array);

View file

@ -12,6 +12,9 @@
"type" : 1, "type" : 1,
"command" : "subtitle/save" "command" : "subtitle/save"
}, },
{
"type" : 100
},
{ {
"type" : 1, "type" : 1,
"command" : "video/jump" "command" : "video/jump"
@ -32,6 +35,9 @@
"type" : 1, "type" : 1,
"command" : "video/jump/end" "command" : "video/jump/end"
}, },
{
"type" : 100
},
{ {
"type" : 1, "type" : 1,
"command" : "time/snap/start_video" "command" : "time/snap/start_video"
@ -52,6 +58,9 @@
"type" : 1, "type" : 1,
"command" : "time/snap/frame" "command" : "time/snap/frame"
}, },
{
"type" : 100
},
{ {
"type" : 1, "type" : 1,
"command" : "tool/style/manager" "command" : "tool/style/manager"
@ -68,14 +77,23 @@
"type" : 1, "type" : 1,
"command" : "tool/font_collector" "command" : "tool/font_collector"
}, },
{
"type" : 100
},
{ {
"type" : 1, "type" : 1,
"command" : "am/manager" "command" : "am/manager"
}, },
{
"type" : 100
},
{ {
"type" : 1, "type" : 1,
"command" : "tool/assdraw" "command" : "tool/assdraw"
}, },
{
"type" : 100
},
{ {
"type" : 1, "type" : 1,
"command" : "time/shift" "command" : "time/shift"
@ -104,6 +122,9 @@
"type" : 1, "type" : 1,
"command" : "subtitle/spellcheck" "command" : "subtitle/spellcheck"
}, },
{
"type" : 100
},
{ {
"type" : 1, "type" : 1,
"command" : "app/options" "command" : "app/options"
@ -111,6 +132,9 @@
{ {
"type" : 1, "type" : 1,
"command" : "grid/tag/cycle_hiding" "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++) { for (json::Array::const_iterator index(array.Begin()); index != array.End(); index++) {
const json::Object& obj = *index; const json::Object& obj = *index;
const json::Number& type_number = obj["type"]; int type = static_cast<json::Number>(obj["type"]).Value();
int type = type_number.Value(); if (type == Toolbar::Spacer) {
toolbar->AddSeparator();
continue;
}
const json::String& command = obj["command"]; const json::String& command = obj["command"];
cmd::Command *cmd = cmd::get(command.Value()); cmd::Command *cmd = cmd::get(command.Value());