Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.3, 2.0.4, and 2.0.5

stable qtlib: use "message-box" font globally on Windows

Since Qt uses unconfigurable system font for QWidget on Windows, there's
no way to change it. 960d3fa95b8f partially solves this issue, but even now
we cannot change the font for dialogs.

This patch fixes it by imitating the behavior of another multi-platform
toolkit, Gtk or XUL, instead of copying one of the native Windows apps.

Changeset 94010af8d9b6

Parent 309de148cd73

by Yuya Nishihara

Changes to one file · Browse files at 94010af8d9b6 Showing diff from parent 309de148cd73 Diff from another changeset...

 
463
464
465
466
467
468
 
 
 
469
470
471
 
474
475
476
477
 
478
479
480
 
463
464
465
 
 
 
466
467
468
469
470
471
 
474
475
476
 
477
478
479
480
@@ -463,9 +463,9 @@
  except ImportError:   return   - # On Windows, the font for main window seems to be determined by "icon" - # font, but Qt chooses uncustomizable system font. - lf = win32gui.SystemParametersInfo(win32con.SPI_GETICONTITLELOGFONT) + # use configurable font like GTK, Mozilla XUL or Eclipse SWT + ncm = win32gui.SystemParametersInfo(win32con.SPI_GETNONCLIENTMETRICS) + lf = ncm['lfMessageFont']   f = QFont(hglib.tounicode(lf.lfFaceName))   f.setItalic(lf.lfItalic)   if lf.lfWeight != win32con.FW_DONTCARE: @@ -474,7 +474,7 @@
  n, w = filter(lambda e: e[0] <= lf.lfWeight, weights)[-1]   f.setWeight(w)   f.setPixelSize(abs(lf.lfHeight)) - QApplication.setFont(f, 'QMainWindow') + QApplication.setFont(f, 'QWidget')    class PMButton(QPushButton):   """Toggle button with plus/minus icon images"""