Blame SOURCES/tigervnc-reduce-size-of-context-menu-hint.patch

e08d0e
From 9fbf94db8b85eeee1d233089243a0da71f5b544f Mon Sep 17 00:00:00 2001
e08d0e
From: Pierre Ossman <ossman@cendio.se>
e08d0e
Date: Thu, 19 Jul 2018 13:10:08 +0200
e08d0e
Subject: Reduce size of context menu hint
e08d0e
e08d0e
It can get a bit intrusive for experienced users, so try to reduce
e08d0e
the impact of it.
e08d0e
e08d0e
diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
e08d0e
index e8750b4e..d5edfb87 100644
e08d0e
--- a/vncviewer/DesktopWindow.cxx
e08d0e
+++ b/vncviewer/DesktopWindow.cxx
e08d0e
@@ -498,6 +498,9 @@ void DesktopWindow::menuOverlay(void* data)
e08d0e
 
e08d0e
 void DesktopWindow::setOverlay(const char* text, ...)
e08d0e
 {
e08d0e
+  const Fl_Fontsize fontsize = 16;
e08d0e
+  const int margin = 10;
e08d0e
+
e08d0e
   va_list ap;
e08d0e
   char textbuf[1024];
e08d0e
 
e08d0e
@@ -528,22 +531,22 @@ void DesktopWindow::setOverlay(const char* text, ...)
e08d0e
     fl_gc = XDefaultGC(fl_display, 0);
e08d0e
 #endif
e08d0e
 
e08d0e
-  fl_font(FL_HELVETICA, FL_NORMAL_SIZE * 2);
e08d0e
+  fl_font(FL_HELVETICA, fontsize);
e08d0e
   w = 0;
e08d0e
   fl_measure(textbuf, w, h);
e08d0e
 
e08d0e
   // Margins
e08d0e
-  w += 80;
e08d0e
-  h += 40;
e08d0e
+  w += margin * 2 * 2;
e08d0e
+  h += margin * 2;
e08d0e
 
e08d0e
   surface = new Fl_Image_Surface(w, h);
e08d0e
   surface->set_current();
e08d0e
 
e08d0e
   fl_rectf(0, 0, w, h, 0, 0, 0);
e08d0e
 
e08d0e
-  fl_font(FL_HELVETICA, FL_NORMAL_SIZE * 2);
e08d0e
+  fl_font(FL_HELVETICA, fontsize);
e08d0e
   fl_color(FL_WHITE);
e08d0e
-  fl_draw(textbuf, 40, 20 + fl_height() - fl_descent());
e08d0e
+  fl_draw(textbuf, 0, 0, w, h, FL_ALIGN_CENTER);
e08d0e
 
e08d0e
   imageText = surface->image();
e08d0e
   delete surface;