Commit d3abbae2 authored by Eike Ziller's avatar Eike Ziller Committed by Virva Auvinen

New close split buttons.

This change moves the "close document" button back to the top-left and
instead changes the icon on the "close split" buttons.

Change-Id: I187c3f707f38ea8edef996cb5393654015d551ca
Reviewed-by: default avatarVirva Auvinen <virva.auvinen@nokia.com>
parent af6b2dc6
......@@ -65,5 +65,11 @@
<file>images/category_qml.png</file>
<file>images/filtericon.png</file>
<file>images/category_buildrun.png</file>
<file>images/button_close.png</file>
<file>images/splitbutton_closebottom.png</file>
<file>images/splitbutton_closeleft.png</file>
<file>images/splitbutton_closeright.png</file>
<file>images/splitbutton_closetop.png</file>
<file>images/splitbutton_vertical.png</file>
</qresource>
</RCC>
......@@ -181,31 +181,37 @@ const char G_WINDOW_OTHER[] = "QtCreator.Group.Window.Other";
const char G_HELP_HELP[] = "QtCreator.Group.Help.Help";
const char G_HELP_ABOUT[] = "QtCreator.Group.Help.About";
const char ICON_MINUS[] = ":/core/images/minus.png";
const char ICON_PLUS[] = ":/core/images/plus.png";
const char ICON_NEWFILE[] = ":/core/images/filenew.png";
const char ICON_OPENFILE[] = ":/core/images/fileopen.png";
const char ICON_SAVEFILE[] = ":/core/images/filesave.png";
const char ICON_UNDO[] = ":/core/images/undo.png";
const char ICON_REDO[] = ":/core/images/redo.png";
const char ICON_COPY[] = ":/core/images/editcopy.png";
const char ICON_PASTE[] = ":/core/images/editpaste.png";
const char ICON_CUT[] = ":/core/images/editcut.png";
const char ICON_NEXT[] = ":/core/images/next.png";
const char ICON_PREV[] = ":/core/images/prev.png";
const char ICON_DIR[] = ":/core/images/dir.png";
const char ICON_CLEAN_PANE[] = ":/core/images/clean_pane_small.png";
const char ICON_CLEAR[] = ":/core/images/clear.png";
const char ICON_RESET[] = ":/core/images/reset.png";
const char ICON_MAGNIFIER[] = ":/core/images/magnifier.png";
const char ICON_TOGGLE_SIDEBAR[] = ":/core/images/sidebaricon.png";
const char ICON_CLOSE[] = ":/core/images/closebutton.png";
const char ICON_CLOSE_DARK[] = ":/core/images/darkclosebutton.png";
const char ICON_SPLIT_HORIZONTAL[] = ":/core/images/splitbutton_horizontal.png";
const char ICON_FILTER[] = ":/core/images/filtericon.png";
const char ICON_LINK[] = ":/core/images/linkicon.png";
const char ICON_QTLOGO_32[] = ":/core/images/logo/32/qtcreator.png";
const char ICON_QTLOGO_128[] = ":/core/images/logo/128/qtcreator.png";
const char ICON_MINUS[] = ":/core/images/minus.png";
const char ICON_PLUS[] = ":/core/images/plus.png";
const char ICON_NEWFILE[] = ":/core/images/filenew.png";
const char ICON_OPENFILE[] = ":/core/images/fileopen.png";
const char ICON_SAVEFILE[] = ":/core/images/filesave.png";
const char ICON_UNDO[] = ":/core/images/undo.png";
const char ICON_REDO[] = ":/core/images/redo.png";
const char ICON_COPY[] = ":/core/images/editcopy.png";
const char ICON_PASTE[] = ":/core/images/editpaste.png";
const char ICON_CUT[] = ":/core/images/editcut.png";
const char ICON_NEXT[] = ":/core/images/next.png";
const char ICON_PREV[] = ":/core/images/prev.png";
const char ICON_DIR[] = ":/core/images/dir.png";
const char ICON_CLEAN_PANE[] = ":/core/images/clean_pane_small.png";
const char ICON_CLEAR[] = ":/core/images/clear.png";
const char ICON_RESET[] = ":/core/images/reset.png";
const char ICON_MAGNIFIER[] = ":/core/images/magnifier.png";
const char ICON_TOGGLE_SIDEBAR[] = ":/core/images/sidebaricon.png";
const char ICON_CLOSE_DOCUMENT[] = ":/core/images/button_close.png";
const char ICON_CLOSE[] = ":/core/images/closebutton.png";
const char ICON_CLOSE_DARK[] = ":/core/images/darkclosebutton.png";
const char ICON_SPLIT_HORIZONTAL[] = ":/core/images/splitbutton_horizontal.png";
const char ICON_SPLIT_VERTICAL[] = ":/core/images/splitbutton_vertical.png";
const char ICON_CLOSE_SPLIT_TOP[] = ":/core/images/splitbutton_closetop.png";
const char ICON_CLOSE_SPLIT_BOTTOM[] = ":/core/images/splitbutton_closebottom.png";
const char ICON_CLOSE_SPLIT_LEFT[] = ":/core/images/splitbutton_closeleft.png";
const char ICON_CLOSE_SPLIT_RIGHT[] = ":/core/images/splitbutton_closeright.png";
const char ICON_FILTER[] = ":/core/images/filtericon.png";
const char ICON_LINK[] = ":/core/images/linkicon.png";
const char ICON_QTLOGO_32[] = ":/core/images/logo/32/qtcreator.png";
const char ICON_QTLOGO_128[] = ":/core/images/logo/128/qtcreator.png";
const char WIZARD_CATEGORY_QT[] = "R.Qt";
const char WIZARD_TR_CATEGORY_QT[] = QT_TRANSLATE_NOOP("Core", "Qt");
......
......@@ -175,6 +175,11 @@ void EditorView::setCloseSplitEnabled(bool enable)
m_toolBar->setCloseSplitEnabled(enable);
}
void EditorView::setCloseSplitIcon(const QIcon &icon)
{
m_toolBar->setCloseSplitIcon(icon);
}
void EditorView::addEditor(IEditor *editor)
{
if (m_editors.contains(editor))
......@@ -686,6 +691,14 @@ void SplitterOrView::split(Qt::Orientation orientation)
otherView->view()->copyNavigationHistoryFrom(m_view);
otherView->view()->setCurrentEditor(otherView->view()->currentEditor());
if (orientation == Qt::Horizontal) {
view->view()->setCloseSplitIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_LEFT)));
otherView->view()->setCloseSplitIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_RIGHT)));
} else {
view->view()->setCloseSplitIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_TOP)));
otherView->view()->setCloseSplitIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_BOTTOM)));
}
if (m_view && !m_isRoot) {
em->emptyView(m_view);
delete m_view;
......@@ -750,6 +763,20 @@ void SplitterOrView::unsplit()
} else {
m_view = childSplitterOrView->takeView();
m_layout->addWidget(m_view);
QSplitter *parentSplitter = qobject_cast<QSplitter *>(parentWidget());
if (parentSplitter) { // not the toplevel splitterOrView
if (parentSplitter->orientation() == Qt::Horizontal) {
if (parentSplitter->widget(0) == this)
m_view->setCloseSplitIcon(QIcon(Constants::ICON_CLOSE_SPLIT_LEFT));
else
m_view->setCloseSplitIcon(QIcon(Constants::ICON_CLOSE_SPLIT_RIGHT));
} else {
if (parentSplitter->widget(0) == this)
m_view->setCloseSplitIcon(QIcon(Constants::ICON_CLOSE_SPLIT_TOP));
else
m_view->setCloseSplitIcon(QIcon(Constants::ICON_CLOSE_SPLIT_BOTTOM));
}
}
}
m_layout->setCurrentWidget(m_view);
}
......
......@@ -38,19 +38,21 @@
#include <QtCore/QMap>
#include <QtCore/QList>
#include <QtCore/QString>
#include <QtGui/QWidget>
#include <QtCore/QPointer>
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class QAction;
class QComboBox;
class QToolButton;
class QFrame;
class QLabel;
class QStackedWidget;
class QSplitter;
class QStackedLayout;
class QAction;
class QFrame;
class QStackedWidget;
class QToolButton;
QT_END_NAMESPACE
namespace Core {
......@@ -94,6 +96,7 @@ public:
QObject *object, const char *member);
void hideEditorStatusBar(const QString &id);
void setCloseSplitEnabled(bool enable);
void setCloseSplitIcon(const QIcon &icon);
private slots:
void closeView();
......
......@@ -103,7 +103,7 @@ EditorToolBarPrivate::EditorToolBarPrivate(QWidget *parent, EditorToolBar *q) :
m_goForwardAction(new QAction(QIcon(QLatin1String(Constants::ICON_NEXT)), EditorManager::tr("Go Forward"), parent)),
m_splitButton(new QToolButton),
m_horizontalSplitAction(new QAction(QIcon(QLatin1String(Constants::ICON_SPLIT_HORIZONTAL)), EditorManager::tr("Split"), parent)),
m_verticalSplitAction(new QAction(EditorManager::tr("Split Side by Side"), parent)),
m_verticalSplitAction(new QAction(QIcon(QLatin1String(Constants::ICON_SPLIT_VERTICAL)), EditorManager::tr("Split Side by Side"), parent)),
m_closeSplitButton(new QToolButton),
m_activeToolBar(0),
m_toolBarPlaceholder(new QWidget),
......@@ -141,13 +141,11 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
d->m_editorList->setModel(d->m_editorsListModel);
d->m_editorList->setMaxVisibleItems(40);
d->m_editorList->setContextMenuPolicy(Qt::CustomContextMenu);
d->m_editorList->setProperty("hideborder", true);
d->m_closeEditorButton->setAutoRaise(true);
d->m_closeEditorButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
d->m_closeEditorButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_DOCUMENT)));
d->m_closeEditorButton->setToolTip(tr("Close Document"));
d->m_closeEditorButton->setEnabled(false);
d->m_closeEditorButton->setProperty("showborder", true);
d->m_toolBarPlaceholder->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
......@@ -165,13 +163,14 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
d->m_splitButton->setIcon(QIcon(QLatin1String(Constants::ICON_SPLIT_HORIZONTAL)));
d->m_splitButton->setToolTip(tr("Split"));
d->m_splitButton->setPopupMode(QToolButton::InstantPopup);
d->m_splitButton->setProperty("noArrow", true);
QMenu *splitMenu = new QMenu(d->m_splitButton);
splitMenu->addAction(d->m_horizontalSplitAction);
splitMenu->addAction(d->m_verticalSplitAction);
d->m_splitButton->setMenu(splitMenu);
d->m_closeSplitButton->setAutoRaise(true);
d->m_closeSplitButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
d->m_closeSplitButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_BOTTOM)));
d->m_closeSplitButton->setToolTip(tr("Remove Split"));
QHBoxLayout *toplayout = new QHBoxLayout(this);
......@@ -181,10 +180,10 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
toplayout->addWidget(d->m_forwardButton);
toplayout->addWidget(d->m_lockButton);
toplayout->addWidget(d->m_editorList);
toplayout->addWidget(d->m_closeEditorButton);
toplayout->addWidget(d->m_toolBarPlaceholder, 1); // Custom toolbar stretches
toplayout->addWidget(d->m_splitButton);
toplayout->addWidget(d->m_closeSplitButton);
toplayout->addWidget(d->m_closeEditorButton);
setLayout(toplayout);
......@@ -240,6 +239,11 @@ void EditorToolBar::setCloseSplitEnabled(bool enable)
d->m_closeSplitButton->setVisible(enable);
}
void EditorToolBar::setCloseSplitIcon(const QIcon &icon)
{
d->m_closeSplitButton->setIcon(icon);
}
void EditorToolBar::closeEditor()
{
if (!currentEditor())
......
......@@ -37,6 +37,8 @@
#include <utils/styledbar.h>
#include <QtGui/QIcon>
namespace Core {
class IEditor;
......@@ -79,6 +81,7 @@ public:
void setCanGoForward(bool canGoForward);
void removeToolbarForEditor(IEditor *editor);
void setCloseSplitEnabled(bool enable);
void setCloseSplitIcon(const QIcon &icon);
public slots:
void updateEditorStatus(IEditor *editor);
......
src/plugins/coreplugin/images/linkicon.png

592 Bytes | W: | H:

src/plugins/coreplugin/images/linkicon.png

1.09 KB | W: | H:

src/plugins/coreplugin/images/linkicon.png
src/plugins/coreplugin/images/linkicon.png
src/plugins/coreplugin/images/linkicon.png
src/plugins/coreplugin/images/linkicon.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -88,7 +88,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget, int pos
splitAction->setIcon(QIcon(QLatin1String(Constants::ICON_SPLIT_HORIZONTAL)));
splitAction->setToolTip(tr("Split"));
QToolButton *close = new QToolButton();
close->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
close->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_TOP)));
close->setToolTip(tr("Close"));
toolBarLayout->addWidget(splitAction);
......
......@@ -83,7 +83,7 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
QAction *closeAction = new QAction(tr("Close"), m_toolbar);
closeAction->setToolTip(tr("Close"));
closeAction->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
closeAction->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE_SPLIT_TOP)));
connect(closeAction, SIGNAL(triggered()), this, SIGNAL(closeMe()));
m_toolbar->addAction(closeAction);
......
......@@ -427,6 +427,7 @@ Core::NavigationView ProjectTreeWidgetFactory::createWidget()
filter->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
filter->setToolTip(tr("Filter Tree"));
filter->setPopupMode(QToolButton::InstantPopup);
filter->setProperty("noArrow", true);
QMenu *filterMenu = new QMenu(filter);
filterMenu->addAction(ptw->m_filterProjectsAction);
filterMenu->addAction(ptw->m_filterGeneratedFilesAction);
......
......@@ -72,6 +72,7 @@ OutlineWidgetStack::OutlineWidgetStack(OutlineFactory *factory) :
m_filterButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
m_filterButton->setToolTip(tr("Filter tree"));
m_filterButton->setPopupMode(QToolButton::InstantPopup);
m_filterButton->setProperty("noArrow", true);
m_filterMenu = new QMenu(m_filterButton);
m_filterButton->setMenu(m_filterMenu);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment