mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Calibre style: Platform specific dialog button orders
This commit is contained in:
parent
b37a8caeb7
commit
d96a4cf700
@ -963,6 +963,7 @@ Style::Style()
|
|||||||
itsAnimateStep(0),
|
itsAnimateStep(0),
|
||||||
itsTitlebarHeight(0),
|
itsTitlebarHeight(0),
|
||||||
calibre_icon_map(QHash<int,QString>()),
|
calibre_icon_map(QHash<int,QString>()),
|
||||||
|
is_kde_session(False),
|
||||||
itsPos(-1, -1),
|
itsPos(-1, -1),
|
||||||
itsHoverWidget(0L),
|
itsHoverWidget(0L),
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
@ -977,6 +978,7 @@ Style::Style()
|
|||||||
, itsName(name)
|
, itsName(name)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
is_kde_session = (getenv("KDE_FULL_SESSION") != NULL);
|
||||||
const char *env=getenv(QTCURVE_PREVIEW_CONFIG);
|
const char *env=getenv(QTCURVE_PREVIEW_CONFIG);
|
||||||
if(env && 0==strcmp(env, QTCURVE_PREVIEW_CONFIG))
|
if(env && 0==strcmp(env, QTCURVE_PREVIEW_CONFIG))
|
||||||
{
|
{
|
||||||
@ -3602,7 +3604,14 @@ int Style::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *
|
|||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
case SH_DialogButtonLayout:
|
case SH_DialogButtonLayout:
|
||||||
return opts.gtkButtonOrder ? QDialogButtonBox::GnomeLayout : QDialogButtonBox::KdeLayout;
|
// Changed by Kovid to use platform specific button orders.
|
||||||
|
#ifdef _WIN32
|
||||||
|
return QDialogButtonBox::WinLayout;
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
return QDialogButtonBox::MacLayout;
|
||||||
|
#else
|
||||||
|
return is_kde_session ? QDialogButtonBox::KdeLayout : QDialogButtonBox::GnomeLayout;
|
||||||
|
#endif
|
||||||
case SH_MessageBox_TextInteractionFlags:
|
case SH_MessageBox_TextInteractionFlags:
|
||||||
return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse;
|
return Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse;
|
||||||
case SH_LineEdit_PasswordCharacter:
|
case SH_LineEdit_PasswordCharacter:
|
||||||
|
@ -355,6 +355,7 @@ class Style : public QCommonStyle
|
|||||||
mutable QList<int> itsMdiButtons[2]; // 0=left, 1=right
|
mutable QList<int> itsMdiButtons[2]; // 0=left, 1=right
|
||||||
mutable int itsTitlebarHeight;
|
mutable int itsTitlebarHeight;
|
||||||
QHash<int,QString> calibre_icon_map;
|
QHash<int,QString> calibre_icon_map;
|
||||||
|
bool is_kde_session;
|
||||||
|
|
||||||
// Required for Q3Header hover...
|
// Required for Q3Header hover...
|
||||||
QPoint itsPos;
|
QPoint itsPos;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user