From b621d63e03a40db76dc7f3f94c01e743c550ebd8 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 7 Apr 2018 23:27:25 +0000 Subject: tlcockpit 0.9 git-svn-id: svn://tug.org/texlive/trunk@47366 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/support/tlcockpit/build.sbt | 2 +- .../src/main/scala/TLCockpit/ApplicationMain.scala | 4 ++ .../src/main/scala/TLCockpit/PkgInfoDialog.scala | 51 ++++++++++++++++------ 3 files changed, 42 insertions(+), 15 deletions(-) (limited to 'Master/texmf-dist/source/support') diff --git a/Master/texmf-dist/source/support/tlcockpit/build.sbt b/Master/texmf-dist/source/support/tlcockpit/build.sbt index 5f3770f7930..8de4ff3e483 100644 --- a/Master/texmf-dist/source/support/tlcockpit/build.sbt +++ b/Master/texmf-dist/source/support/tlcockpit/build.sbt @@ -1,6 +1,6 @@ name := "tlcockpit" -version := "0.8" +version := "0.9" scalaVersion := "2.12.3" diff --git a/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/ApplicationMain.scala b/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/ApplicationMain.scala index 67b60576944..dadb8c516df 100644 --- a/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/ApplicationMain.scala +++ b/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/ApplicationMain.scala @@ -1212,6 +1212,10 @@ tlmgr> table.prefHeight = 300 table.showRoot = false table.vgrow = Priority.Always + table.placeholder = new Label("No backups available") { + opacity = 0.4f + font = msgFont + } table.rowFactory = { _ => val row = new TreeTableRow[TLBackupDisplay] {} val ctm = new ContextMenu( diff --git a/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/PkgInfoDialog.scala b/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/PkgInfoDialog.scala index 82585aa7591..cc417b68f97 100644 --- a/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/PkgInfoDialog.scala +++ b/Master/texmf-dist/source/support/tlcockpit/src/main/scala/TLCockpit/PkgInfoDialog.scala @@ -34,11 +34,23 @@ class PkgInfoDialog(tlp: TLPackage) extends Dialog { padding = Insets(20) } + def copyableTextfield(k: String): TextField = { + new TextField() { + text = k + editable = false + style = "-fx-background-color: rgba(0, 0, 0, 0);" + margin = Insets(0) + padding = Insets(0) + } + } + def do_one(k: String, v: String, row: Int): Int = { - grid.add(new Label(k), 0, row) - grid.add(new Label(v) { - wrapText = true - }, 1, row) + grid.add(copyableTextfield(k), 0, row) + grid.add(copyableTextfield(v), 1, row) + // grid.add(new Label(k), 0, row) + // grid.add(new Label(v) { + // wrapText = true + // }, 1, row) row + 1 } @@ -75,25 +87,29 @@ class PkgInfoDialog(tlp: TLPackage) extends Dialog { //println(tlpkgs(pkg)) val docFiles = tlp.docfiles if (docFiles.nonEmpty) { - grid.add(new Label("doc files"), 0, crow) + // grid.add(new Label("doc files"), 0, crow) + grid.add(copyableTextfield("doc files"), 0, crow) grid.add(doListView(docFiles.map(s => s.file.replaceFirst("RELOC", "texmf-dist")), isInstalled), 1, crow) crow += 1 } val runFiles = tlp.runfiles if (runFiles.nonEmpty) { - grid.add(new Label("run files"), 0, crow) + // grid.add(new Label("run files"), 0, crow) + grid.add(copyableTextfield("run files"), 0, crow) grid.add(doListView(runFiles.map(s => s.replaceFirst("RELOC", "texmf-dist")), false), 1, crow) crow += 1 } val srcFiles = tlp.srcfiles if (srcFiles.nonEmpty) { - grid.add(new Label("src files"), 0, crow) + // grid.add(new Label("src files"), 0, crow) + grid.add(copyableTextfield("src files"), 0, crow) grid.add(doListView(srcFiles.map(s => s.replaceFirst("RELOC", "texmf-dist")), false), 1, crow) crow += 1 } val binFiles = tlp.binfiles if (binFiles.nonEmpty) { - grid.add(new Label("bin files"), 0, crow) + // grid.add(new Label("bin files"), 0, crow) + grid.add(copyableTextfield("bin files"), 0, crow) grid.add(doListView(binFiles.flatMap(_._2).toSeq.map(s => s.replaceFirst("RELOC", "texmf-dist")), false), 1, crow) crow += 1 } @@ -110,13 +126,20 @@ class PkgInfoDialog(tlp: TLPackage) extends Dialog { val vb = new VBox() vb.children = files.map { f => val fields = f.split(" ") - new Label(fields(0)) { - if (clickable) { - textFill = Color.Blue - onMouseClicked = { me: MouseEvent => OsTools.openFile(tlmgr.tlroot + "/" + fields(0)) } - cursor = Cursor.Hand - } + val foo = copyableTextfield(fields(0)) + if (clickable) { + foo.style = foo.getStyle + "-fx-text-fill: blue;" + foo.onMouseClicked = { me: MouseEvent => OsTools.openFile(tlmgr.tlroot + "/" + fields(0)) } + foo.cursor = Cursor.Hand } + foo + // new Label(fields(0)) { + // if (clickable) { + // textFill = Color.Blue + // onMouseClicked = { me: MouseEvent => OsTools.openFile(tlmgr.tlroot + "/" + fields(0)) } + // cursor = Cursor.Hand + // } + // } } vb } else { -- cgit v1.2.3