Use standard button sizes for button box buttons on windows and os x

This commit is contained in:
Kovid Goyal 2012-06-03 13:06:20 +05:30
parent 45d35b283e
commit 4d4de02e82
3 changed files with 15 additions and 1 deletions

View File

@ -9,6 +9,7 @@ let g:syntastic_cpp_include_dirs = [
\'/usr/include/qt4',
\'src/qtcurve/common', 'src/qtcurve',
\]
let g:syntastic_c_include_dirs = g:syntastic_cpp_include_dirs
fun! CalibreLog()
" Setup buffers to edit the calibre changelog and version info prior to

View File

@ -2611,7 +2611,12 @@ void qtcDefaultSettings(Options *opts)
opts->gbFactor=DEF_GB_FACTOR;
opts->gbLabel=GB_LBL_BOLD|GB_LBL_OUTSIDE;
#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
#if defined _WIN32 || defined __APPLE__
// Changed by Kovid to use standard button sizes on Windows/OS X
opts->stdBtnSizes=true;
#else
opts->stdBtnSizes=false;
#endif
opts->titlebarButtons=TITLEBAR_BUTTON_ROUND|TITLEBAR_BUTTON_HOVER_SYMBOL;
opts->titlebarIcon=TITLEBAR_ICON_NEXT_TO_TITLE;
#endif

View File

@ -8,7 +8,8 @@ __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.gui2 import Application
from PyQt4.Qt import (QDialog, QGridLayout, QListWidget, QDialogButtonBox)
from PyQt4.Qt import (QDialog, QGridLayout, QListWidget, QDialogButtonBox,
QPushButton, QTimer)
app = Application([], force_calibre_style=True)
@ -24,5 +25,12 @@ bb.accepted.connect(d.accept)
bb.rejected.connect(d.reject)
l.addWidget(bb, 2, 0, 1, 2)
b = QPushButton('Normal')
l.addWidget(b, 0, 1, 1, 1)
def print_button_sizes():
for b in d.findChildren(QPushButton):
print (unicode(b.text()), b.height())
QTimer.singleShot(5, print_button_sizes)
d.exec_()