forked from qt-creator/qt-creator
Remove dependency on Qt Mac Extras
Change-Id: Id4d394974e87d7844c02c18f3c98957036503d7f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -9,7 +9,6 @@ macos {
|
|||||||
$$PWD/touchbar_mac.mm \
|
$$PWD/touchbar_mac.mm \
|
||||||
$$PWD/touchbar_appdelegate_mac.mm
|
$$PWD/touchbar_appdelegate_mac.mm
|
||||||
|
|
||||||
QT += macextras
|
|
||||||
LIBS += -framework Foundation -framework AppKit
|
LIBS += -framework Foundation -framework AppKit
|
||||||
} else {
|
} else {
|
||||||
SOURCES += $$PWD/touchbar.cpp
|
SOURCES += $$PWD/touchbar.cpp
|
||||||
|
|||||||
@@ -29,8 +29,6 @@
|
|||||||
|
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
#include <QtMac>
|
|
||||||
|
|
||||||
#import <AppKit/NSButton.h>
|
#import <AppKit/NSButton.h>
|
||||||
#import <AppKit/NSCustomTouchBarItem.h>
|
#import <AppKit/NSCustomTouchBarItem.h>
|
||||||
#import <AppKit/NSImage.h>
|
#import <AppKit/NSImage.h>
|
||||||
@@ -145,8 +143,12 @@ static NSImage *iconToTemplateNSImage(const QIcon &icon)
|
|||||||
{
|
{
|
||||||
// touch bar icons are max 18-22 pts big. our are always 22 pts big.
|
// touch bar icons are max 18-22 pts big. our are always 22 pts big.
|
||||||
const QPixmap pixmap = icon.pixmap(22);
|
const QPixmap pixmap = icon.pixmap(22);
|
||||||
NSImage *image = QtMac::toNSImage(pixmap);
|
|
||||||
// toNSImage ignores devicePixelRatio, so fixup after the fact
|
CGImageRef cgImage = pixmap.toImage().toCGImage();
|
||||||
|
NSImage *image = [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize];
|
||||||
|
CFRelease(cgImage);
|
||||||
|
|
||||||
|
// The above code ignores devicePixelRatio, so fixup after the fact
|
||||||
const CGFloat userWidth = pixmap.width() / pixmap.devicePixelRatio();
|
const CGFloat userWidth = pixmap.width() / pixmap.devicePixelRatio();
|
||||||
const CGFloat userHeight = pixmap.height() / pixmap.devicePixelRatio();
|
const CGFloat userHeight = pixmap.height() / pixmap.devicePixelRatio();
|
||||||
image.size = CGSizeMake(userWidth, userHeight); // scales the image
|
image.size = CGSizeMake(userWidth, userHeight); // scales the image
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ FORMS += docsettingspage.ui \
|
|||||||
|
|
||||||
osx {
|
osx {
|
||||||
DEFINES += QTC_MAC_NATIVE_HELPVIEWER
|
DEFINES += QTC_MAC_NATIVE_HELPVIEWER
|
||||||
QT += macextras
|
|
||||||
HEADERS += macwebkithelpviewer.h
|
HEADERS += macwebkithelpviewer.h
|
||||||
OBJECTIVE_SOURCES += macwebkithelpviewer.mm
|
OBJECTIVE_SOURCES += macwebkithelpviewer.mm
|
||||||
LIBS += -framework WebKit -framework AppKit
|
LIBS += -framework WebKit -framework AppKit
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#include <QHelpEngine>
|
#include <QHelpEngine>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QtMac>
|
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user