mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
mostly mac/win cruft removal
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
a6af900561
commit
45ecee79de
9 changed files with 18 additions and 143 deletions
|
@ -215,7 +215,6 @@ QString DialogGui::getSaveFileName(QWidget *parent, const QString &caption, cons
|
||||||
void DialogGui::initializeImageFileDialog(QFileDialog &fileDialog, QFileDialog::Options options, QFileDialog::FileMode fm)
|
void DialogGui::initializeImageFileDialog(QFileDialog &fileDialog, QFileDialog::Options options, QFileDialog::FileMode fm)
|
||||||
{
|
{
|
||||||
fileDialog.setConfirmOverwrite( !(options & QFileDialog::DontConfirmOverwrite) );
|
fileDialog.setConfirmOverwrite( !(options & QFileDialog::DontConfirmOverwrite) );
|
||||||
fileDialog.setResolveSymlinks( !(options & QFileDialog::DontResolveSymlinks) );
|
|
||||||
fileDialog.setIconProvider(ensureIconProvider());
|
fileDialog.setIconProvider(ensureIconProvider());
|
||||||
fileDialog.setFileMode(fm);
|
fileDialog.setFileMode(fm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5000,21 +5000,6 @@ bool qt_xForm_helper(const QTransform &trueMat, int xoffset, int type, int depth
|
||||||
dptr++;
|
dptr++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
# if defined(Q_WS_WIN)
|
|
||||||
case QT_XFORM_TYPE_WINDOWSPIXMAP:
|
|
||||||
while (dptr < maxp) {
|
|
||||||
IWX_PIX(128);
|
|
||||||
IWX_PIX(64);
|
|
||||||
IWX_PIX(32);
|
|
||||||
IWX_PIX(16);
|
|
||||||
IWX_PIX(8);
|
|
||||||
IWX_PIX(4);
|
|
||||||
IWX_PIX(2);
|
|
||||||
IWX_PIX(1);
|
|
||||||
dptr++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m21ydx += m21;
|
m21ydx += m21;
|
||||||
|
|
|
@ -159,12 +159,6 @@ QStringList QInputContextFactory::keys()
|
||||||
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
|
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
|
||||||
result << QLatin1String("xim");
|
result << QLatin1String("xim");
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_WS_WIN) && !defined(QT_NO_XIM)
|
|
||||||
result << QLatin1String("win");
|
|
||||||
#endif
|
|
||||||
#if defined(Q_WS_MAC)
|
|
||||||
result << QLatin1String("mac");
|
|
||||||
#endif
|
|
||||||
#ifndef QT_NO_LIBRARY
|
#ifndef QT_NO_LIBRARY
|
||||||
result += inputloader()->keys();
|
result += inputloader()->keys();
|
||||||
#endif // QT_NO_LIBRARY
|
#endif // QT_NO_LIBRARY
|
||||||
|
@ -193,14 +187,6 @@ QStringList QInputContextFactory::languages( const QString &key )
|
||||||
if (key == QLatin1String("xim"))
|
if (key == QLatin1String("xim"))
|
||||||
return QStringList(QString());
|
return QStringList(QString());
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_WS_WIN)
|
|
||||||
if (key == QLatin1String("win"))
|
|
||||||
return QStringList(QString());
|
|
||||||
#endif
|
|
||||||
#if defined(Q_WS_MAC)
|
|
||||||
if (key == QLatin1String("mac"))
|
|
||||||
return QStringList(QString());
|
|
||||||
#endif
|
|
||||||
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
|
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
|
||||||
Q_UNUSED(key);
|
Q_UNUSED(key);
|
||||||
#else
|
#else
|
||||||
|
@ -248,14 +234,6 @@ QString QInputContextFactory::description( const QString &key )
|
||||||
if (key == QLatin1String("xim"))
|
if (key == QLatin1String("xim"))
|
||||||
return QInputContext::tr( "XIM input method" );
|
return QInputContext::tr( "XIM input method" );
|
||||||
#endif
|
#endif
|
||||||
#if defined(Q_WS_WIN) && !defined(QT_NO_XIM)
|
|
||||||
if (key == QLatin1String("win"))
|
|
||||||
return QInputContext::tr( "Windows input method" );
|
|
||||||
#endif
|
|
||||||
#if defined(Q_WS_MAC)
|
|
||||||
if (key == QLatin1String("mac"))
|
|
||||||
return QInputContext::tr( "Mac OS X input method" );
|
|
||||||
#endif
|
|
||||||
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
|
#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
|
||||||
Q_UNUSED(key);
|
Q_UNUSED(key);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -64,7 +64,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key)
|
||||||
if (system.isEmpty()) {
|
if (system.isEmpty()) {
|
||||||
system = QLatin1String("opengl");
|
system = QLatin1String("opengl");
|
||||||
}
|
}
|
||||||
#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) || defined(Q_WS_X11)
|
#elif defined (QT_GRAPHICSSYSTEM_RASTER) || defined(Q_WS_X11)
|
||||||
if (system.isEmpty()) {
|
if (system.isEmpty()) {
|
||||||
system = QLatin1String("raster");
|
system = QLatin1String("raster");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1882,9 +1882,7 @@ void QTextLine::layout_helper(int maxGlyphs)
|
||||||
// expand the text beyond the edge.
|
// expand the text beyond the edge.
|
||||||
if (sb_or_ws|breakany) {
|
if (sb_or_ws|breakany) {
|
||||||
QFixed rightBearing = lbh.rightBearing; // store previous right bearing
|
QFixed rightBearing = lbh.rightBearing; // store previous right bearing
|
||||||
#if !defined(Q_WS_MAC)
|
|
||||||
if (lbh.calculateNewWidth(line) - lbh.minimumRightBearing > line.width)
|
if (lbh.calculateNewWidth(line) - lbh.minimumRightBearing > line.width)
|
||||||
#endif
|
|
||||||
lbh.adjustRightBearing();
|
lbh.adjustRightBearing();
|
||||||
if (lbh.checkFullOtherwiseExtend(line)) {
|
if (lbh.checkFullOtherwiseExtend(line)) {
|
||||||
// we are too wide, fix right bearing
|
// we are too wide, fix right bearing
|
||||||
|
@ -2203,14 +2201,7 @@ QList<QGlyphRun> QTextLine::glyphs(int from, int length) const
|
||||||
fontD->fontEngine = fontEngine;
|
fontD->fontEngine = fontEngine;
|
||||||
fontD->fontEngine->ref.ref();
|
fontD->fontEngine->ref.ref();
|
||||||
|
|
||||||
#if defined(Q_WS_WIN)
|
#if !defined(QT_NO_FREETYPE)
|
||||||
if (fontEngine->supportsSubPixelPositions())
|
|
||||||
fontD->hintingPreference = QFont::PreferVerticalHinting;
|
|
||||||
else
|
|
||||||
fontD->hintingPreference = QFont::PreferFullHinting;
|
|
||||||
#elif defined(Q_WS_MAC)
|
|
||||||
fontD->hintingPreference = QFont::PreferNoHinting;
|
|
||||||
#elif !defined(QT_NO_FREETYPE)
|
|
||||||
if (fontEngine->type() == QFontEngine::Freetype) {
|
if (fontEngine->type() == QFontEngine::Freetype) {
|
||||||
QFontEngineFT *freeTypeEngine = static_cast<QFontEngineFT *>(fontEngine);
|
QFontEngineFT *freeTypeEngine = static_cast<QFontEngineFT *>(fontEngine);
|
||||||
switch (freeTypeEngine->defaultHintStyle()) {
|
switch (freeTypeEngine->defaultHintStyle()) {
|
||||||
|
|
|
@ -49,10 +49,6 @@
|
||||||
#include "qdesktopservices_blackberry.cpp"
|
#include "qdesktopservices_blackberry.cpp"
|
||||||
#elif defined(Q_WS_X11)
|
#elif defined(Q_WS_X11)
|
||||||
#include "qdesktopservices_x11.cpp"
|
#include "qdesktopservices_x11.cpp"
|
||||||
#elif defined(Q_WS_WIN)
|
|
||||||
#include "qdesktopservices_win.cpp"
|
|
||||||
#elif defined(Q_WS_MAC)
|
|
||||||
#include "qdesktopservices_mac.cpp"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <qhash.h>
|
#include <qhash.h>
|
||||||
|
|
|
@ -1725,7 +1725,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
|
||||||
end(1);
|
end(1);
|
||||||
}
|
}
|
||||||
else if (event == QKeySequence::MoveToNextChar) {
|
else if (event == QKeySequence::MoveToNextChar) {
|
||||||
#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
|
#if defined(QT_NO_COMPLETER)
|
||||||
if (hasSelectedText()) {
|
if (hasSelectedText()) {
|
||||||
#else
|
#else
|
||||||
if (hasSelectedText() && m_completer
|
if (hasSelectedText() && m_completer
|
||||||
|
@ -1740,7 +1740,7 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
|
||||||
cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
|
cursorForward(1, visual ? 1 : (layoutDirection() == Qt::LeftToRight ? 1 : -1));
|
||||||
}
|
}
|
||||||
else if (event == QKeySequence::MoveToPreviousChar) {
|
else if (event == QKeySequence::MoveToPreviousChar) {
|
||||||
#if !defined(Q_WS_WIN) || defined(QT_NO_COMPLETER)
|
#if defined(QT_NO_COMPLETER)
|
||||||
if (hasSelectedText()) {
|
if (hasSelectedText()) {
|
||||||
#else
|
#else
|
||||||
if (hasSelectedText() && m_completer
|
if (hasSelectedText() && m_completer
|
||||||
|
|
|
@ -164,31 +164,21 @@ int QMenuPrivate::scrollerHeight() const
|
||||||
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
|
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
|
||||||
QRect QMenuPrivate::popupGeometry(const QWidget *widget) const
|
QRect QMenuPrivate::popupGeometry(const QWidget *widget) const
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_WIN
|
#if defined Q_WS_X11
|
||||||
return QApplication::desktop()->screenGeometry(widget);
|
|
||||||
#elif defined Q_WS_X11
|
|
||||||
if (X11->desktopEnvironment == DE_KDE)
|
if (X11->desktopEnvironment == DE_KDE)
|
||||||
return QApplication::desktop()->screenGeometry(widget);
|
return QApplication::desktop()->screenGeometry(widget);
|
||||||
else
|
|
||||||
return QApplication::desktop()->availableGeometry(widget);
|
|
||||||
#else
|
|
||||||
return QApplication::desktop()->availableGeometry(widget);
|
|
||||||
#endif
|
#endif
|
||||||
|
return QApplication::desktop()->availableGeometry(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
|
//Windows and KDE allows menus to cover the taskbar, while GNOME and Mac don't
|
||||||
QRect QMenuPrivate::popupGeometry(int screen) const
|
QRect QMenuPrivate::popupGeometry(int screen) const
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_WIN
|
#if defined Q_WS_X11
|
||||||
return QApplication::desktop()->screenGeometry(screen);
|
|
||||||
#elif defined Q_WS_X11
|
|
||||||
if (X11->desktopEnvironment == DE_KDE)
|
if (X11->desktopEnvironment == DE_KDE)
|
||||||
return QApplication::desktop()->screenGeometry(screen);
|
return QApplication::desktop()->screenGeometry(screen);
|
||||||
else
|
|
||||||
return QApplication::desktop()->availableGeometry(screen);
|
|
||||||
#else
|
|
||||||
return QApplication::desktop()->availableGeometry(screen);
|
|
||||||
#endif
|
#endif
|
||||||
|
return QApplication::desktop()->availableGeometry(screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
|
QList<QPointer<QWidget> > QMenuPrivate::calcCausedStack() const
|
||||||
|
@ -398,10 +388,6 @@ QRect QMenuPrivate::actionRect(QAction *act) const
|
||||||
return actionRects.at(index);
|
return actionRects.at(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_WS_MAC)
|
|
||||||
static const qreal MenuFadeTimeInSec = 0.150;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void QMenuPrivate::hideUpToMenuBar()
|
void QMenuPrivate::hideUpToMenuBar()
|
||||||
{
|
{
|
||||||
Q_Q(QMenu);
|
Q_Q(QMenu);
|
||||||
|
@ -426,14 +412,6 @@ void QMenuPrivate::hideUpToMenuBar()
|
||||||
} else { caused = 0;
|
} else { caused = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(Q_WS_MAC)
|
|
||||||
if (fadeMenus) {
|
|
||||||
QEventLoop eventLoop;
|
|
||||||
QTimer::singleShot(int(MenuFadeTimeInSec * 1000), &eventLoop, SLOT(quit()));
|
|
||||||
QMacWindowFader::currentFader()->performFade();
|
|
||||||
eventLoop.exec();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
setCurrentAction(0);
|
setCurrentAction(0);
|
||||||
}
|
}
|
||||||
|
@ -468,15 +446,6 @@ void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister)
|
||||||
// Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec);
|
// Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec);
|
||||||
// Hopefully we'll integrate qt/research/windowtransitions into main before 4.4.
|
// Hopefully we'll integrate qt/research/windowtransitions into main before 4.4.
|
||||||
// Talk to Richard, Trenton or Bjoern.
|
// Talk to Richard, Trenton or Bjoern.
|
||||||
#if defined(Q_WS_MAC)
|
|
||||||
if (justRegister) {
|
|
||||||
QMacWindowFader::currentFader()->setFadeDuration(MenuFadeTimeInSec);
|
|
||||||
QMacWindowFader::currentFader()->registerWindowToFade(menu);
|
|
||||||
} else {
|
|
||||||
macWindowFade(qt_mac_window_for(menu), MenuFadeTimeInSec);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // Q_WS_MAC
|
|
||||||
}
|
}
|
||||||
aboutToHide = false;
|
aboutToHide = false;
|
||||||
menu->blockSignals(false);
|
menu->blockSignals(false);
|
||||||
|
@ -2383,12 +2352,10 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
||||||
else if (key == Qt::Key_Right)
|
else if (key == Qt::Key_Right)
|
||||||
key = Qt::Key_Left;
|
key = Qt::Key_Left;
|
||||||
}
|
}
|
||||||
#ifndef Q_WS_MAC
|
|
||||||
if (key == Qt::Key_Tab) //means down
|
if (key == Qt::Key_Tab) //means down
|
||||||
key = Qt::Key_Down;
|
key = Qt::Key_Down;
|
||||||
if (key == Qt::Key_Backtab) //means up
|
if (key == Qt::Key_Backtab) //means up
|
||||||
key = Qt::Key_Up;
|
key = Qt::Key_Up;
|
||||||
#endif
|
|
||||||
|
|
||||||
bool key_consumed = false;
|
bool key_consumed = false;
|
||||||
switch(key) {
|
switch(key) {
|
||||||
|
|
|
@ -367,62 +367,21 @@ QWorkspaceTitleBar::~QWorkspaceTitleBar()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef Q_WS_WIN
|
|
||||||
static inline QRgb colorref2qrgb(COLORREF col)
|
|
||||||
{
|
|
||||||
return qRgb(GetRValue(col),GetGValue(col),GetBValue(col));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void QWorkspaceTitleBarPrivate::readColors()
|
void QWorkspaceTitleBarPrivate::readColors()
|
||||||
{
|
{
|
||||||
Q_Q(QWorkspaceTitleBar);
|
Q_Q(QWorkspaceTitleBar);
|
||||||
QPalette pal = q->palette();
|
QPalette pal = q->palette();
|
||||||
|
|
||||||
bool colorsInitialized = false;
|
pal.setColor(QPalette::Active, QPalette::Highlight,
|
||||||
|
pal.color(QPalette::Active, QPalette::Highlight));
|
||||||
#ifdef Q_WS_WIN // ask system properties on windows
|
pal.setColor(QPalette::Active, QPalette::Base,
|
||||||
#ifndef SPI_GETGRADIENTCAPTIONS
|
pal.color(QPalette::Active, QPalette::Highlight));
|
||||||
#define SPI_GETGRADIENTCAPTIONS 0x1008
|
pal.setColor(QPalette::Inactive, QPalette::Highlight,
|
||||||
#endif
|
pal.color(QPalette::Inactive, QPalette::Dark));
|
||||||
#ifndef COLOR_GRADIENTACTIVECAPTION
|
pal.setColor(QPalette::Inactive, QPalette::Base,
|
||||||
#define COLOR_GRADIENTACTIVECAPTION 27
|
pal.color(QPalette::Inactive, QPalette::Dark));
|
||||||
#endif
|
pal.setColor(QPalette::Inactive, QPalette::HighlightedText,
|
||||||
#ifndef COLOR_GRADIENTINACTIVECAPTION
|
pal.color(QPalette::Inactive, QPalette::Window));
|
||||||
#define COLOR_GRADIENTINACTIVECAPTION 28
|
|
||||||
#endif
|
|
||||||
if (QApplication::desktopSettingsAware()) {
|
|
||||||
pal.setColor(QPalette::Active, QPalette::Highlight, colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION)));
|
|
||||||
pal.setColor(QPalette::Inactive, QPalette::Highlight, colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION)));
|
|
||||||
pal.setColor(QPalette::Active, QPalette::HighlightedText, colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT)));
|
|
||||||
pal.setColor(QPalette::Inactive, QPalette::HighlightedText, colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT)));
|
|
||||||
|
|
||||||
colorsInitialized = true;
|
|
||||||
BOOL gradient = false;
|
|
||||||
SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &gradient, 0);
|
|
||||||
|
|
||||||
if (gradient) {
|
|
||||||
pal.setColor(QPalette::Active, QPalette::Base, colorref2qrgb(GetSysColor(COLOR_GRADIENTACTIVECAPTION)));
|
|
||||||
pal.setColor(QPalette::Inactive, QPalette::Base, colorref2qrgb(GetSysColor(COLOR_GRADIENTINACTIVECAPTION)));
|
|
||||||
} else {
|
|
||||||
pal.setColor(QPalette::Active, QPalette::Base, pal.color(QPalette::Active, QPalette::Highlight));
|
|
||||||
pal.setColor(QPalette::Inactive, QPalette::Base, pal.color(QPalette::Inactive, QPalette::Highlight));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif // Q_WS_WIN
|
|
||||||
if (!colorsInitialized) {
|
|
||||||
pal.setColor(QPalette::Active, QPalette::Highlight,
|
|
||||||
pal.color(QPalette::Active, QPalette::Highlight));
|
|
||||||
pal.setColor(QPalette::Active, QPalette::Base,
|
|
||||||
pal.color(QPalette::Active, QPalette::Highlight));
|
|
||||||
pal.setColor(QPalette::Inactive, QPalette::Highlight,
|
|
||||||
pal.color(QPalette::Inactive, QPalette::Dark));
|
|
||||||
pal.setColor(QPalette::Inactive, QPalette::Base,
|
|
||||||
pal.color(QPalette::Inactive, QPalette::Dark));
|
|
||||||
pal.setColor(QPalette::Inactive, QPalette::HighlightedText,
|
|
||||||
pal.color(QPalette::Inactive, QPalette::Window));
|
|
||||||
}
|
|
||||||
|
|
||||||
q->setPalette(pal);
|
q->setPalette(pal);
|
||||||
q->setActive(act);
|
q->setActive(act);
|
||||||
|
|
Loading…
Add table
Reference in a new issue