diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-25 08:23:43 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-08-25 08:23:43 +0300 |
commit | d7550e75941aae4eae27232006a94d6e8477127e (patch) | |
tree | 0b58103efe8ed03279b976642b1413ece04130ac /src/ui/window.c | |
parent | c94b766e35466e01494a0cbec136b24a87745003 (diff) |
Posting global commands
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index 709fc0e0..6291519a 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -140,13 +140,17 @@ static const iMenuItem viewMenuItems[] = { | |||
140 | }; | 140 | }; |
141 | 141 | ||
142 | static const iMenuItem helpMenuItems[] = { | 142 | static const iMenuItem helpMenuItems[] = { |
143 | { "Help", 0, 0, "open url:about:help" }, | 143 | { "Help", 0, 0, "!open url:about:help" }, |
144 | { "Release Notes", 0, 0, "open url:about:version" }, | 144 | { "Release Notes", 0, 0, "!open url:about:version" }, |
145 | }; | 145 | }; |
146 | #endif | 146 | #endif |
147 | 147 | ||
148 | static const iMenuItem identityMenuItems[] = { | 148 | static const iMenuItem identityMenuItems[] = { |
149 | { "New Identity...", SDLK_n, KMOD_PRIMARY | KMOD_SHIFT, "ident.new" }, | 149 | { "New Identity...", SDLK_n, KMOD_PRIMARY | KMOD_SHIFT, "ident.new" }, |
150 | #if !defined (iHaveNativeMenus) | ||
151 | { "---", 0, 0, NULL }, | ||
152 | { "Show Identities", '3', KMOD_PRIMARY, "sidebar.mode arg:2 show:1" }, | ||
153 | #endif | ||
150 | }; | 154 | }; |
151 | 155 | ||
152 | static const char *reloadCStr_ = "\U0001f503"; | 156 | static const char *reloadCStr_ = "\U0001f503"; |
@@ -299,7 +303,11 @@ static void setupUserInterface_Window(iWindow *d) { | |||
299 | setCommandHandler_Widget(navBar, handleNavBarCommands_); | 303 | setCommandHandler_Widget(navBar, handleNavBarCommands_); |
300 | addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f850", 0, 0, "navigate.back"))); | 304 | addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f850", 0, 0, "navigate.back"))); |
301 | addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f852", 0, 0, "navigate.forward"))); | 305 | addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f852", 0, 0, "navigate.forward"))); |
302 | addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f3e0", 0, 0, "navigate.home"))); | 306 | iLabelWidget *idMenu = |
307 | makeMenuButton_LabelWidget("\U0001f464", identityMenuItems, iElemCount(identityMenuItems)); | ||
308 | setAlignVisually_LabelWidget(idMenu, iTrue); | ||
309 | addChild_Widget(navBar, iClob(idMenu)); | ||
310 | //addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f464", 0, 0, "cert.client"))); | ||
303 | iLabelWidget *lock = | 311 | iLabelWidget *lock = |
304 | addChildFlags_Widget(navBar, | 312 | addChildFlags_Widget(navBar, |
305 | iClob(newIcon_LabelWidget("\U0001f513", 0, 0, "server.showcert")), | 313 | iClob(newIcon_LabelWidget("\U0001f513", 0, 0, "server.showcert")), |
@@ -314,11 +322,7 @@ static void setupUserInterface_Window(iWindow *d) { | |||
314 | setId_Widget( | 322 | setId_Widget( |
315 | addChild_Widget(navBar, iClob(newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"))), | 323 | addChild_Widget(navBar, iClob(newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"))), |
316 | "reload"); | 324 | "reload"); |
317 | iLabelWidget *idMenu = | 325 | addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f3e0", 0, 0, "navigate.home"))); |
318 | makeMenuButton_LabelWidget("\U0001f464", identityMenuItems, iElemCount(identityMenuItems)); | ||
319 | setAlignVisually_LabelWidget(idMenu, iTrue); | ||
320 | addChild_Widget(navBar, iClob(idMenu)); | ||
321 | //addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f464", 0, 0, "cert.client"))); | ||
322 | #if !defined (iHaveNativeMenus) | 326 | #if !defined (iHaveNativeMenus) |
323 | iLabelWidget *navMenu = | 327 | iLabelWidget *navMenu = |
324 | makeMenuButton_LabelWidget("\U0001d362", navMenuItems, iElemCount(navMenuItems)); | 328 | makeMenuButton_LabelWidget("\U0001d362", navMenuItems, iElemCount(navMenuItems)); |
@@ -523,6 +527,7 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { | |||
523 | } | 527 | } |
524 | /* Map mouse pointer coordinate to our coordinate system. */ | 528 | /* Map mouse pointer coordinate to our coordinate system. */ |
525 | if (event.type == SDL_MOUSEMOTION) { | 529 | if (event.type == SDL_MOUSEMOTION) { |
530 | setCursor_Window(d, SDL_SYSTEM_CURSOR_ARROW); /* default cursor */ | ||
526 | const iInt2 pos = coord_Window(d, event.motion.x, event.motion.y); | 531 | const iInt2 pos = coord_Window(d, event.motion.x, event.motion.y); |
527 | event.motion.x = pos.x; | 532 | event.motion.x = pos.x; |
528 | event.motion.y = pos.y; | 533 | event.motion.y = pos.y; |