Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/de/doubleslash/keeptime/common/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public enum RESOURCE {

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

SVG_CLIPBOARD("/svgs/clipboard.svg"),
SVG_CLIPBOARD_ICON("/svgs/clipboard.svg"),

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

Expand All @@ -67,6 +67,8 @@ public enum RESOURCE {

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

SVG_MULTIPLE_CLIPBOARD_ICON("/svgs/copy.svg"),

ICON_MAIN("/icons/icon.png")

;
Expand Down
39 changes: 30 additions & 9 deletions src/main/java/de/doubleslash/keeptime/view/ReportController.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ private void updateReport(final LocalDate dateToShow) {
}

final HBox projectButtonBox = new HBox();
projectButtonBox.getChildren().add(createCopyProjectButton(onlyCurrentProjectWork));
projectButtonBox.getChildren().add(createCopyProjectNameButton(project.getName()));
projectButtonBox.getChildren().add(createCopyProjectNotesButton(onlyCurrentProjectWork));

final TreeItem<TableRow> projectRow = new TreeItem<>(
new ProjectTableRow(project, projectWorkSeconds, projectButtonBox));
Expand Down Expand Up @@ -416,11 +417,13 @@ private GridPane setUpEditWorkGridPane(final Work work, final Dialog<Work> dialo
return grid;
}

private Button createCopyProjectButton(final List<Work> projectWork) {
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD, 0.03, 0.03));
copyButton.setMaxSize(20, 18);
copyButton.setMinSize(20, 18);
copyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
private Button createCopyProjectNotesButton(final List<Work> projectWork) {
final Button copyNotesButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_MULTIPLE_CLIPBOARD_ICON, 0.03, 0.03));
copyNotesButton.setMaxSize(20, 18);
copyNotesButton.setMinSize(20, 18);
copyNotesButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
copyNotesButton.setTooltip(new Tooltip("Copy Project Notes"));


final EventHandler<ActionEvent> eventListener = actionEvent -> {
LOG.debug("Copy to Clipboard clicked.");
Expand All @@ -436,12 +439,30 @@ private Button createCopyProjectButton(final List<Work> projectWork) {
clipboard.setContent(content);
};

copyButton.setOnAction(eventListener);
return copyButton;
copyNotesButton.setOnAction(eventListener);
return copyNotesButton;
}
private Button createCopyProjectNameButton(String projectName) {
final Button copyProjectNameButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD_ICON, 0.03, 0.03));
copyProjectNameButton.setMaxSize(20, 18);
copyProjectNameButton.setMinSize(20, 18);
copyProjectNameButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
copyProjectNameButton.setTooltip(new Tooltip("Copy Project Name"));

final EventHandler<ActionEvent> eventListener = actionEvent -> {
LOG.debug("Copy to Clipboard clicked.");
final Clipboard clipboard = Clipboard.getSystemClipboard();
final ClipboardContent content = new ClipboardContent();
content.putString(projectName);
clipboard.setContent(content);
};

copyProjectNameButton.setOnAction(eventListener);
return copyProjectNameButton;
}

private Node createCopyWorkButton(final Work w) {
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD, 0.03, 0.03));
final Button copyButton = new Button("", SvgNodeProvider.getSvgNodeWithScale(RESOURCE.SVG_CLIPBOARD_ICON, 0.03, 0.03));
copyButton.setMaxSize(20, 18);
copyButton.setMinSize(20, 18);
copyButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/svgs/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.