forked from qt-creator/qt-creator
Core: Remove unneeded ifdefs.
Replace compile-time checks for host OS by run-time checks. Change-Id: I9f237389171586786c2609f81314bcb1bc17b01e Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
|
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -424,7 +425,6 @@ void MenuActionContainer::removeMenu(QMenu *menu)
|
|||||||
m_menu->removeAction(menu->menuAction());
|
m_menu->removeAction(menu->menuAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
static bool menuInMenuBar(const QMenu *menu)
|
static bool menuInMenuBar(const QMenu *menu)
|
||||||
{
|
{
|
||||||
foreach (const QWidget *widget, menu->menuAction()->associatedWidgets()) {
|
foreach (const QWidget *widget, menu->menuAction()->associatedWidgets()) {
|
||||||
@@ -433,19 +433,18 @@ static bool menuInMenuBar(const QMenu *menu)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool MenuActionContainer::updateInternal()
|
bool MenuActionContainer::updateInternal()
|
||||||
{
|
{
|
||||||
if (onAllDisabledBehavior() == Show)
|
if (onAllDisabledBehavior() == Show)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
if (Utils::HostOsInfo::isMacHost()) {
|
||||||
// work around QTBUG-25544 which makes menus in the menu bar stay at their enabled state at startup
|
// work around QTBUG-25544 which makes menus in the menu bar stay at their enabled state at startup
|
||||||
// (so menus that are disabled at startup would stay disabled)
|
// (so menus that are disabled at startup would stay disabled)
|
||||||
if (menuInMenuBar(m_menu))
|
if (menuInMenuBar(m_menu))
|
||||||
return true;
|
return true;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
bool hasitems = false;
|
bool hasitems = false;
|
||||||
QList<QAction *> actions = m_menu->actions();
|
QList<QAction *> actions = m_menu->actions();
|
||||||
|
|||||||
@@ -109,9 +109,7 @@ const char REMOVE_CURRENT_SPLIT[] = "QtCreator.RemoveCurrentSplit";
|
|||||||
const char REMOVE_ALL_SPLITS[] = "QtCreator.RemoveAllSplits";
|
const char REMOVE_ALL_SPLITS[] = "QtCreator.RemoveAllSplits";
|
||||||
const char GOTO_OTHER_SPLIT[] = "QtCreator.GotoOtherSplit";
|
const char GOTO_OTHER_SPLIT[] = "QtCreator.GotoOtherSplit";
|
||||||
const char CLOSE[] = "QtCreator.Close";
|
const char CLOSE[] = "QtCreator.Close";
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
const char CLOSE_ALTERNATIVE[] = "QtCreator.Close_Alternative"; // temporary, see QTCREATORBUG-72
|
const char CLOSE_ALTERNATIVE[] = "QtCreator.Close_Alternative"; // temporary, see QTCREATORBUG-72
|
||||||
#endif
|
|
||||||
const char CLOSEALL[] = "QtCreator.CloseAll";
|
const char CLOSEALL[] = "QtCreator.CloseAll";
|
||||||
const char CLOSEOTHERS[] = "QtCreator.CloseOthers";
|
const char CLOSEOTHERS[] = "QtCreator.CloseOthers";
|
||||||
const char GOTONEXT[] = "QtCreator.GotoNext";
|
const char GOTONEXT[] = "QtCreator.GotoNext";
|
||||||
|
|||||||
@@ -320,14 +320,14 @@ EditorManager::EditorManager(QWidget *parent) :
|
|||||||
mfile->addAction(cmd, Constants::G_FILE_CLOSE);
|
mfile->addAction(cmd, Constants::G_FILE_CLOSE);
|
||||||
connect(d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor()));
|
connect(d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor()));
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||||
// workaround for QTCREATORBUG-72
|
// workaround for QTCREATORBUG-72
|
||||||
QShortcut *sc = new QShortcut(parent);
|
QShortcut *sc = new QShortcut(parent);
|
||||||
cmd = ActionManager::registerShortcut(sc, Constants::CLOSE_ALTERNATIVE, editManagerContext);
|
cmd = ActionManager::registerShortcut(sc, Constants::CLOSE_ALTERNATIVE, editManagerContext);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+F4")));
|
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+F4")));
|
||||||
cmd->setDescription(EditorManager::tr("Close"));
|
cmd->setDescription(EditorManager::tr("Close"));
|
||||||
connect(sc, SIGNAL(activated()), this, SLOT(closeEditor()));
|
connect(sc, SIGNAL(activated()), this, SLOT(closeEditor()));
|
||||||
#endif
|
}
|
||||||
|
|
||||||
// Close All Action
|
// Close All Action
|
||||||
cmd = ActionManager::registerAction(d->m_closeAllEditorsAction, Constants::CLOSEALL, editManagerContext, true);
|
cmd = ActionManager::registerAction(d->m_closeAllEditorsAction, Constants::CLOSEALL, editManagerContext, true);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "fancyactionbar.h"
|
#include "fancyactionbar.h"
|
||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
|
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
#include <utils/tooltip/tooltip.h>
|
#include <utils/tooltip/tooltip.h>
|
||||||
@@ -152,8 +153,9 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
|
|||||||
// draw borders
|
// draw borders
|
||||||
bool isTitledAction = defaultAction()->property("titledAction").toBool();
|
bool isTitledAction = defaultAction()->property("titledAction").toBool();
|
||||||
|
|
||||||
#ifndef Q_OS_MAC // Mac UIs usually don't hover
|
|
||||||
if (m_fader > 0 && isEnabled() && !isDown() && !isChecked()) {
|
if (!Utils::HostOsInfo::isMacHost() // Mac UIs usually don't hover
|
||||||
|
&& m_fader > 0 && isEnabled() && !isDown() && !isChecked()) {
|
||||||
painter.save();
|
painter.save();
|
||||||
int fader = int(40 * m_fader);
|
int fader = int(40 * m_fader);
|
||||||
QLinearGradient grad(rect().topLeft(), rect().topRight());
|
QLinearGradient grad(rect().topLeft(), rect().topRight());
|
||||||
@@ -165,9 +167,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
|
|||||||
painter.drawLine(rect().topLeft(), rect().topRight());
|
painter.drawLine(rect().topLeft(), rect().topRight());
|
||||||
painter.drawLine(rect().bottomLeft(), rect().bottomRight());
|
painter.drawLine(rect().bottomLeft(), rect().bottomRight());
|
||||||
painter.restore();
|
painter.restore();
|
||||||
} else
|
} else if (isDown() || isChecked()) {
|
||||||
#endif
|
|
||||||
if (isDown() || isChecked()) {
|
|
||||||
painter.save();
|
painter.save();
|
||||||
QLinearGradient grad(rect().topLeft(), rect().topRight());
|
QLinearGradient grad(rect().topLeft(), rect().topRight());
|
||||||
grad.setColorAt(0, Qt::transparent);
|
grad.setColorAt(0, Qt::transparent);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "infobar.h"
|
#include "infobar.h"
|
||||||
#include "editormanager/editormanager.h"
|
#include "editormanager/editormanager.h"
|
||||||
|
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
#include <utils/qtcolorbutton.h>
|
#include <utils/qtcolorbutton.h>
|
||||||
#include <utils/consoleprocess.h>
|
#include <utils/consoleprocess.h>
|
||||||
@@ -114,25 +115,25 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
|||||||
|
|
||||||
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
m_page->colorButton->setColor(StyleHelper::requestedBaseColor());
|
||||||
m_page->reloadBehavior->setCurrentIndex(EditorManager::instance()->reloadSetting());
|
m_page->reloadBehavior->setCurrentIndex(EditorManager::instance()->reloadSetting());
|
||||||
#ifdef Q_OS_UNIX
|
if (HostOsInfo::isAnyUnixHost()) {
|
||||||
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
const QStringList availableTerminals = ConsoleProcess::availableTerminalEmulators();
|
||||||
const QString currentTerminal = ConsoleProcess::terminalEmulator(settings);
|
const QString currentTerminal = ConsoleProcess::terminalEmulator(settings);
|
||||||
m_page->terminalComboBox->addItems(availableTerminals);
|
m_page->terminalComboBox->addItems(availableTerminals);
|
||||||
m_page->terminalComboBox->lineEdit()->setText(currentTerminal);
|
m_page->terminalComboBox->lineEdit()->setText(currentTerminal);
|
||||||
#else
|
} else {
|
||||||
m_page->terminalLabel->hide();
|
m_page->terminalLabel->hide();
|
||||||
m_page->terminalComboBox->hide();
|
m_page->terminalComboBox->hide();
|
||||||
m_page->resetTerminalButton->hide();
|
m_page->resetTerminalButton->hide();
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost()) {
|
||||||
m_page->externalFileBrowserEdit->setText(UnixUtils::fileBrowser(settings));
|
m_page->externalFileBrowserEdit->setText(UnixUtils::fileBrowser(settings));
|
||||||
#else
|
} else {
|
||||||
m_page->externalFileBrowserLabel->hide();
|
m_page->externalFileBrowserLabel->hide();
|
||||||
m_page->externalFileBrowserEdit->hide();
|
m_page->externalFileBrowserEdit->hide();
|
||||||
m_page->resetFileBrowserButton->hide();
|
m_page->resetFileBrowserButton->hide();
|
||||||
m_page->helpExternalFileBrowserButton->hide();
|
m_page->helpExternalFileBrowserButton->hide();
|
||||||
#endif
|
}
|
||||||
|
|
||||||
m_page->autoSaveCheckBox->setChecked(EditorManager::instance()->autoSaveEnabled());
|
m_page->autoSaveCheckBox->setChecked(EditorManager::instance()->autoSaveEnabled());
|
||||||
m_page->autoSaveInterval->setValue(EditorManager::instance()->autoSaveInterval());
|
m_page->autoSaveInterval->setValue(EditorManager::instance()->autoSaveInterval());
|
||||||
@@ -142,16 +143,14 @@ QWidget *GeneralSettings::createPage(QWidget *parent)
|
|||||||
this, SLOT(resetInterfaceColor()));
|
this, SLOT(resetInterfaceColor()));
|
||||||
connect(m_page->resetWarningsButton, SIGNAL(clicked()),
|
connect(m_page->resetWarningsButton, SIGNAL(clicked()),
|
||||||
this, SLOT(resetWarnings()));
|
this, SLOT(resetWarnings()));
|
||||||
#ifdef Q_OS_UNIX
|
if (HostOsInfo::isAnyUnixHost()) {
|
||||||
connect(m_page->resetTerminalButton, SIGNAL(clicked()),
|
connect(m_page->resetTerminalButton, SIGNAL(clicked()), this, SLOT(resetTerminal()));
|
||||||
this, SLOT(resetTerminal()));
|
if (!HostOsInfo::isMacHost()) {
|
||||||
#ifndef Q_OS_MAC
|
connect(m_page->resetFileBrowserButton, SIGNAL(clicked()), this, SLOT(resetFileBrowser()));
|
||||||
connect(m_page->resetFileBrowserButton, SIGNAL(clicked()),
|
|
||||||
this, SLOT(resetFileBrowser()));
|
|
||||||
connect(m_page->helpExternalFileBrowserButton, SIGNAL(clicked()),
|
connect(m_page->helpExternalFileBrowserButton, SIGNAL(clicked()),
|
||||||
this, SLOT(showHelpForFileBrowser()));
|
this, SLOT(showHelpForFileBrowser()));
|
||||||
#endif
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
if (m_searchKeywords.isEmpty()) {
|
if (m_searchKeywords.isEmpty()) {
|
||||||
QLatin1Char sep(' ');
|
QLatin1Char sep(' ');
|
||||||
@@ -181,13 +180,14 @@ void GeneralSettings::apply()
|
|||||||
// Apply the new base color if accepted
|
// Apply the new base color if accepted
|
||||||
StyleHelper::setBaseColor(m_page->colorButton->color());
|
StyleHelper::setBaseColor(m_page->colorButton->color());
|
||||||
EditorManager::instance()->setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex()));
|
EditorManager::instance()->setReloadSetting(IDocument::ReloadSetting(m_page->reloadBehavior->currentIndex()));
|
||||||
#ifdef Q_OS_UNIX
|
if (HostOsInfo::isAnyUnixHost()) {
|
||||||
ConsoleProcess::setTerminalEmulator(Core::ICore::settings(),
|
ConsoleProcess::setTerminalEmulator(Core::ICore::settings(),
|
||||||
m_page->terminalComboBox->lineEdit()->text());
|
m_page->terminalComboBox->lineEdit()->text());
|
||||||
#ifndef Q_OS_MAC
|
if (!HostOsInfo::isMacHost()) {
|
||||||
Utils::UnixUtils::setFileBrowser(Core::ICore::settings(), m_page->externalFileBrowserEdit->text());
|
Utils::UnixUtils::setFileBrowser(Core::ICore::settings(),
|
||||||
#endif
|
m_page->externalFileBrowserEdit->text());
|
||||||
#endif
|
}
|
||||||
|
}
|
||||||
EditorManager::instance()->setAutoSaveEnabled(m_page->autoSaveCheckBox->isChecked());
|
EditorManager::instance()->setAutoSaveEnabled(m_page->autoSaveCheckBox->isChecked());
|
||||||
EditorManager::instance()->setAutoSaveInterval(m_page->autoSaveInterval->value());
|
EditorManager::instance()->setAutoSaveInterval(m_page->autoSaveInterval->value());
|
||||||
}
|
}
|
||||||
@@ -213,16 +213,14 @@ void GeneralSettings::resetWarnings()
|
|||||||
|
|
||||||
void GeneralSettings::resetTerminal()
|
void GeneralSettings::resetTerminal()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_UNIX)
|
if (HostOsInfo::isAnyUnixHost())
|
||||||
m_page->terminalComboBox->lineEdit()->setText(ConsoleProcess::defaultTerminalEmulator());
|
m_page->terminalComboBox->lineEdit()->setText(ConsoleProcess::defaultTerminalEmulator());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSettings::resetFileBrowser()
|
void GeneralSettings::resetFileBrowser()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost())
|
||||||
m_page->externalFileBrowserEdit->setText(UnixUtils::defaultFileBrowser());
|
m_page->externalFileBrowserEdit->setText(UnixUtils::defaultFileBrowser());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -250,9 +248,8 @@ void GeneralSettings::variableHelpDialogCreator(const QString &helpText)
|
|||||||
|
|
||||||
void GeneralSettings::showHelpForFileBrowser()
|
void GeneralSettings::showHelpForFileBrowser()
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
if (HostOsInfo::isAnyUnixHost() && !HostOsInfo::isMacHost())
|
||||||
variableHelpDialogCreator(UnixUtils::fileBrowserHelpText());
|
variableHelpDialogCreator(UnixUtils::fileBrowserHelpText());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSettings::resetLanguage()
|
void GeneralSettings::resetLanguage()
|
||||||
|
|||||||
@@ -346,6 +346,8 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "documentmanager.h"
|
#include "documentmanager.h"
|
||||||
|
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -483,15 +485,11 @@ QString ICore::userInterfaceLanguage()
|
|||||||
return qApp->property("qtc_locale").toString();
|
return qApp->property("qtc_locale").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
# define SHARE_PATH "/../Resources"
|
|
||||||
#else
|
|
||||||
# define SHARE_PATH "/../share/qtcreator"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QString ICore::resourcePath()
|
QString ICore::resourcePath()
|
||||||
{
|
{
|
||||||
return QDir::cleanPath(QCoreApplication::applicationDirPath() + QLatin1String(SHARE_PATH));
|
const QString sharePath = QLatin1String(Utils::HostOsInfo::isMacHost()
|
||||||
|
? "/../Resources" : "/../share/qtcreator");
|
||||||
|
return QDir::cleanPath(QCoreApplication::applicationDirPath() + sharePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ICore::userResourcePath()
|
QString ICore::userResourcePath()
|
||||||
|
|||||||
@@ -113,7 +113,6 @@
|
|||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#ifdef Q_OS_UNIX
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
extern "C" void handleSigInt(int sig)
|
extern "C" void handleSigInt(int sig)
|
||||||
{
|
{
|
||||||
@@ -121,7 +120,6 @@ extern "C" void handleSigInt(int sig)
|
|||||||
Core::ICore::exit();
|
Core::ICore::exit();
|
||||||
qDebug() << "SIGINT caught. Shutting down.";
|
qDebug() << "SIGINT caught. Shutting down.";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
@@ -168,10 +166,8 @@ MainWindow::MainWindow() :
|
|||||||
m_optionsAction(0),
|
m_optionsAction(0),
|
||||||
m_toggleSideBarAction(0),
|
m_toggleSideBarAction(0),
|
||||||
m_toggleFullScreenAction(0),
|
m_toggleFullScreenAction(0),
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
m_minimizeAction(0),
|
m_minimizeAction(0),
|
||||||
m_zoomAction(0),
|
m_zoomAction(0),
|
||||||
#endif
|
|
||||||
m_toggleSideBarButton(new QToolButton)
|
m_toggleSideBarButton(new QToolButton)
|
||||||
{
|
{
|
||||||
(void) new DocumentManager(this);
|
(void) new DocumentManager(this);
|
||||||
@@ -230,9 +226,8 @@ MainWindow::MainWindow() :
|
|||||||
statusBar()->insertPermanentWidget(0, m_toggleSideBarButton);
|
statusBar()->insertPermanentWidget(0, m_toggleSideBarButton);
|
||||||
|
|
||||||
// setUnifiedTitleAndToolBarOnMac(true);
|
// setUnifiedTitleAndToolBarOnMac(true);
|
||||||
#ifdef Q_OS_UNIX
|
//if (Utils::HostOsInfo::isAnyUnixHost())
|
||||||
//signal(SIGINT, handleSigInt);
|
//signal(SIGINT, handleSigInt);
|
||||||
#endif
|
|
||||||
|
|
||||||
statusBar()->setProperty("p_styled", true);
|
statusBar()->setProperty("p_styled", true);
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
@@ -265,7 +260,6 @@ void MainWindow::setOverrideColor(const QColor &color)
|
|||||||
m_overrideColor = color;
|
m_overrideColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
void MainWindow::setIsFullScreen(bool fullScreen)
|
void MainWindow::setIsFullScreen(bool fullScreen)
|
||||||
{
|
{
|
||||||
if (fullScreen)
|
if (fullScreen)
|
||||||
@@ -273,7 +267,6 @@ void MainWindow::setIsFullScreen(bool fullScreen)
|
|||||||
else
|
else
|
||||||
m_toggleFullScreenAction->setText(tr("Enter Full Screen"));
|
m_toggleFullScreenAction->setText(tr("Enter Full Screen"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
@@ -1095,16 +1088,16 @@ void MainWindow::changeEvent(QEvent *e)
|
|||||||
emit windowActivated();
|
emit windowActivated();
|
||||||
}
|
}
|
||||||
} else if (e->type() == QEvent::WindowStateChange) {
|
} else if (e->type() == QEvent::WindowStateChange) {
|
||||||
#ifdef Q_OS_MAC
|
if (Utils::HostOsInfo::isMacHost()) {
|
||||||
bool minimized = isMinimized();
|
bool minimized = isMinimized();
|
||||||
if (debugMainWindow)
|
if (debugMainWindow)
|
||||||
qDebug() << "main window state changed to minimized=" << minimized;
|
qDebug() << "main window state changed to minimized=" << minimized;
|
||||||
m_minimizeAction->setEnabled(!minimized);
|
m_minimizeAction->setEnabled(!minimized);
|
||||||
m_zoomAction->setEnabled(!minimized);
|
m_zoomAction->setEnabled(!minimized);
|
||||||
#else
|
} else {
|
||||||
bool isFullScreen = (windowState() & Qt::WindowFullScreen) != 0;
|
bool isFullScreen = (windowState() & Qt::WindowFullScreen) != 0;
|
||||||
m_toggleFullScreenAction->setChecked(isFullScreen);
|
m_toggleFullScreenAction->setChecked(isFullScreen);
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,9 +120,7 @@ public:
|
|||||||
|
|
||||||
void setOverrideColor(const QColor &color);
|
void setOverrideColor(const QColor &color);
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
void setIsFullScreen(bool fullScreen);
|
void setIsFullScreen(bool fullScreen);
|
||||||
#endif
|
|
||||||
signals:
|
signals:
|
||||||
void windowActivated();
|
void windowActivated();
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/stylehelper.h>
|
#include <utils/stylehelper.h>
|
||||||
|
|
||||||
@@ -902,13 +903,10 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
|
|||||||
if (mflags & (State_Sunken)) {
|
if (mflags & (State_Sunken)) {
|
||||||
QColor shade(0, 0, 0, 50);
|
QColor shade(0, 0, 0, 50);
|
||||||
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
||||||
}
|
} else if (!Utils::HostOsInfo::isMacHost() && (mflags & State_MouseOver)) {
|
||||||
#ifndef Q_OS_MAC
|
|
||||||
else if (mflags & (State_MouseOver)) {
|
|
||||||
QColor shade(255, 255, 255, 50);
|
QColor shade(255, 255, 255, 50);
|
||||||
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
painter->fillRect(tool.rect.adjusted(0, -1, 1, 1), shade);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
tool.rect = tool.rect.adjusted(2, 2, -2, -2);
|
tool.rect = tool.rect.adjusted(2, 2, -2, -2);
|
||||||
drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
|
drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
|
||||||
|
|||||||
@@ -591,16 +591,16 @@ int OutputPaneManager::currentIndex() const
|
|||||||
|
|
||||||
static QString buttonStyleSheet()
|
static QString buttonStyleSheet()
|
||||||
{
|
{
|
||||||
return QLatin1String("QToolButton { border-image: url(:/core/images/panel_button.png) 2 2 2 19;"
|
QString styleSheet = QLatin1String("QToolButton { border-image: url(:/core/images/panel_button.png) 2 2 2 19;"
|
||||||
" border-width: 2px 2px 2px 19px; padding-left: -17; padding-right: 4 } "
|
" border-width: 2px 2px 2px 19px; padding-left: -17; padding-right: 4 } "
|
||||||
"QToolButton:checked { border-image: url(:/core/images/panel_button_checked.png) 2 2 2 19 } "
|
"QToolButton:checked { border-image: url(:/core/images/panel_button_checked.png) 2 2 2 19 } "
|
||||||
"QToolButton::menu-indicator { width:0; height:0 }"
|
"QToolButton::menu-indicator { width:0; height:0 }");
|
||||||
#ifndef Q_OS_MAC // Mac UIs usually don't hover
|
if (!Utils::HostOsInfo::isMacHost()) { // Mac UIs usually don't hover
|
||||||
"QToolButton:checked:hover { border-image: url(:/core/images/panel_button_checked_hover.png) 2 2 2 19 } "
|
styleSheet += QLatin1String("QToolButton:checked:hover { border-image: url(:/core/images/panel_button_checked_hover.png) 2 2 2 19 } "
|
||||||
"QToolButton:pressed:hover { border-image: url(:/core/images/panel_button_pressed.png) 2 2 2 19 } "
|
"QToolButton:pressed:hover { border-image: url(:/core/images/panel_button_pressed.png) 2 2 2 19 } "
|
||||||
"QToolButton:hover { border-image: url(:/core/images/panel_button_hover.png) 2 2 2 19 } "
|
"QToolButton:hover { border-image: url(:/core/images/panel_button_hover.png) 2 2 2 19 } ");
|
||||||
#endif
|
}
|
||||||
);
|
return styleSheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPaneToggleButton::OutputPaneToggleButton(int number, const QString &text,
|
OutputPaneToggleButton::OutputPaneToggleButton(int number, const QString &text,
|
||||||
|
|||||||
Reference in New Issue
Block a user