Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 48f8a1d

Browse files
mkruegermonojenkins
authored andcommitted
[VersionControl] Added full path as label inside the log view.
1 parent 6b6eaac commit 48f8a1d

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

main/src/addins/VersionControl/MonoDevelop.VersionControl/Gui/MonoDevelop.VersionControl.Views.LogWidget.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ public partial class LogWidget
2828
private global::Gtk.TextView textviewDetails;
2929
private global::Gtk.ScrolledWindow scrolledwindowFiles;
3030
private global::Gtk.ScrolledWindow scrolledwindowFileContents = new ScrolledWindow ();
31-
31+
Label labelFilePathName = new Gtk.Label ();
32+
3233
private HPaned fileHPaned;
34+
private VBox vboxFileContents;
3335

3436
protected virtual void Build ()
3537
{
@@ -187,7 +189,11 @@ protected virtual void Build ()
187189
this.fileHPaned.Position = 333;
188190

189191
fileHPaned.Add (this.scrolledwindowFiles);
190-
fileHPaned.Add (this.scrolledwindowFileContents);
192+
vboxFileContents = new VBox ();
193+
labelFilePathName.Xalign = 0f;
194+
vboxFileContents.PackStart (labelFilePathName, false, true, 6);
195+
vboxFileContents.PackStart (scrolledwindowFileContents, true, true, 0);
196+
fileHPaned.Add (vboxFileContents);
191197

192198
this.vpaned1.Add (fileHPaned);
193199
this.vbox1.Add (this.vpaned1);

main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,15 @@ void SetDiff (object o, EventArgs args)
476476
this.diffRenderer.Lines = null;
477477
this.scrolledwindowFileContents.Accessible.Description = GettextCatalog.GetString ("empty");
478478

479-
if (!this.treeviewFiles.Selection.GetSelected (out var model, out var iter))
479+
if (!this.treeviewFiles.Selection.GetSelected (out var model, out var iter)) {
480+
labelFilePathName.Text = "";
480481
return;
481-
482+
}
482483
this.diffRenderer.Lines = new string [] { GettextCatalog.GetString ("Loading data…") };
483-
string path = (string)changedpathstore.GetValue (iter, colPath);
484+
FilePath path = (string)changedpathstore.GetValue (iter, colPath);
485+
FilePath personal = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
486+
487+
labelFilePathName.Text = path.IsChildPathOf (personal) ? "~/" + path.ToRelative (personal) : path.ToString ();
484488
var rev = SelectedRevision;
485489
Task.Run (async delegate {
486490
string text = "";

0 commit comments

Comments
 (0)