Skip to content

Commit 498047f

Browse files
committed
Merge branch 'develop' into feature/#165_Rest-API-New
2 parents 484bc3b + 2278df0 commit 498047f

File tree

4 files changed

+35
-13
lines changed

4 files changed

+35
-13
lines changed

src/main/java/de/doubleslash/keeptime/common/Resources.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public enum RESOURCE {
5353

5454
SVG_PENCIL_ICON("/svgs/pencil.svg"),
5555

56-
SVG_CLIPBOARD("/svgs/clipboard.svg"),
56+
SVG_CLIPBOARD_ICON("/svgs/clipboard.svg"),
5757

5858
SVG_BUG_ICON("/svgs/bug.svg"),
5959

@@ -67,6 +67,8 @@ public enum RESOURCE {
6767

6868
SVG_LICENSES_ICON("/svgs/closed-captioning.svg"),
6969

70+
SVG_MULTIPLE_CLIPBOARD_ICON("/svgs/copy.svg"),
71+
7072
ICON_MAIN("/icons/icon.png")
7173

7274
;

src/main/java/de/doubleslash/keeptime/view/ReportController.java

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ private void updateReport(final LocalDate dateToShow) {
261261
}
262262

263263
final HBox projectButtonBox = new HBox();
264-
projectButtonBox.getChildren().add(createCopyProjectButton(onlyCurrentProjectWork));
264+
projectButtonBox.getChildren().add(createCopyProjectNameButton(project.getName()));
265+
projectButtonBox.getChildren().add(createCopyProjectNotesButton(onlyCurrentProjectWork));
265266

266267
final TreeItem<TableRow> projectRow = new TreeItem<>(
267268
new ProjectTableRow(project, projectWorkSeconds, projectButtonBox));
@@ -414,11 +415,13 @@ private GridPane setUpEditWorkGridPane(final Work work, final Dialog<Work> dialo
414415
return grid;
415416
}
416417

417-
private Button createCopyProjectButton(final List<Work> projectWork) {
418-
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD, 0.03, 0.03));
419-
copyButton.setMaxSize(20, 18);
420-
copyButton.setMinSize(20, 18);
421-
copyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
418+
private Button createCopyProjectNotesButton(final List<Work> projectWork) {
419+
final Button copyNotesButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_MULTIPLE_CLIPBOARD_ICON, 0.03, 0.03));
420+
copyNotesButton.setMaxSize(20, 18);
421+
copyNotesButton.setMinSize(20, 18);
422+
copyNotesButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
423+
copyNotesButton.setTooltip(new Tooltip("Copy Project Notes"));
424+
422425

423426
final EventHandler<ActionEvent> eventListener = actionEvent -> {
424427
LOG.debug("Copy to Clipboard clicked.");
@@ -434,12 +437,30 @@ private Button createCopyProjectButton(final List<Work> projectWork) {
434437
clipboard.setContent(content);
435438
};
436439

437-
copyButton.setOnAction(eventListener);
438-
return copyButton;
440+
copyNotesButton.setOnAction(eventListener);
441+
return copyNotesButton;
442+
}
443+
private Button createCopyProjectNameButton(String projectName) {
444+
final Button copyProjectNameButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD_ICON, 0.03, 0.03));
445+
copyProjectNameButton.setMaxSize(20, 18);
446+
copyProjectNameButton.setMinSize(20, 18);
447+
copyProjectNameButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
448+
copyProjectNameButton.setTooltip(new Tooltip("Copy Project Name"));
449+
450+
final EventHandler<ActionEvent> eventListener = actionEvent -> {
451+
LOG.debug("Copy to Clipboard clicked.");
452+
final Clipboard clipboard = Clipboard.getSystemClipboard();
453+
final ClipboardContent content = new ClipboardContent();
454+
content.putString(projectName);
455+
clipboard.setContent(content);
456+
};
457+
458+
copyProjectNameButton.setOnAction(eventListener);
459+
return copyProjectNameButton;
439460
}
440461

441462
private Node createCopyWorkButton(final Work w) {
442-
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD, 0.03, 0.03));
463+
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD_ICON, 0.03, 0.03));
443464
copyButton.setMaxSize(20, 18);
444465
copyButton.setMinSize(20, 18);
445466
copyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);

src/main/java/de/doubleslash/keeptime/view/ViewController.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,7 @@ private void setUpTime() {
397397

398398
private void setUpTextArea() {
399399
textArea.setWrapText(true);
400-
textArea.setEditable(false);
401-
textArea.editableProperty().bind(mouseHoveringProperty);
402-
400+
textArea.setEditable(true);
403401
textArea.textProperty().addListener((a, b, c) -> controller.setComment(textArea.getText()));
404402
}
405403

src/main/resources/svgs/copy.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)