Commit 24ccd500 authored by jkobus's avatar jkobus Committed by Jarek Kobus

Add a toolbutton for switching diff view mode

Task-number: QTCREATORBUG-10035

Change-Id: I83cb7cec3f4ba484ab068f398a12096501017668
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 8749eee5
......@@ -73,5 +73,7 @@
<file>images/splitbutton_closetop.png</file>
<file>images/splitbutton_vertical.png</file>
<file>images/panel_manage_button.png</file>
<file>images/sidebysidediff.png</file>
<file>images/textdiff.png</file>
</qresource>
</RCC>
......@@ -204,6 +204,8 @@ 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_SIDE_BY_SIDE_DIFF[] = ":/core/images/sidebysidediff.png";
const char ICON_TEXT_DIFF[] = ":/core/images/textdiff.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/QtProject-qtcreator.png";
......
......@@ -89,7 +89,7 @@ static QToolBar *createToolBar(const QWidget *someWidget)
{
// Create
QToolBar *toolBar = new QToolBar;
toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
const int size = someWidget->style()->pixelMetric(QStyle::PM_SmallIconSize);
toolBar->setIconSize(QSize(size, size));
......
This diff is collapsed.
......@@ -126,6 +126,12 @@ public:
StashFlag m_flags;
};
enum DiffEditorType {
DefaultDiffEditor, // value taken from settings
SideBySideDiffEditor,
SimpleTextDiffEditor
};
static const char *stashNamePrefix;
explicit GitClient(GitSettings *settings);
......@@ -137,12 +143,17 @@ public:
QString findRepositoryForDirectory(const QString &dir);
QString findGitDirForRepository(const QString &repositoryDir) const;
void diff(const QString &workingDirectory, const QString &fileName);
void diff(const QString &workingDirectory, const QStringList &unstagedFileNames,
const QStringList &stagedFileNames = QStringList());
void diff(const QString &workingDirectory,
const QString &fileName,
DiffEditorType editorType = DefaultDiffEditor);
void diff(const QString &workingDirectory,
const QStringList &unstagedFileNames,
const QStringList &stagedFileNames = QStringList(),
DiffEditorType editorType = DefaultDiffEditor);
void diffBranch(const QString &workingDirectory,
const QStringList &diffArgs,
const QString &branchName);
const QString &branchName,
DiffEditorType editorType = DefaultDiffEditor);
void merge(const QString &workingDirectory, const QStringList &unmergedFileNames = QStringList());
void status(const QString &workingDirectory);
......@@ -326,8 +337,11 @@ public:
static QString msgNoCommits(bool includeRemote);
public slots:
void show(const QString &source, const QString &id,
const QStringList &args = QStringList(), const QString &name = QString());
void show(const QString &source,
const QString &id,
const QStringList &args = QStringList(),
const QString &name = QString(),
DiffEditorType editorType = DefaultDiffEditor);
void saveSettings();
private slots:
......@@ -338,11 +352,9 @@ private slots:
private:
QTextCodec *getSourceCodec(const QString &file) const;
VcsBase::VcsBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty,
const QString &dynamicPropertyValue) const;
DiffEditor::DiffEditor *findExistingOrOpenNewDiffEditor(const char *registerDynamicProperty,
const QString &dynamicPropertyValue,
const QString &titlePattern,
const Core::Id editorId) const;
const QString &dynamicPropertyValue) const;
DiffEditor::DiffEditor *findExistingDiffEditor(const char *registerDynamicProperty,
const QString &dynamicPropertyValue) const;
enum CodecType { CodecSource, CodecLogOutput, CodecNone };
VcsBase::VcsBaseEditorWidget *createVcsEditor(const Core::Id &kind,
......@@ -352,6 +364,10 @@ private:
const char *registerDynamicProperty,
const QString &dynamicPropertyValue,
QWidget *configWidget) const;
DiffEditor::DiffEditor *createDiffEditor(const char *registerDynamicProperty,
const QString &dynamicPropertyValue,
const QString &titlePattern,
const Core::Id editorId) const;
VcsBase::Command *createCommand(const QString &workingDirectory,
VcsBase::VcsBaseEditorWidget* editor = 0,
......
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