From f89020ad266d1e2b2ae73903f71bba1aac79f638 Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 30 Mar 2015 00:37:21 +0300 Subject: [PATCH] Highlight pending operation on toolbar, even if started via keyboard. --- src/graphicswin.cpp | 2 ++ src/toolbar.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index 60e1f7c..fef7f2b 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -945,6 +945,7 @@ void GraphicsWindow::MenuRequest(int id) { SS.TW.GoToScreen(TextWindow::SCREEN_TANGENT_ARC); SS.GW.ForceTextWindowShown(); SS.ScheduleShowTW(); + InvalidateGraphics(); // repaint toolbar } break; @@ -960,6 +961,7 @@ c: SS.GW.pending.operation = id; SS.GW.pending.description = s; SS.ScheduleShowTW(); + InvalidateGraphics(); // repaint toolbar break; case MNU_CONSTRUCTION: { diff --git a/src/toolbar.cpp b/src/toolbar.cpp index 3dadf85..2f8f1a7 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -168,7 +168,8 @@ bool GraphicsWindow::ToolbarDrawOrHitTest(int mx, int my, glRasterPos2i(x - 12, y - 12); glDrawPixels(24, 24, GL_RGB, GL_UNSIGNED_BYTE, Toolbar[i].image); - if(toolbarHovered == Toolbar[i].menu) { + if(toolbarHovered == Toolbar[i].menu || + pending.operation == Toolbar[i].menu) { // Highlight the hovered or pending item. glColor4d(1, 1, 0, 0.3); int boxhw = 15;