summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/root.c')
-rw-r--r--src/ui/root.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 247faf38..2eca982c 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -304,6 +304,12 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) {
304 } 304 }
305 return iTrue; 305 return iTrue;
306 } 306 }
307 else if (equal_Command(cmd, "splitmenu.open")) {
308 iWidget *menu = findWidget_Root("splitmenu");
309 openMenu_Widget(menu, zero_I2());
310 setPos_Widget(menu, sub_I2(divi_I2(size_Root(get_Root()), 2), divi_I2(menu->rect.size, 2)));
311 return iTrue;
312 }
307 else if (equal_Command(cmd, "contextclick")) { 313 else if (equal_Command(cmd, "contextclick")) {
308 iBool showBarMenu = iFalse; 314 iBool showBarMenu = iFalse;
309 if (equal_Rangecc(range_Command(cmd, "id"), "buttons")) { 315 if (equal_Rangecc(range_Command(cmd, "id"), "buttons")) {
@@ -879,7 +885,7 @@ void updateMetrics_Root(iRoot *d) {
879} 885}
880 886
881void createUserInterface_Root(iRoot *d) { 887void createUserInterface_Root(iRoot *d) {
882 iWidget *root = d->widget = new_Widget(); 888 iWidget *root = d->widget = new_Widget();
883 iAssert(root->root == d); 889 iAssert(root->root == d);
884 setId_Widget(root, "root"); 890 setId_Widget(root, "root");
885 /* Children of root cover the entire window. */ 891 /* Children of root cover the entire window. */
@@ -1231,9 +1237,22 @@ void createUserInterface_Root(iRoot *d) {
1231 { clipboard_Icon " ${menu.paste}", 0, 0, "input.paste" }, 1237 { clipboard_Icon " ${menu.paste}", 0, 0, "input.paste" },
1232 }, 1238 },
1233 4); 1239 4);
1240 iWidget *splitMenu = makeMenu_Widget(root, (iMenuItem[]){
1241 { "Single Frame", '1', 0, "ui.frames arg:0" },
1242 { "---", 0, 0, NULL },
1243 { "Horizontal", '2', 0, "ui.frames arg:3 axis:0" },
1244 { "Horizontal 1:2", SDLK_d, 0, "ui.frames arg:1 axis:0" },
1245 { "Horizontal 2:1", SDLK_e, 0, "ui.frames arg:2 axis:0" },
1246 { "---", 0, 0, NULL },
1247 { "Vertical", '3', 0, "ui.frames arg:3 axis:1" },
1248 { "Vertical 1:2", SDLK_f, 0, "ui.frames arg:1 axis:1" },
1249 { "Vertical 2:1", SDLK_r, 0, "ui.frames arg:2 axis:1" },
1250 }, 9);
1251 setFlags_Widget(splitMenu, disabledWhenHidden_WidgetFlag, iTrue); /* enabled when open */
1234 setId_Widget(tabsMenu, "doctabs.menu"); 1252 setId_Widget(tabsMenu, "doctabs.menu");
1235 setId_Widget(barMenu, "barmenu"); 1253 setId_Widget(barMenu, "barmenu");
1236 setId_Widget(clipMenu, "clipmenu"); 1254 setId_Widget(clipMenu, "clipmenu");
1255 setId_Widget(splitMenu, "splitmenu");
1237 } 1256 }
1238 /* Global keyboard shortcuts. */ { 1257 /* Global keyboard shortcuts. */ {
1239 addAction_Widget(root, 'l', KMOD_PRIMARY, "navigate.focus"); 1258 addAction_Widget(root, 'l', KMOD_PRIMARY, "navigate.focus");
@@ -1248,6 +1267,7 @@ void createUserInterface_Root(iRoot *d) {
1248 addAction_Widget(root, '3', rightSidebar_KeyModifier, "sidebar2.mode arg:2 toggle:1"); 1267 addAction_Widget(root, '3', rightSidebar_KeyModifier, "sidebar2.mode arg:2 toggle:1");
1249 addAction_Widget(root, '4', rightSidebar_KeyModifier, "sidebar2.mode arg:3 toggle:1"); 1268 addAction_Widget(root, '4', rightSidebar_KeyModifier, "sidebar2.mode arg:3 toggle:1");
1250 addAction_Widget(root, '5', rightSidebar_KeyModifier, "sidebar2.mode arg:4 toggle:1"); 1269 addAction_Widget(root, '5', rightSidebar_KeyModifier, "sidebar2.mode arg:4 toggle:1");
1270 addAction_Widget(root, SDLK_j, KMOD_PRIMARY, "splitmenu.open");
1251 } 1271 }
1252 updateMetrics_Root(d); 1272 updateMetrics_Root(d);
1253} 1273}