Commit ff6d9bca authored by Dominik Haumann's avatar Dominik Haumann Committed by Waqar Ahmed
Browse files

Use QToolButtons

parent 268f9633
......@@ -41,7 +41,7 @@ GitWidget::GitWidget(KateProject *project, KTextEditor::MainWindow *mainWindow,
, m_mainWin(mainWindow)
, m_pluginView(pluginView)
{
m_commitBtn = new QPushButton(this);
m_commitBtn = new QToolButton(this);
m_treeView = new QTreeView(this);
initGitExe();
......@@ -57,8 +57,11 @@ GitWidget::GitWidget(KateProject *project, KTextEditor::MainWindow *mainWindow,
});
m_menuBtn->setIcon(QIcon::fromTheme(QStringLiteral("application-menu")));
// m_commitBtn->setIcon(QIcon(QStringLiteral(":/kxmlgui5/kateproject/git-commit-dark.svg")));
m_commitBtn->setText(i18n("Commit"));
m_commitBtn->setIcon(QIcon::fromTheme(QStringLiteral("svn-commit"))); // ":/kxmlgui5/kateproject/git-commit-dark.svg"
m_commitBtn->setAutoRaise(true);
m_commitBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
m_commitBtn->setSizePolicy(QSizePolicy::Minimum, m_commitBtn->sizePolicy().verticalPolicy());
QVBoxLayout *layout = new QVBoxLayout;
layout->setSpacing(0);
......
......@@ -15,7 +15,6 @@
#include "git/gitstatus.h"
class QTreeView;
class QPushButton;
class QStringListModel;
class GitStatusModel;
class KateProject;
......@@ -48,7 +47,7 @@ public:
private:
QToolButton *m_menuBtn;
QPushButton *m_commitBtn;
QToolButton *m_commitBtn;
QTreeView *m_treeView;
GitStatusModel *m_model;
KateProject *m_project;
......
......@@ -29,7 +29,7 @@ KateProjectView::KateProjectView(KateProjectPluginView *pluginView, KateProject
, m_project(project)
, m_treeView(new KateProjectViewTree(pluginView, project))
, m_filter(new KLineEdit())
, m_branchBtn(new QPushButton)
, m_branchBtn(new QToolButton)
{
/**
* layout tree view and co.
......@@ -42,6 +42,9 @@ KateProjectView::KateProjectView(KateProjectPluginView *pluginView, KateProject
layout->addWidget(m_filter);
setLayout(layout);
m_branchBtn->setAutoRaise(true);
m_branchBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
m_branchBtn->setSizePolicy(QSizePolicy::Minimum, m_branchBtn->sizePolicy().verticalPolicy());
m_branchBtn->setText(GitUtils::getCurrentBranchName(m_project->baseDir()));
m_branchBtn->setIcon(QIcon(QStringLiteral(":/icons/icons/sc-apps-git.svg")));
......
......@@ -14,7 +14,6 @@
#include <QFileSystemWatcher>
class KLineEdit;
class QPushButton;
class KateProjectPluginView;
class BranchesDialog;
class QToolButton;
......@@ -91,7 +90,7 @@ private:
/**
checkout branch button
*/
QPushButton *m_branchBtn;
QToolButton *m_branchBtn;
/**
* The dialog which displays git branches
......
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