Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
68ce1dbf
Commit
68ce1dbf
authored
6 years ago
by
Konstantin Kolosovsky
Browse files
Options
Download
Email Patches
Plain Diff
vcs: Implement initial non-modal commit layout
parent
3931fd8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
platform/platform-resources/src/idea/VcsActions.xml
+4
-0
platform/platform-resources/src/idea/VcsActions.xml
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java
+7
-1
.../com/intellij/openapi/vcs/changes/ChangesViewManager.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewCommitPanel.kt
+44
-0
...intellij/openapi/vcs/changes/ui/ChangesViewCommitPanel.kt
with
55 additions
and
1 deletion
+55
-1
platform/platform-resources/src/idea/VcsActions.xml
+
4
-
0
View file @
68ce1dbf
...
...
@@ -293,6 +293,10 @@
<group
id=
"Vcs.CommitExecutor.Actions"
/>
<group
id=
"ChangesView.CommitToolbar"
>
<reference
id=
"Vcs.MessageActionGroup"
/>
</group>
<action
class=
"com.intellij.openapi.vcs.actions.VcsToolbarLabelAction"
id=
"VcsToolbarLabelAction"
text=
"VCS Label"
/>
<group
id=
"VcsToobarActions"
>
...
...
This diff is collapsed.
Click to expand it.
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java
+
7
-
1
View file @
68ce1dbf
...
...
@@ -179,8 +179,14 @@ public class ChangesViewManager implements ChangesViewI, ProjectComponent, Persi
ActionToolbar
changesToolbar
=
createChangesToolbar
();
addBorder
(
changesToolbar
.
getComponent
(),
createBorder
(
JBColor
.
border
(),
SideBorder
.
RIGHT
));
BorderLayoutPanel
changesPanel
=
simplePanel
(
createScrollPane
(
myView
)).
addToLeft
(
changesToolbar
.
getComponent
());
BorderLayoutPanel
contentPanel
=
simplePanel
(
changesPanel
);
if
(
isNonModalCommit
())
{
contentPanel
.
addToBottom
(
new
ChangesViewCommitPanel
(
myProject
));
}
MyChangeProcessor
changeProcessor
=
new
MyChangeProcessor
(
myProject
);
mySplitterComponent
=
new
PreviewDiffSplitterComponent
(
c
hanges
Panel
,
changeProcessor
,
CHANGES_VIEW_PREVIEW_SPLITTER_PROPORTION
,
mySplitterComponent
=
new
PreviewDiffSplitterComponent
(
c
ontent
Panel
,
changeProcessor
,
CHANGES_VIEW_PREVIEW_SPLITTER_PROPORTION
,
myVcsConfiguration
.
LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN
);
myView
.
installPopupHandler
((
DefaultActionGroup
)
ActionManager
.
getInstance
().
getAction
(
"ChangesViewPopupMenu"
));
...
...
This diff is collapsed.
Click to expand it.
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesViewCommitPanel.kt
0 → 100644
+
44
-
0
View file @
68ce1dbf
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package
com.intellij.openapi.vcs.changes.ui
import
com.intellij.openapi.actionSystem.ActionGroup
import
com.intellij.openapi.actionSystem.ActionManager
import
com.intellij.openapi.actionSystem.DataProvider
import
com.intellij.openapi.project.Project
import
com.intellij.openapi.vcs.ui.CommitMessage
import
com.intellij.ui.IdeBorderFactory.createBorder
import
com.intellij.ui.JBColor
import
com.intellij.ui.SideBorder
import
com.intellij.util.ui.JBUI.Borders.emptyLeft
import
com.intellij.util.ui.JBUI.Panels.simplePanel
import
com.intellij.util.ui.UIUtil.addBorder
import
com.intellij.util.ui.UIUtil.getTreeBackground
import
com.intellij.util.ui.components.BorderLayoutPanel
import
javax.swing.JButton
class
ChangesViewCommitPanel
(
val
project
:
Project
)
:
BorderLayoutPanel
(),
DataProvider
{
val
actions
=
ActionManager
.
getInstance
().
getAction
(
"ChangesView.CommitToolbar"
)
as
ActionGroup
val
toolbar
=
ActionManager
.
getInstance
().
createActionToolbar
(
"ChangesView.CommitToolbar"
,
actions
,
false
).
apply
{
setTargetComponent
(
this
@ChangesViewCommitPanel
)
addBorder
(
component
,
createBorder
(
JBColor
.
border
(),
SideBorder
.
RIGHT
))
}
val
commitMessage
=
CommitMessage
(
project
,
false
,
false
,
true
).
apply
{
editorField
.
addSettingsProvider
{
it
.
setBorder
(
emptyLeft
(
3
))
}
editorField
.
setPlaceholder
(
"Commit Message"
)
}
init
{
val
commitButton
=
object
:
JButton
(
"Commit"
)
{
override
fun
isDefaultButton
()
=
true
}
val
buttonPanel
=
simplePanel
()
.
addToLeft
(
commitButton
)
.
withBackground
(
getTreeBackground
())
val
centerPanel
=
simplePanel
(
commitMessage
).
addToBottom
(
buttonPanel
)
addToCenter
(
centerPanel
).
addToLeft
(
toolbar
.
component
).
withBorder
(
createBorder
(
JBColor
.
border
(),
SideBorder
.
TOP
))
withPreferredHeight
(
85
)
}
override
fun
getData
(
dataId
:
String
)
=
commitMessage
.
getData
(
dataId
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help