Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
ff6d9bca
Commit
ff6d9bca
authored
Feb 21, 2021
by
Dominik Haumann
Committed by
Waqar Ahmed
Feb 21, 2021
Browse files
Use QToolButtons
parent
268f9633
Changes
4
Hide whitespace changes
Inline
Side-by-side
addons/project/gitwidget.cpp
View file @
ff6d9bca
...
...
@@ -41,7 +41,7 @@ GitWidget::GitWidget(KateProject *project, KTextEditor::MainWindow *mainWindow,
,
m_mainWin
(
mainWindow
)
,
m_pluginView
(
pluginView
)
{
m_commitBtn
=
new
Q
Push
Button
(
this
);
m_commitBtn
=
new
Q
Tool
Button
(
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
);
...
...
addons/project/gitwidget.h
View file @
ff6d9bca
...
...
@@ -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
;
Q
Push
Button
*
m_commitBtn
;
Q
Tool
Button
*
m_commitBtn
;
QTreeView
*
m_treeView
;
GitStatusModel
*
m_model
;
KateProject
*
m_project
;
...
...
addons/project/kateprojectview.cpp
View file @
ff6d9bca
...
...
@@ -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
Q
Push
Button
)
,
m_branchBtn
(
new
Q
Tool
Button
)
{
/**
* 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"
)));
...
...
addons/project/kateprojectview.h
View file @
ff6d9bca
...
...
@@ -14,7 +14,6 @@
#include <QFileSystemWatcher>
class
KLineEdit
;
class
QPushButton
;
class
KateProjectPluginView
;
class
BranchesDialog
;
class
QToolButton
;
...
...
@@ -91,7 +90,7 @@ private:
/**
checkout branch button
*/
Q
Push
Button
*
m_branchBtn
;
Q
Tool
Button
*
m_branchBtn
;
/**
* The dialog which displays git branches
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment