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

Commit

Permalink
[VersionControl] Added full path as label inside the log view.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger authored and monojenkins committed Oct 31, 2019
1 parent 6b6eaac commit 48f8a1d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ public partial class LogWidget
private global::Gtk.TextView textviewDetails;
private global::Gtk.ScrolledWindow scrolledwindowFiles;
private global::Gtk.ScrolledWindow scrolledwindowFileContents = new ScrolledWindow ();

Label labelFilePathName = new Gtk.Label ();

private HPaned fileHPaned;
private VBox vboxFileContents;

protected virtual void Build ()
{
Expand Down Expand Up @@ -187,7 +189,11 @@ protected virtual void Build ()
this.fileHPaned.Position = 333;

fileHPaned.Add (this.scrolledwindowFiles);
fileHPaned.Add (this.scrolledwindowFileContents);
vboxFileContents = new VBox ();
labelFilePathName.Xalign = 0f;
vboxFileContents.PackStart (labelFilePathName, false, true, 6);
vboxFileContents.PackStart (scrolledwindowFileContents, true, true, 0);
fileHPaned.Add (vboxFileContents);

this.vpaned1.Add (fileHPaned);
this.vbox1.Add (this.vpaned1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,15 @@ void SetDiff (object o, EventArgs args)
this.diffRenderer.Lines = null;
this.scrolledwindowFileContents.Accessible.Description = GettextCatalog.GetString ("empty");

if (!this.treeviewFiles.Selection.GetSelected (out var model, out var iter))
if (!this.treeviewFiles.Selection.GetSelected (out var model, out var iter)) {
labelFilePathName.Text = "";
return;

}
this.diffRenderer.Lines = new string [] { GettextCatalog.GetString ("Loading data…") };
string path = (string)changedpathstore.GetValue (iter, colPath);
FilePath path = (string)changedpathstore.GetValue (iter, colPath);
FilePath personal = Environment.GetFolderPath (Environment.SpecialFolder.Personal);

labelFilePathName.Text = path.IsChildPathOf (personal) ? "~/" + path.ToRelative (personal) : path.ToString ();
var rev = SelectedRevision;
Task.Run (async delegate {
string text = "";
Expand Down

0 comments on commit 48f8a1d

Please sign in to comment.