]> git.eshelyaron.com Git - emacs.git/commitdiff
Use consistent font when displaying menu equivalent keys on Haiku
authorPo Lu <luangruo@yahoo.com>
Sun, 30 Jan 2022 05:20:15 +0000 (05:20 +0000)
committerPo Lu <luangruo@yahoo.com>
Sun, 30 Jan 2022 05:20:15 +0000 (05:20 +0000)
* src/haiku_support.cc (DrawContent): Set plain font when
drawing key text.

src/haiku_support.cc

index 2284953517f6df743befd5fcdc7d89a5460aee8c..794023c98e4bf46af2dddd89f1520f28a4bdbe9a 100644 (file)
@@ -1679,11 +1679,17 @@ public:
 
     if (key)
       {
-       BRect r = menu->Frame ();
-       int w = menu->StringWidth (key);
+       BRect r = Frame ();
+       int w;
+
+       menu->PushState ();
+       menu->ClipToRect (r);
+       menu->SetFont (be_plain_font);
+       w = menu->StringWidth (key);
        menu->MovePenTo (BPoint (BE_RECT_WIDTH (r) - w - 4,
                                 menu->PenLocation ().y));
        menu->DrawString (key);
+       menu->PopState ();
       }
   }